Stats Reset automatically

KhadimBalti

New member
Hi @Justin
Hope you are doing well! I have been trying to figure out a solution for the said issue below since last 4 months but I was not able to come up with a proper solution, please let me know if you have any idea:
Problem domain: The problem is with weapons stats data.
Problem statement: Stats data is reset to previous stats values after a long time of 3 days or more and all settings with weapons aim and idle stats are marred.
How I save stats values?
1. Create stats by clicking add new stats at slot
2. Play in a test scene with the character and weapon on which stats to be set
3. After certain value changes when i feel better stats data values I go to the active stats in items def and save at runtime.
4. Verify values in stats objects before i stop play mode in unity.
5. Stop play mode and check the stats data again and play again and test it ........ goes fine
6. Move on to net characters or weapons and repeat the steps for that.
At the end I check the first character and found sometimes good and sometimes with reset values so bad. Mostly it takes 12 to 24 hours or more to be reset values automatically.
I have also been asking it to you so many times at discord channels and on forum too.
 
If you place a breakpoint/log statement within the value that is being reset you can then look at the callstack to determine what is triggering that reset.
 
If you place a breakpoint/log statement within the value that is being reset you can then look at the callstack to determine what is triggering that reset.
My I know how can I place breakpoint/log statement within values of stats object?
 
I was keeping state-configuration settings while create the item, does it matters?

No, that only sets the value once when creating the item. It's also editor only code.

My I know how can I place breakpoint/log statement within values of stats object?
I'm not sure what stats object you are referring to, but you'd place a breakpoint/log in the property assignment for the value that is changing.
 
I look it is missed while pushing to github is it skipped or not as I have gone through .gitIgnore file there is not mentioned .asset files since when I open git bash and check status then the state values changes are not detected in bash also?
 
No, that only sets the value once when creating the item. It's also editor only code.


I'm not sure what stats object you are referring to, but you'd place a breakpoint/log in the property assignment for the value that is changing.
I am so confused that in states how is it possible to place a breakpoint/log statement to check what is the cause
 
You can place a breakpoint on log statement on the property that changes the field value.
 
You can place a breakpoint on log statement on the property that changes the field value.
It is so confusing part main I couldn't understand and it is not being resolved. Is it possible that values reset in states automatically when any object in the prefab is reset?
 
When an object is instantiated at runtime the link with the prefab is no longer there so resetting the prefab would not reset a field value within a scene object.

Have you inserted the log statement or breakpoint to determine what is resetting the field value? What field are you referring to?

And how is that possible? a scriptable resets it's values for no reason/ when there is no action is being performed on them?
If the value resets then an action is performed on them. From your explanation it sounds like another script is resetting the value but you don't know what script it is.

My guess is that you have some gameplay logic that gets triggered (either by time or by game conditions such as a trigger) and that is calling a state which resets the value. There isn't anything within the character controller that will automatically reset the values after a certain amount of time. You can verify this by creating a new project and creating a new scene with just the character in it and a plane. No matter how long your character stands there the values will not reset.
 
When an object is instantiated at runtime the link with the prefab is no longer there so resetting the prefab would not reset a field value within a scene object.

Have you inserted the log statement or breakpoint to determine what is resetting the field value? What field are you referring to?


If the value resets then an action is performed on them. From your explanation it sounds like another script is resetting the value but you don't know what script it is.

My guess is that you have some gameplay logic that gets triggered (either by time or by game conditions such as a trigger) and that is calling a state which resets the value. There isn't anything within the character controller that will automatically reset the values after a certain amount of time. You can verify this by creating a new project and creating a new scene with just the character in it and a plane. No matter how long your character stands there the values will not reset.
There is nothing on players other than controller scripts and my characters are also newly created in a new test scene and I also created the new states for weapons I am using on these characters.
 
Last edited:
There is nothing on players other than controller scripts and my characters are also newly created in an new test scene and I also created the new states for weapons I am using on these characters.
By the way I couldn't understand how to place and where to place log statement or break point for this issue, it would be better if a simple video is recorded and send the link to me I would be happy
 
I know this method it is useful when you know the problem location and source of the problem. But not useful in my case because I don't know either this issue is being created by a script or any other thing. One thing I know is; it happens with some of the characters randomly not specific to one not with all characters. And this may raise question " is there any difference btw characters by attached scripts or any other thing?" certainly not; because all characters are just created from character manager and added items also with the help of standards described in manual or tutorials at opsive site. And make sure there is no gameplay logics in the current scene; it is a flash new scene where I just setup new characters and weapons.
 
What exactly is happening? It's really hard to say what is going on because I don't know what field is being reset. You mention that the stats value is being reset - we don't have any stats included so I'm not sure what object you are referring to.
 
What exactly is happening? It's really hard to say what is going on because I don't know what field is being reset. You mention that the stats value is being reset - we don't have any stats included so I'm not sure what object you are referring to.
Wow! so nice of you sir, 1675155933317.png
these values sometimes for some characters being reset themselves.
 
Hmm, that's really strange. I am not sure what would cause that and I haven't seen it occur before. Is it all presets that reset or only certain ones?
 
Top