All user-defined variables repeatedly reset to zero

Thank you for the blueprints. What was the exact change made to HUDObie before the issue appeared or is it any change to HUDObie that causes it to happen?

HUDObie doesn’t seem to be causing the problem. If I remove the logic from it, the problem still happens. But the changes that took place are shown (at a distance) in one of my posts above with the before and after shot. The changes involved adding a minimap to the HUD and changing the reticle so it turned red when you looked at an enemy.

Seeing as you are trying to set the values in the defaults tab you may want to remove where you have them being set inside the construction script. Any actions inside the construction script will be run each time an instance of that blueprint is placed in the level or edited within the level (moved, scaled, rotated, etc.) Alternatively, the values set in the construction script will override the default values when the game starts (if the blueprint asset is already in the level) or when the asset is created. As such you may be able to leave the values as they are in the defaults tab if you are manually setting them in the construction script.

The default values are being set in the construction script as a temporary solution to the zeroing issue. It will be removed when the user-defined values stop being forced to zero every time Unreal restarts.

I receive an error when I compile the CharacterObie blueprint stating that the ShowHUD function has no target. That aside I do not see the values reset to zero when I close and reopen the editor. Would you be able to migrate each blueprint into a project one at a time and let me know which one was the last one imported before the problem happens?

You got it! The zeroing issue went away after I removed the ShowHUD function. Potentially, I was accessing the “ShowHUD” variable in HUDObie from CharacterObie before the HUDObie actor existed. The user-defined variables may have been consistently placed in memory where “ShowHUD” was trying to be accessed. Thanks!

Has there been a resolution on this?

I’m still suffering the issue as well. Here is my very simple BP:

Essentially it calls an interface with the text in the default variable. I place a load of these in the level and set them to all the value I need the characters who walk over them to say.

I can’t get it to reset on demand despite spending an hour trying to figure out what causing it but just every now and again when I open my project all the instances in the project will be reset back to the default value.

I’ve tried altering the BP ->quitting/starting, packaging ->quitting/starting.Rebuilding the interface etc etc It doesn’t seem to follow any logical path that I can discover.

I can’t use the suggested fix of setting the value on construction as there are lots of instance of this

Hey xrouter-

Do you have a function in your blueprint that tries to interact with your HUD in any way?

Not directly no, the above is the only functionality in that BP. I do display the text to the HUD but that is done by another separate BP which pulls the text out of a user structure. The interface function I’m calling in the above BP simply sets that user structure.

To get the trigger volume to reset you will need to plug something into the Reset input of your Do Once node. If that action happens it will allow the volume to be triggered again. As for the variable values resetting to zero, the fix for eglynum was to remove a function that was accessing the HUD from a blueprint before an instance of that blueprint existed. You may want to check when and where your blueprint tries to access or draw to the HUD.

Ok I’ll check the chain for the HUD draws.

When I said ‘Reset’ I was referring to my attempts to see what was triggering the variable resetting to its default value rather than getting the do once to reset (sorry if that was confusing)

Big thanks to this thread. I had a semi related problem and it was solved via /eglynum’s first comment about the construction script tab.

I’m seeing this issue appear again in 4.7.6. Default values for Integers keep getting reset to 0 when Unreal starts. I have no errors in my output log.

Hey Tulrath-

Where are you seeing the values resetting to 0? Is this happening inside blueprints or elsewhere? If this is happening in blueprints are any of them based on custom code classes you’ve created? Please let me know if there’s any additional information you can provide to help narrow down where this is occurring.

Cheers

My project started resting its variables out of the blue. (4.7.6)
Right now only resets to zero some booleans and integers.

I have an array (50) of custom structures(18 values (3d meshes audio files , damage stats names etc) in a save object.
I I try to change them the editor crashes sometimes and refuses to pack the game after that and I have to restore the WHOLE project folder not just content and confing…

Hey Midnight640-

If the problem that you’re having is causing a crash you may want to create a separate post. If so can you provide some more information about what’s happening in your project. Are the variables that are being reset inside of blueprints? Are they specific to certain instances in the level? Additionally, if you are getting a crash can you post the callstack and log file to help identify where the crash is occurring.

Cheers