Integer problems

Status
Not open for further replies.
Level 9
Joined
Jun 20, 2008
Messages
476
i have some hard time with integer

if you played some survival games you should now about food multiboards etc

so i now have a integer i cal it food

if food reaches 0 for a player it needs to kil that player but i got a food for every player so what now( + rep for the guy)
 
No, that won't work.

Maybe something like this will do the job. Loop it from 1 to how many players you have.

EDIT: Updated trigger in another post.

  • Untitled Trigger 074
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer_Array[(Integer A)] Equal to 0
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Game - Defeat (Player((Integer A))) with the message: Defeat!
              • Set Temp_Group_1 = (Units owned by (Player((Integer A))))
              • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
                • Loop - Actions
                  • Unit - Kill (Picked unit)
              • Custom script: call DestroyGroup(udg_Temp_Group_1)
            • Else - Actions
 
Last edited:
Updated trigger:

  • Untitled Trigger 074
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer_Array[(Integer A)] Equal to 0
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Game - Defeat (Player((Integer A))) with the message: Defeat!
              • Set Temp_Group_1 = (Units owned by (Player((Integer A))))
              • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
                • Loop - Actions
                  • Unit - Kill (Picked unit)
              • Custom script: call DestroyGroup(udg_Temp_Group_1)
            • Else - Actions
 
Status
Not open for further replies.
Back
Top