Page 2 of 2

Re: speedChanger Updates for Modders

Posted: Fri Apr 30, 2021 3:51 pm
by l3lessed
I'm going to push one more change to this before I close it out. I realized, there needs to be a modify value property, so modders can use the UID to update their value. This would save the need to continually remove and add values just to update values, and it would make lerping updates easier to push on the modder side.

Re: speedChanger Updates for Modders

Posted: Wed Aug 11, 2021 6:49 pm
by l3lessed
Updated PlayerSpeedChanger and added new console commands again. You can find the addition here. https://github.com/Interkarma/daggerfal ... /pull/2209

Added ModifySpeedMod with console commands

I've added ModifySpeedMod to PlayerSpeedChanger.cs. This object allows developers to modify an already injected walk or run speed modifier value. This helps resolve the issue of having to continually add and remove modifier values to update them by providing a method to access the modifier dictionary and update a modifier value through its assigned UID key. Also, it will make lerping speed changes over time easier and less cycle expensive.

I also added commands to the set_walkspeed and set_runspeed commands for testing this out via console. To modify an already existing/inject speed modifier value merely call set_walkspeed or set_runspeed and after the wanted updated speed value put the UID you want to update. And you're done, value is updated.

As an example of how to add and modify a speed value using the console; this cuts players walk speed by 50%, and then cuts it by 75% using the same modifier.

Code: Select all

set_walkspeed .5
Walk speed Modifier added (UID: a74abae1-3b68-4362-b6f3-9dc86d0c57f0). Walk speed is 2.234177
set_walkspeed .25 a74abae1-3b68-4362-b6f3-9dc86d0c57f0
Walk speed modifier updated (UID: a74abae1-3b68-4362-b6f3-9dc86d0c57f0). Walk speed is 0.8936709