• 🏆 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] array trigger that wont work

Status
Not open for further replies.
Level 2
Joined
May 20, 2008
Messages
14
im making this trigger to give experience as a player enters this region once every round round one and two work but round 3 doesent

  • player 1 exprerience
    • Events
      • Unit - A unit enters safe zone one <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Triggercount[1] Equal to 0
        • Then - Actions
          • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
          • Set Triggercount[1] = (Triggercount[1] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Triggercount[1] Equal to 1
              • Round Equal to 2
            • Then - Actions
              • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Triggercount[1] Equal to 2
                  • Round Equal to 3
                • Then - Actions
                  • Set Triggercount[1] = (Triggercount[1] + 1)
                  • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Triggercount[1] Equal to 3
                      • Round Equal to 4
                    • Then - Actions
                      • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
                      • Set Triggercount[1] = (Triggercount[1] + 1)
                    • Else - Actions
 
Level 3
Joined
Jun 16, 2008
Messages
28
Why not just us, when unit enters region (with what ever conditions you want) add 100 xp and then turn the trigger off. then use a second trigger to turn this one back on at the end of the next round?
 
Level 2
Joined
May 20, 2008
Messages
14
well im making the trigger for 11 players and 12 regions it would be alot easyer this way

i tryed turning the round into an array

final code looked like this

  • player 1 exprerience Copy
    • Events
      • Unit - A unit enters safe zone two <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Round[1] Equal to 0
          • Triggercount[2] Equal to 0
        • Then - Actions
          • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
          • Set Triggercount[2] = (Triggercount[2] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Triggercount[2] Equal to 1
              • Round[1] Equal to 1
            • Then - Actions
              • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
              • Set Triggercount[2] = (Triggercount[2] + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Triggercount[2] Equal to 2
                  • Round[1] Equal to 2
                • Then - Actions
                  • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
                  • Set Triggercount[2] = (Triggercount[2] + 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Triggercount[2] Equal to 3
                      • Round[1] Equal to 3
                    • Then - Actions
                      • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
                      • Set Triggercount[2] = (Triggercount[2] + 1)
                    • Else - Actions
 
Last edited by a moderator:
Level 23
Joined
Nov 29, 2006
Messages
2,482
Please do not tripple post. There is an edit button to avoid this in the right corner of every post to avoid doing so.

Weird, the code looks like it should work when looking at the trigger.
You said that the last if-part is the one which is failing hm?
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
All those line are stupid(I will admit copy/pasteble):
Set Triggercount[2] = (Triggercount[2] + 1)
You know the actual value of Triggercount[2] every time you use that line so it useless to check it.
Just set it to 1,2,3,4.
Are you sure of the rounds?
They were 1,2,3,4.
Now they are 0,1,2,3.
 
Level 2
Joined
May 20, 2008
Messages
14
once the rounds was set into an array the triggr worked fine every round.
this system would have made a total of 132 triggers though and a friend of mine showed me a easyer way to acheave the basic effect but i have found a bug in that system so im probly going to have to remake this one any ways
i am very sure of the final code it works like i want it to. and the reson the rounds changed is because i changed it to an array and set the array's start by default as 0 the system that was in place for the rounds started at 1


Please note that the code above is the final code it works fine might be able to shortin it to get what u want out of it.
 
Level 9
Joined
May 27, 2006
Messages
498
  • player 1 exprerience
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Triggercount[1] Equal to 1
          • Round Equal to 2
        • Then - Actions
          • Hero - Add 100 experience to (Triggering unit), Show level-up graphics
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)

You didnt increase triggercount at the end of second round, thats why the third one wasnt working... You dont have to change round/anything else, just add Set Triggercount[1] = ( Triggercount[1] + 1 ) action.
 
Status
Not open for further replies.
Top