speedChanger Updates for Modders

Discuss coding questions, pull requests, and implementation details.
l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: speedChanger Updates for Modders

Post 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.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: speedChanger Updates for Modders

Post 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
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Post Reply