• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger Problems and Triggers Interfering

Status
Not open for further replies.
Level 4
Joined
Nov 22, 2011
Messages
73
Hey! I've had this problem for some while now. Two systems that I imported into my map are not working properly. First I imported one of them and it worked as it should. Then when I imported the second one, both of them didn't work. This system...
  • Set Damage
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 6)) Equal to (==) setdam
        • Then - Actions
          • Set INT_DamageSys_SETdamage = (Integer((Substring((Entered chat string), 8, 12))))
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 6)) Equal to (==) adddam
        • Then - Actions
          • Set INT_DamageSys_ADDdamage = (Integer((Substring((Entered chat string), 8, 12))))
        • Else - Actions
      • Unit Group - Pick every unit in UNIG_Group_A and do (Actions)
        • Loop - Actions
          • Set UNI_DamageSys_Unit = (Picked unit)
          • Trigger - Run Set Damage System <gen> (checking conditions)
  • Set Damage System
    • Events
    • Conditions
    • Actions
      • -------- Required if unit does not have the dummy ability to begin with --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of ABIAR_DamageSys_Damage[1] for UNI_DamageSys_Unit) Equal to (==) 0
          • Then - Actions
            • Do Multiple ActionsFor each (Integer A) from 1 to INT_DamageSys_DigitCount, do (Actions)
              • Loop - Actions
                • Unit - Add ABIAR_DamageSys_Damage[(Integer A)] to UNI_DamageSys_Unit
          • Else - Actions
      • -------- Determine Current Damage --------
      • Set INT_DamageSys_CurrentDmg = 0
        • Do Multiple ActionsFor each (Integer A) from 1 to INT_DamageSys_DigitCount, do (Actions)
          • Loop - Actions
            • Set INT_DamageSys_CurrentDmg = (INT_DamageSys_CurrentDmg + (((Level of ABIAR_DamageSys_Damage[(Integer A)] for UNI_DamageSys_Unit) - 1) x (Integer((Power(10.00, ((Real((Integer A))) - 1.00)))))))
      • -------- Add Damage --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • INT_DamageSys_ADDdamage Greater than (>) 0
          • Then - Actions
            • Set INT_DamageSys_ADDdamage = (INT_DamageSys_ADDdamage + INT_DamageSys_CurrentDmg)
              • Do Multiple ActionsFor each (Integer A) from 1 to INT_DamageSys_DigitCount, do (Actions)
                • Loop - Actions
                  • Set INT_General = ((INT_DamageSys_ADDdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
                  • Unit - Set level of ABIAR_DamageSys_Damage[(Integer A)] for UNI_DamageSys_Unit to (INT_General + 1)
          • Else - Actions
            • Do Multiple ActionsFor each (Integer A) from 1 to INT_DamageSys_DigitCount, do (Actions)
              • Loop - Actions
                • Unit - Set level of ABIAR_DamageSys_Damage[(Integer A)] for UNI_DamageSys_Unit to 1
                • Set INT_General = ((INT_DamageSys_SETdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
                • Unit - Set level of ABIAR_DamageSys_Damage[(Integer A)] for UNI_DamageSys_Unit to (INT_General + 1)
      • Set INT_DamageSys_ADDdamage = 0
      • Set INT_DamageSys_SETdamage = 0
... is working somewhat. It increases the damage of one of the units in UNIG_Group_A, but not all of them. How can I fix that? Also, once I use the setdam command in game it makes this trigger not work:
  • Set Life
    • Events
      • Player - Player 1 (Red) types a chat message containing setlife as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 8)) Equal to (==) setlife
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Set INT_Temp_Integer_HP = (Integer((Substring((Entered chat string), 9, (Length of (Entered chat string))))))
          • Set UNI_Temp_Unit_A = (Picked unit)
          • Trigger - Run Set Health System <gen> (ignoring conditions)
  • Set Health System
    • Events
    • Conditions
    • Actions
      • Set INT_Temp_Integer_HP = (INT_Temp_Integer_HP - (Integer((Max life of UNI_Temp_Unit_A))))
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • INT_Temp_Integer_HP Greater than (>) 0
          • Then - Actions
            • Set INT_Loop_Integer = ((INT_Temp_Integer_HP - (INT_Temp_Integer_HP mod 100)) / 100)
              • Do Multiple ActionsFor each (Integer A) from 1 to INT_Loop_Integer, do (Actions)
                • Loop - Actions
                  • Unit - Add Max Life Modifier to UNI_Temp_Unit_A
                  • Unit - Set level of Max Life Modifier for UNI_Temp_Unit_A to 4
                  • Unit - Remove Max Life Modifier from UNI_Temp_Unit_A
            • Set INT_Temp_Integer_HP = (INT_Temp_Integer_HP mod 100)
            • Set INT_Loop_Integer = ((INT_Temp_Integer_HP - (INT_Temp_Integer_HP mod 10)) / 10)
              • Do Multiple ActionsFor each (Integer A) from 1 to INT_Loop_Integer, do (Actions)
                • Loop - Actions
                  • Unit - Add Max Life Modifier to UNI_Temp_Unit_A
                  • Unit - Set level of Max Life Modifier for UNI_Temp_Unit_A to 3
                  • Unit - Remove Max Life Modifier from UNI_Temp_Unit_A
            • Set INT_Temp_Integer_HP = (INT_Temp_Integer_HP mod 10)
              • Do Multiple ActionsFor each (Integer A) from 1 to INT_Temp_Integer_HP, do (Actions)
                • Loop - Actions
                  • Unit - Add Max Life Modifier to UNI_Temp_Unit_A
                  • Unit - Set level of Max Life Modifier for UNI_Temp_Unit_A to 2
                  • Unit - Remove Max Life Modifier from UNI_Temp_Unit_A
          • Else - Actions
            • Set INT_Temp_Integer_HP = (0 - INT_Temp_Integer_HP)
            • Set INT_Loop_Integer = ((INT_Temp_Integer_HP - (INT_Temp_Integer_HP mod 100)) / 100)
              • Do Multiple ActionsFor each (Integer A) from 1 to INT_Loop_Integer, do (Actions)
                • Loop - Actions
                  • Unit - Add Max Life Modifier to UNI_Temp_Unit_A
                  • Unit - Set level of Max Life Modifier for UNI_Temp_Unit_A to 7
                  • Unit - Remove Max Life Modifier from UNI_Temp_Unit_A
            • Set INT_Temp_Integer_HP = (INT_Temp_Integer_HP mod 100)
            • Set INT_Loop_Integer = ((INT_Temp_Integer_HP - (INT_Temp_Integer_HP mod 10)) / 10)
              • Do Multiple ActionsFor each (Integer A) from 1 to INT_Loop_Integer, do (Actions)
                • Loop - Actions
                  • Unit - Add Max Life Modifier to UNI_Temp_Unit_A
                  • Unit - Set level of Max Life Modifier for UNI_Temp_Unit_A to 6
                  • Unit - Remove Max Life Modifier from UNI_Temp_Unit_A
            • Set INT_Temp_Integer_HP = (INT_Temp_Integer_HP mod 10)
              • Do Multiple ActionsFor each (Integer A) from 1 to INT_Temp_Integer_HP, do (Actions)
                • Loop - Actions
                  • Unit - Add Max Life Modifier to UNI_Temp_Unit_A
                  • Unit - Set level of Max Life Modifier for UNI_Temp_Unit_A to 5
                  • Unit - Remove Max Life Modifier from UNI_Temp_Unit_A
Could someone tell me what's causing this?

I'm sorry for this big wall of text, I couldn't figure out how to get the triggers into spoilers, if you know how to do that. Tell me.

Any way you can help me with this would be great! If you help me I will reward you with... whatever I can reward you with. :D
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Only that might not be enough..

My first guess is that there is a problem as the first systems part

  • Unit Group - Pick every unit in UNIG_Group_A and do (Actions)
  • Loop - Actions
  • Set UNI_DamageSys_Unit = (Picked unit)
  • Trigger - Run Set Damage System <gen> (checking conditions)
is called EVERY time a string is entered, so also when the second system is executed..
But this is just a mere guess : )..
 
Level 4
Joined
Nov 22, 2011
Messages
73
They don't interfere anymore, but I still need to know why the setdamage system only mods the damage of a single unit in the unit group?
Thanks for your help!
 
Last edited:
Status
Not open for further replies.
Top