Variable Adding

Status
Not open for further replies.
Level 7
Joined
Apr 3, 2007
Messages
293
I have a variable with an array of 10. I want to make my trigger so that when a unit enters that region, he will be added to the variable. Once it gets to 10, the game ends. I can't seem to get it to add. I have...
  • Event-Unit Enters Region
  • Condition-Owner of Triggering Unit = to Dark Green
  • Action-Set (Unit trigger)[(Interger A)]=(entering unit)
  • ______________________________________________
  • Event-Unit Enters Region
  • Condition-Triggering unit equal to (Unit Trigger)[10]
  • Action-Victory Player 1 red
But this doesn't work, what is wrong? The line in the middle of the 2 triggers just seperates them.
 
Level 7
Joined
Apr 3, 2007
Messages
293
I have one more problem I need help with, and maybe you could fix it. When you select a unit he becomes an ally and so do his friends, but only the one unit you selected is at you'r cntrl. When that one unit dies, then his friends become you'r enemy again. That is where I am having trouble, I can't seem to get player red (you) and them to unally. The problem is most likely in the middle picture.
 

Attachments

  • untitled.JPG
    untitled.JPG
    16 KB · Views: 110
  • untitled2.JPG
    untitled2.JPG
    35.4 KB · Views: 95
  • untitled3.JPG
    untitled3.JPG
    40 KB · Views: 67
hmm ok if i understand correctly
  • Leader Trig
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in Allies and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Change color
This will make all units in group "allies" to go back to gray's units when one of red's unit dies. when you click the unit, add his "friends" to the "allies group.
 
Level 7
Joined
Apr 3, 2007
Messages
293
hmm ok if i understand correctly
  • Leader Trig
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in Allies and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Change color
This will make all units in group "allies" to go back to gray's units when one of red's unit dies. when you click the unit, add his "friends" to the "allies group.

What I want is for gray to treat red as an enemy, but red can also select a Dark Greens units, and the same thing will happen. So I need red and gray to treat eachother as enemies, but I want the same thing to happen with Dark Green. Basicly, if red selects one of Dark Greens (DG) units he will become contropled by red, the same thing if u select a gray unit, !!!BUT!!! there is more than 1 player in the game, there are 5, what I cant get it 2 do is verify witch player it is unallying gray/DG. DO you get it?
 
Level 7
Joined
Apr 3, 2007
Messages
293
then make 2 triggers.

Ive done that already. The problem is that they wont unally. It might have to do something with the variables. I alrdy posted the pictures of the 3 triggers I use to do this. Im 70% sure that it has something to do with the Previous_owner_of_red variable.

Previous_owner_of_red-player variable, does not have an array.

Hello?
 
Last edited:
Status
Not open for further replies.
Top