[4.7.3] Structs don't set correctly using exposed on spawn in standalone game mode/Struct Corrupting

Hey there,

I think I may have found a bug. I am using 4.7.3. I have an actor that has some custom structs as variables that are exposed on spawn. When i spawn my actor and plug structs into the exposed on spawn section the values do not seem to go through. To replicate;

This only happens in standalone! it works fine in editor!

  1. Create new level
  2. Create struct and add a variable (I used an int)
  3. Create a blueprint and add the new struct as a variable and make it editable/exposed on spawn
  4. From event begin play have it print your variable inside your struct (struct > break > convert to string)
  5. Create a 2nd blueprint and have this one spawn the first blueprint on event begin play
  6. Use a make struct on the exposed on spawn variable to set it to anything
  7. Add this second blueprint to the level
  8. Click play in stand alone game and watch as it prints the default value instead of what you pass on spawn.

I hope my instructions are clear enough. If they arn’t or you need anything please let me know

Thanks

I think this might be related. I just noticed that if I close the editor and open it again I get the same issue as shown here

https://answers.unrealengine.com/questions/197265/why-do-i-have-all-these-random-letters-and-number.html

I’m going to try turning off expose on spawn and see if the letters and numbers still reappear.

Edit: Turned off expose on spawn didn’t stop the random numbers and letters appearing

Another piece of info - I couldn;t package the game untill I manually removed all references to the Struct that has the crazy letters and numbers. I tried making a brand new struct after removing the old one completely but that one as well got loads of crazy numbers and letters after it.

I’m really at a loss with this. The random letters and numbers only seem to happen to new structs (some of my older ones appear to be fine) and only seems to corrupt inside certain blueprints (other structs are present and fine so I don’t think it can just be the blueprints fault). I’ve tried duplicating a struct that already works but the duplicate then corrupts even if I make no edits. I’m sensing a general instability in structs.

Hi mrcrocker,

Thank you for the report, we are currently trying to find a reproducible case for this error. Would you be able to reproduce this in a small test project and post it here? Or send me a link by Private Message on the Forums to download your project?

I’m not sure I can replicate this in a fresh project (possibly related to upgrading versions?) but I will send you a link to my full project in a PM

Now this is odd. I downloaded your project and followed the repro steps but I still can’t get a struct to corrupt. I even made changes to some of your existing structs and they don’t display the string of letters/numbers either. Could you point me to a blueprint that contained a corrupted struct in the project you sent? Screenshots may help as well.

No problem I just recreated the issue in the project. I realise I left one of the broken structs in so I used that one. Here is a screenshot.

So you can see there I added an “ArmorStruct” variable to the AdvancedPlayercCharacter blueprint. Then in the construction script I broke the struct apart. saved and re-opened to find that. Armorstruct should already exist in yours but I get the same results if I create a new struct or duplicate an existing one such as “weaponstruct”

Let me know if this helps!

Hi mrcrocker,

Thanks for the project and the additional repro steps. I was able to reproduce the issue and I have created JIRA UE-12550 in our tracking software. Our developers are aware of the issue and they will be investigating it further.

We will post back here with updates as we have them.

Cheers,

TJ

That’s great news. Sorry to hassle you some more but do you have any indication of how long it might take to get this fixed and then merged onto the launcher engine version?

It’s hard to tell, the dev I spoke to seems to think this may be caused by a combination of a few issues with structs. If all goes well with the investigation you could see it as soon as 4.8, but I can’t say for certain until we know more.

I think it is the same problem as https://answers.unrealengine.com/questions/190159/struct-default-values-get-reset-after-closing-proj.html