I have a trigger set up that as far as I can tell should return 1 and 0 alternating but instead it's returning 1 every time.
Am I doing something wrong? And is there an easier way to get this working?
What I'm trying to is when I spawn a unit from a certain structure it removes the unit and creates one in one of two regions alternating between the two each time.
Ah, I was even thinking it might need to be a global variable but didn't try it. That'll teach me.
The reason I was having it spawn and then remove a unit is that the units are spawned by players 1-4 from nexuses but need be be controlled by player 9. I also originally had it spawning at both rather than alternating, so I guess your way would make more sense with how I'm trying to make it now, but before I don't think it would have worked before. So basically I'm too lazy to fix it now.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a trigger set up that as far as I can tell should return 1 and 0 alternating but instead it's returning 1 every time. Am I doing something wrong? And is there an easier way to get this working?
What I'm trying to is when I spawn a unit from a certain structure it removes the unit and creates one in one of two regions alternating between the two each time.
just wondering why you create a new 1 on a location and remove the old 1? is it not easier to just instant move the old 1?
oh.. and your using a local variable... that 1 resets every time the trigger finished. so every time it gets set to 0 again
you should use a global variable to make this work (press ctrl+B when you are in the list with all the triggers)
Ah, I was even thinking it might need to be a global variable but didn't try it. That'll teach me. The reason I was having it spawn and then remove a unit is that the units are spawned by players 1-4 from nexuses but need be be controlled by player 9. I also originally had it spawning at both rather than alternating, so I guess your way would make more sense with how I'm trying to make it now, but before I don't think it would have worked before. So basically I'm too lazy to fix it now.