• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unit variable turning to (null) after a period of time

Status
Not open for further replies.
Level 4
Joined
Sep 28, 2016
Messages
47
Hi all,

This is strange. I have a main unit which is stored in a variable and must remain in there throughout the game. At times the unit is switched, because the unit 'turns' into a building, and back. But at each point the variable carefully tracks the correct unit.

Now, all was well until I started making enemy wave spawns. The triggers to spawn enemy waves check what type of unit is in the main unit variable. Depending on which 'level' (unit type) of unit it is, the trigger will spawn easier or harder enemies. After a couple of waves, the unit variable starts showing as "(null)" (I set a trigger to show me the unit name of the variable every 1 seconds(s)).

Anyone have any idea why a unit variable can just be emptying like this? I've gone through the object editor and traced every mention of the variable and can't find anything that would empty it. Now I'm trying to do a unit group check (every unit in playable area matching correct unit type) and then put that into the variable to 'refresh' the variable manually so if it empties, it should fill again, but this is a bad workaround..

Seems like a bug.
 
Level 4
Joined
Sep 28, 2016
Messages
47
Impossible to picture what you're doing if you don't show the triggers.

Not sure which triggers to post.
I couldn't trace any connection with any of the triggers that handle the variable.

I haven't seen any issues since using that 'workaround' but it'd be nice to understand why a unit variable might just empty all by itself..
 
Status
Not open for further replies.
Top