I don't know why this Trigger won't work.

Battle[StFh]

New Member
Reaction score
6
Hey Guys,

I've just made up a Trigger for a Duel System, but it won't work, and I don't know why, here's the Trigger:
Code:
Duel Over
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
        ((Dying unit) is in Team1) Equal to True
    Actions
        Set UnitsInTeam1 = (UnitsInTeam1 - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                UnitsInTeam1 Equal to 0
            Then - Actions
                Trigger - Turn on Help Trigger <gen>
                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
                                (Hero[(Integer A)] is alive) Equal to True
                            Then - Actions
                                Unit - Set life of Hero[(Integer A)] to 100.00%
                                Unit - Set mana of Hero[(Integer A)] to 100.00%
                                Unit - Move Hero[(Integer A)] instantly to PositionOfTheHeroes[(Integer A)]
                                Custom script:   call RemoveLocation (udg_PositionOfTheHeroes[GetForLoopIndexA()])
                            Else - Actions
                                Hero - Instantly revive Hero[(Integer A)] at PositionOfTheHeroes[(Integer A)], Hide revival graphics
                                Custom script:   call RemoveLocation (udg_PositionOfTheHeroes[GetForLoopIndexA()])
            Else - Actions
                Do nothing
        Unit - Unpause all units
        Trigger - Turn off (This trigger)
        Trigger - Turn on Help Trigger <gen>
Note:
  • I've got another trigger like this for the units in team 2, but it won't work either
  • Team1 is a unit group containing all the heroes of team 1
  • UnitsInTeam1 is an integer which has been set by the Count Units in Unit Group action in a nother trigger
  • Hero is an array Integer, Hero[1] is the hero of Red, Hero[2] is the hero of Blue and so on

I hope anyone sees what I'm doing wrong here :confused: .

Thanks in Advance,

Battle[StFh]
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
Code:
Duel Over
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
        ((Dying unit) is in Team1) Equal to True
    Actions
        Set UnitsInTeam1 = (UnitsInTeam1 - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                UnitsInTeam1 Equal to 0
            Then - Actions
                Trigger - Turn on Help Trigger <gen>
                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
                                (Hero[(Integer A)] is alive) Equal to True
                            Then - Actions
                                Unit - Set life of Hero[(Integer A)] to 100.00%
                                Unit - Set mana of Hero[(Integer A)] to 100.00%
                                Unit - Move Hero[(Integer A)] instantly to PositionOfTheHeroes[(Integer A)]
                                Custom script:   call RemoveLocation (udg_PositionOfTheHeroes[GetForLoopIndexA()])
                            Else - Actions
                                Hero - Instantly revive Hero[(Integer A)] at PositionOfTheHeroes[(Integer A)], Hide revival graphics
                                Custom script:   call RemoveLocation (udg_PositionOfTheHeroes[GetForLoopIndexA()])
            Else - Actions
                Do nothing
        Unit - Unpause all units
        [B]Trigger - Turn off (This trigger)[/B]
        Trigger - Turn on Help Trigger <gen>

It will never reach zero becuase you disable it the first time someone dies. Try place it inside the if...

Unless you only have one unit?
 
S

Sunny_D

Guest
can you further specify what exactly doesnt work? and what doest this helptrigger do?

as mr zero said, it would run only one time. also, where have you created those locations "PositionOfTheHeroes[]". you remove those locations, they wont be there for the next time the trigger possibly runs again until you set them again.
 
M

M3rcury

Guest
This trigger is not for hero arena this trigger is for normal any game where you want to put a duel arena...

Triggers does this:
1) Time Expires
2) All heroes will be saved to where they were standing
3) All heroes will be transported to the arena
4) They fight to the death
After nr.4 The trigger doesen't work anymore
5) If one team loses then the duel is over
6) All heroes will be revived and fully healed and given full mana
7) All heroes will be teleported back to the place where they were standing
 

Battle[StFh]

New Member
Reaction score
6
I think MrZero was right :)

THanks, I can fix it now, well in fact not now, as I have to go off of my computer, but I can fix it tonight!

Thanks MrZero and +rep :p
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top