Unit Arrays

agentanorxia

New Member
Reaction score
0
Hello All,
I'm trying to do a relatively simplistic thing - at the beginning of the game, set an array to five units that are already created and access them later.

So I set up a global variable, set array[1], array[2], array[3]... to be units. I then create a trigger that has as an event saying when array[3] dies, do X. However, when any unit dies, the action happens. Any idea why?

Thanks
 

Arkless

New Member
Reaction score
31
My guess is that the array is empty at the moment you are adding the event to the trigger. The event does not use any variables, only the value saved, so when it is empty it probably uses the any unit event.
 

agentanorxia

New Member
Reaction score
0
I think Arkless is right, I set a wait of a second and it seemed to work (couldn't test extensively yet) but the event stopped firing on every unit death. It must load up the triggers before the actions in map init triggers happen.

Thanks a ton.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top