StateLabel variables change their value sometimes.

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

StateLabel variables change their value sometimes.

Post by Accensus »

Tested and reproduced on g4.5pre-205-gda4e791a3, but it doesn't seem to be unique to that version. No idea when exactly it got "broken".
This is one of those bugs that I cannot easily reproduce and it only happens after reloading a save game. It happens with the companion mod for Hideous Destructor (yeah, I know, the chances of this getting fixed just dropped down to practically none, but I'm reporting it anyway).

More details:
- The variables are assigned only once, here, so accidental assignment is completely out of the question.
- FollowerWeapon.Create() is called here and only once when the follower is created for the very first time when you start a new game, here.
- The last and only time this happened (to me), FireState somehow managed to get the value of ReloadState. I don't know how, I don't know why.
- Other people have reported the follower straight up disappearing, which I assume is because FireState's value is a non-existent state label in the actor. This is where it happens.

Sadly I am unable to give more information at the time, much less make a contained example. I'm still trying to reproduce this. I suspect it's because I changed the code a little between save games (in a completely unrelated part of the follower, mind you), but never before have I had something like this happen with any other variables. I don't know if the people who originally reported this to me have added/removed mods or changed the code between saving and loading their games.
User avatar
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: StateLabel variables change their value sometimes.

Post by Accensus »

It seems like this happens on saving and stays broken permanently. I still haven't found a way to reliably reproduce it, but it would appear that it's not necessarily affected by code changes. I suspect some sort of serialization issue.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: StateLabel variables change their value sometimes.

Post by Graf Zahl »

At the moment StateLabels are not safely serializable, they are meant for transiently pass around a state name, so that some target actor can retrieve a real state from it (which can be stored persistently), but not for actually keeping it around.
User avatar
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: StateLabel variables change their value sometimes.

Post by Accensus »

Figured as much. Well I rewrote most of the code to avoid this issue so it's no longer a problem.
Post Reply

Return to “Bugs [GZDoom]”