• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

GUI Condition problem

Status
Not open for further replies.
Hi. I have a problem with a condition.

  • Attack
    • Events
      • Time - Attack_Timer[1] expires
      • Time - Attack_Timer[2] expires
      • Time - Attack_Timer[3] expires
      • Time - Attack_Timer[4] expires
      • Time - Attack_Timer[5] expires
      • Time - Attack_Timer[6] expires
      • Time - Attack_Timer[7] expires
      • Time - Attack_Timer[8] expires
      • Time - Attack_Timer[9] expires
      • Time - Attack_Timer[10] expires
      • Time - Attack_Timer[11] expires
      • Time - Attack_Timer[12] expires
    • 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
              • (Integer A) Equal to (Player number of (Triggering player))
            • Then - Actions
              • Set Attack_Integer[(Integer A)] = 10
I don't know what to put in the place of
  • (Integer A) Equal to (Player number of (Triggering player))
to make this trigger work for all 12 players.
So, any ideas?
If you want the whole trigger, it is downwards :3





  • Attack
    • Events
      • Time - Attack_Timer[1] expires
      • Time - Attack_Timer[2] expires
      • Time - Attack_Timer[3] expires
      • Time - Attack_Timer[4] expires
      • Time - Attack_Timer[5] expires
      • Time - Attack_Timer[6] expires
      • Time - Attack_Timer[7] expires
      • Time - Attack_Timer[8] expires
      • Time - Attack_Timer[9] expires
      • Time - Attack_Timer[10] expires
      • Time - Attack_Timer[11] expires
      • Time - Attack_Timer[12] expires
    • 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
              • (Integer A) Equal to (Player number of (Triggering player))
            • Then - Actions
              • Set Attack_Integer[(Integer A)] = 10
              • Set Attack_Boolean[(Integer A)] = True
              • Set Attack_Range[(Integer A)] = Weapon_Range[(Integer A)]
              • Set Attack_DamageMax[(Integer A)] = Weapon_DamageMax[(Integer A)]
              • Set Attack_DamageMin[(Integer A)] = Weapon_DamageMin[(Integer A)]
              • Set Attack_Damage[(Integer A)] = (Random integer number between Attack_DamageMin[(Integer A)] and Attack_DamageMax[(Integer A)])
              • Set Attack_Point[(Integer A)] = (Position of Character[(Integer A)])
              • Set Attack_Point[(Integer A)] = (Attack_Point[(Integer A)] offset by Attack_Range[(Integer A)] towards (Facing of Character[(Integer A)]) degrees)
              • Set Attack_Group[(Integer A)] = (Units within Attack_Range[(Integer A)] of Attack_Point[(Integer A)] matching ((Matching unit) Not equal to Character[(Integer A)]))
              • Unit Group - Pick every unit in Attack_Group[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Set Attack_Target[(Integer A)] = (Picked unit)
                  • Set FellBoolean[(Player number of (Owner of Attack_Target[(Integer A)]))] = True
                  • Set Attack_Damage[(Integer A)] = (Random integer number between Attack_DamageMin[(Integer A)] and Attack_DamageMax[(Integer A)])
                  • Set Attack_Damage[(Integer A)] = (Attack_Damage[(Integer A)] - (Custom value of Attack_Target[(Integer A)]))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Attack_Damage[(Integer A)] Less than 0
                    • Then - Actions
                      • Set Attack_Damage[(Integer A)] = 0
                    • Else - Actions
                  • Set Attack_Point[((Integer A) + 24)] = (Position of Attack_Target[(Integer A)])
                  • Animation - Play Attack_Target[(Integer A)]'s stand hit animation
                  • Unit - Cause Character[(Integer A)] to damage Attack_Target[(Integer A)], dealing (Real(Attack_Damage[(Integer A)])) damage of attack type Chaos and damage type Normal
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Attack_Damage[(Integer A)] Equal to 0
                    • Then - Actions
                      • Floating Text - Create floating text that reads Blocked! above Attack_Target[(Integer A)] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                      • Set Attack_Text[(Integer A)] = (Last created floating text)
                    • Else - Actions
                      • Floating Text - Create floating text that reads (String(Attack_Damage[(Integer A)])) above Attack_Target[(Integer A)] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                      • Set Attack_Text[(Integer A)] = (Last created floating text)
                  • Set Attack_Text[(Integer A)] = (Last created floating text)
                  • Floating Text - Change Attack_Text[(Integer A)]: Disable permanence
                  • Floating Text - Change the fading age of Attack_Text[(Integer A)] to 0.01 seconds
                  • Floating Text - Change the lifespan of Attack_Text[(Integer A)] to 1.00 seconds
              • Custom script: call RemoveLocation(udg_Attack_Point[bj_forLoopAIndex])
              • Custom script: call RemoveLocation(udg_Attack_Point[bj_forLoopAIndex - 12])
              • Custom script: call RemoveLocation(udg_Attack_Point[bj_forLoopAIndex - 24])
            • Else - Actions
 
I don't know if such thing exists, but you should try to check if the Expired Timer (event response) is equal to Attack_Timer[(Integer A)] instead of the other condition.

If it doesn't exist, try to see if this works:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Custom script: if GetExpiredTimer() == udg_Attack_Timer[bj_forLoopAIndex] then
      • // place your actions here and use (Integer A)
      • Custom script: endif
 
Level 5
Joined
Jun 16, 2004
Messages
108
What PurgeandFire111 posted should work fine, did you remove the triggering player condition? It should look something like this, just as he said:
  • Attack
    • Events
      • Time - Attack_Timer[1] expires
      • Time - Attack_Timer[2] expires
      • Time - Attack_Timer[3] expires
      • Time - Attack_Timer[4] expires
      • Time - Attack_Timer[5] expires
      • Time - Attack_Timer[6] expires
      • Time - Attack_Timer[7] expires
      • Time - Attack_Timer[8] expires
      • Time - Attack_Timer[9] expires
      • Time - Attack_Timer[10] expires
      • Time - Attack_Timer[11] expires
      • Time - Attack_Timer[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_Attack_Timer[bj_forLoopAIndex]) then
          • Set Attack_Integer[(Integer A)] = 10
          • Set Attack_Boolean[(Integer A)] = True
          • Set Attack_Range[(Integer A)] = Weapon_Range[(Integer A)]
          • Set Attack_DamageMax[(Integer A)] = Weapon_DamageMax[(Integer A)]
          • Set Attack_DamageMin[(Integer A)] = Weapon_DamageMin[(Integer A)]
          • Set Attack_Damage[(Integer A)] = (Random integer number between Attack_DamageMin[(Integer A)] and Attack_DamageMax[(Integer A)])
          • Set Attack_Point[(Integer A)] = (Position of Character[(Integer A)])
          • Set Attack_Point[(Integer A)] = (Attack_Point[(Integer A)] offset by Attack_Range[(Integer A)] towards (Facing of Character[(Integer A)]) degrees)
          • Set Attack_Group[(Integer A)] = (Units within Attack_Range[(Integer A)] of Attack_Point[(Integer A)] matching ((Matching unit) Not equal to Character[(Integer A)]))
          • Unit Group - Pick every unit in Attack_Group[(Integer A)] and do (Actions)
            • Loop - Actions
              • Set Attack_Target[(Integer A)] = (Picked unit)
              • Set FellBoolean[(Player number of (Owner of Attack_Target[(Integer A)]))] = True
              • Set Attack_Damage[(Integer A)] = (Random integer number between Attack_DamageMin[(Integer A)] and Attack_DamageMax[(Integer A)])
              • Set Attack_Damage[(Integer A)] = (Attack_Damage[(Integer A)] - (Custom value of Attack_Target[(Integer A)]))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Attack_Damage[(Integer A)] Less than 0
                • Then - Actions
                  • Set Attack_Damage[(Integer A)] = 0
                • Else - Actions
              • Set Attack_Point[((Integer A) + 24)] = (Position of Attack_Target[(Integer A)])
              • Animation - Play Attack_Target[(Integer A)]'s stand hit animation
              • Unit - Cause Character[(Integer A)] to damage Attack_Target[(Integer A)], dealing (Real(Attack_Damage[(Integer A)])) damage of attack type Chaos and damage type Normal
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Attack_Damage[(Integer A)] Equal to 0
                • Then - Actions
                  • Floating Text - Create floating text that reads Blocked! above Attack_Target[(Integer A)] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                  • Set Attack_Text[(Integer A)] = (Last created floating text)
                • Else - Actions
                  • Floating Text - Create floating text that reads (String(Attack_Damage[(Integer A)])) above Attack_Target[(Integer A)] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                  • Set Attack_Text[(Integer A)] = (Last created floating text)
              • Set Attack_Text[(Integer A)] = (Last created floating text)
              • Floating Text - Change Attack_Text[(Integer A)]: Disable permanence
              • Floating Text - Change the fading age of Attack_Text[(Integer A)] to 0.01 seconds
              • Floating Text - Change the lifespan of Attack_Text[(Integer A)] to 1.00 seconds
          • Custom script: call RemoveLocation(udg_Attack_Point[bj_forLoopAIndex])
          • Custom script: call RemoveLocation(udg_Attack_Point[bj_forLoopAIndex - 12])
          • Custom script: call RemoveLocation(udg_Attack_Point[bj_forLoopAIndex - 24])
          • Custom script: endif
With this sort of thing it should find the correct expired timer at the least. There might be other problems, but for now I assume you are just having a timer problem.

You can verify if it is finding the right timer by printing a message like so:
  • Game - Display to (All players) the text: ((String((Integer A))) + expired)
After the jass IF check.
 
It still doesn't work :/ Maybe there is a problem here?

  • Attack Cast
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
      • Player - Player 10 (Light Blue) Selects a unit
      • Player - Player 11 (Dark Green) Selects a unit
      • Player - Player 12 (Brown) Selects a unit
    • 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
              • And - All (Conditions) are true
                • Conditions
                  • (Triggering unit) Equal to F1[(Integer A)]
                  • FellBoolean[(Integer A)] Equal to False
                  • (Integer A) Equal to (Player number of (Triggering player))
            • Then - Actions
              • Unit - Set the custom value of Character[(Integer A)] to 0
              • Selection - Clear selection for (Player((Integer A)))
              • Set AnimInteger[(Integer A)] = 58
              • Custom script: call SetUnitAnimationByIndex(udg_Character[bj_forLoopAIndex],(58))
              • Set Attack_Speed[(Integer A)] = Weapon_Speed[(Integer A)]
              • Countdown Timer - Start Attack_Timer[(Integer A)] as a One-shot timer that will expire in Attack_Speed[(Integer A)] seconds
            • Else - Actions
 
Status
Not open for further replies.
Top