Changing Default values on States

Ol' Rusty

New member
Hello all,
I am having some issues where addressing certain values through code does not solidify them in stone, for example, attribute.MaxValue. When I change the Max Value in code and then activate and deactivate a different State the values will return to the values set in the Default State. This state cannot be edited according to the docs. I have a solution somewhat sorted out, but it seems inefficient and possibly error-prone so I am wondering if there is an official safe way to address and permanently change these values in-game without using the State System. I have everything prepared for a functioning progression system and just need this last little bit, so if anyone has any suggestions or ideas I would love to hear them.
Thank you for your time! :)

TL;DR: Is there an easy, safe and less error-prone way to change values that are also addressed by the State System (such as attribute.MaxValue) through code without them reverting to default state values when another state is activated and deactivated?
 
This counters the idea of the state system. The state system maps a value to a state, so same state, same value. I would not recommend to misuse the system.
 
Thank you for the quick response! Would it be appropriate to listen for state changes each time a state is toggled and use the default state property values as the basis for a calculation that will occur when the default state is the only active state on a given component? Ideally this would give full control to the State System and make my custom scripts apply changes after the default state is determined to be the only active state. I'm not necessarily looking for easy, just possible :)
 
For sure, you can try this out. But keep in mind that states are set even you are not using them. So It's very likely that not only the default state is active most of the time. It might be easier to check for specific states to be active, and build your solution on that basis.
 
Top