Trigger loop help

NovaKing

New Member
Reaction score
0
A trigger runs this one, can someone help me figure out why this won't work.

Code:
Player 0 Burn
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Remaining time for FlameOn1) Greater than 0.00
            Then - Actions
                Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units within 500.00 of (Position of (Picked unit))) and do (Actions)
                            Loop - Actions
                                Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Flame1 x (Remaining time for FlameOn1)))
                                Floating Text - Create floating text that reads (String((Flame1 x (Remaining time for FlameOn1)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
                                Floating Text - Change (Last created floating text): Disable permanence
                                Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
                                Wait 1.00 seconds
                                Trigger - Run Player 0 Burn <gen> (ignoring conditions)
            Else - Actions
                Set Flame1 = 0.00
                Countdown Timer - Destroy FlameOn1_time
 

garion992

TH.net Regular
Reaction score
17
Then - Actions
Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units within 500.00 of (Position of (Picked unit)))

I think you mean that the red picked units belong to each other, but the blue pick every unit overwrites your first pick every unit. So, in fact, you pick no unit. but i'm not sure.
 

NovaKing

New Member
Reaction score
0
yeah I thought of that, and changed it by doing this:

Code:
Player 0 Burn
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Remaining time for FlameOn1) Greater than 0.00
            Then - Actions
                Unit Group - Pick every unit in (Units within 500.00 of (Position of BurningUnit_0)) and do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Flame1 x (Remaining time for FlameOn1)))
                        Floating Text - Create floating text that reads (String((Flame1 x (Remaining time for FlameOn1)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
                        Wait 1.00 seconds
                        Trigger - Run Player 0 Burn <gen> (ignoring conditions)
            Else - Actions
                Set Flame1 = 0.00
                Countdown Timer - Destroy FlameOn1_time
 

garion992

TH.net Regular
Reaction score
17
you should check first if it really runs, with a text message. it could be that the trigger that runs this one is wrong
 

NovaKing

New Member
Reaction score
0
lolwut? heh I suppose I'll wait till you come up with an answer. The variable flame1 is adjusted whenever you cast another fire spell, but if you do this trigger is cleared from the cue anyway, and even with that problem out of the way it still won't work.
 

NovaKing

New Member
Reaction score
0
when I readjust the trigger to this:
Code:
Player 0 Burn
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Remaining time for FlameOn1) Greater than 0.00
            Then - Actions
                Unit Group - Pick every unit in (Units within 500.00 of (Position of BurningUnit_0)) and do (Actions)
                    Loop - Actions
                        Wait 0.75 seconds
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Flame1 x (Remaining time for FlameOn1)))
                        Floating Text - Create floating text that reads (String((Flame1 x (Remaining time for FlameOn1)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
                        Trigger - Run (This trigger) (checking conditions)
            Else - Actions
                Set Flame1 = 0.00
                Countdown Timer - Destroy FlameOn1_time

far from not looping, it won't evaluate the damage in the first place, and WC3 crashes if the wait is taken out (as would be expected.)
 

garion992

TH.net Regular
Reaction score
17
you run this trigger with another trigger right? so i suggest to check if it really runs.
so under Loop - Actions make a new trigger something like this: Game - Display text to all ( "it works!" ). this is not the solution, but just a check.

add this to trigger:
- Game - Display text to all : ( "it works!" )

Loop - Actions
Wait 0.75 seconds
Game - Display text to all : ( "it works!" ) Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Flame1 x (Remaining time for FlameOn1)))
Floating Text - Create floating text that reads (String((Flame1 x (Remaining time for FlameOn1)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
Trigger - Run (This trigger) (checking conditions)

then you start your map and if it works a text message will be displayed, so you are really shure if it works
else send map to me :p
 

NovaKing

New Member
Reaction score
0
I already knew that it was working because it was evaluating damage once, but not looping after that.
 

NovaKing

New Member
Reaction score
0
Code:
This fire is out of control
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to Fire shock (Neutral Hostile)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Triggering unit)) Equal to Player 1 (Red)
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Remaining time for FlameOn1) Greater than 0.00
                    Then - Actions
                        Trigger - Remove Player 0 Burn <gen> from the trigger queue
                       [COLOR="red"] Game - Display to (All players) the text: IT WORKS!! (3)[/COLOR]
                        Set Flame1 = (1.00 + (2.00 x Flame1))
                        Trigger - Run Player 0 Burn <gen> (ignoring conditions)
                    Else - Actions
                        Set BurningUnit_0 = (Triggering unit)
                        Countdown Timer - Start FlameOn1 as a One-shot timer that will expire in (8.00 + Flame1) seconds
                        Countdown Timer - Create a timer window for FlameOn1 with title Flame On (1)
                        Set FlameOn1_time = (Last created timer window)
                        Countdown Timer - Show FlameOn1_time for (Owner of (Triggering unit))
                        Set Flame1 = 1.00
                        [COLOR="Red"]Game - Display to (All players) the text: IT WORKS!! (1)[/COLOR]
                        Trigger - Run Player 0 Burn <gen> (ignoring conditions)
            Else - Actions


+*+*+*+*

Code:
Player 0 Burn
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Remaining time for FlameOn1) Greater than 0.00
            Then - Actions
                Unit Group - Pick every unit in (Units within 500.00 of (Position of BurningUnit_0)) and do (Actions)
                    Loop - Actions
                        Wait 0.75 seconds
                        [COLOR="red"]Game - Display to (All players) the text: IT WORKS!! (2)[/COLOR]
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Flame1 x (Remaining time for FlameOn1)))
                        Floating Text - Create floating text that reads (String((Flame1 x (Remaining time for FlameOn1)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
                        Trigger - Run (This trigger) (checking conditions)
            Else - Actions
                Set Flame1 = 0.00
                Countdown Timer - Destroy FlameOn1_time

IT WORKS (1) is the only one that would show up when the trigger was arranged as such
 

garion992

TH.net Regular
Reaction score
17
that means that for trigger one (and also for 2)

If - Conditions
(Remaining time for FlameOn1) Greater than 0.00

is not true. you could check if the remaining time really exists or something. the problem should be there.
 

NovaKing

New Member
Reaction score
0
Code:
Player 0 Burn
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Remaining time for FlameOn1) Greater than 0.00
            Then - Actions
                Unit Group - Pick every unit in (Units within 500.00 of (Position of BurningUnit_0)) and do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Flame1 x (Remaining time for FlameOn1)))
                        Floating Text - Create floating text that reads (String((Flame1 x (Remaining time for FlameOn1)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
                        [COLOR="Red"]Game - Display to (All players) the text: IT WORKS!! (2)[/COLOR]
                        Wait 0.75 seconds
                        Trigger - Run (This trigger) (checking conditions)
            Else - Actions
                Set Flame1 = 0.00
                Countdown Timer - Destroy FlameOn1_time

This time it did loop, but it looped too quickly and the game didn't display the floating text and the game message until the damage had been evaluated.

the message I got looked something like this:

IT WORKED (1)
IT WORKED (2)
IT WORKED (2)
IT WORKED (2)
IT WORKED (2)
IT WORKED (2)

I did this a few more times and saw that the number of "IT WORKED"s was based on the number of units I hit
 

NovaKing

New Member
Reaction score
0
Code:
Player 0 Burn
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Remaining time for FlameOn1) Greater than 0.00
            Then - Actions
                Unit Group - Pick every unit in (Units within 500.00 of (Position of BurningUnit_0)) and do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Flame1 x (Remaining time for FlameOn1)))
                        Floating Text - Create floating text that reads (String((Flame1 x (Remaining time for FlameOn1)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
                        Game - Display to (All players) the text: IT WORKS!! (2)
                        Wait 0.75 seconds
            Else - Actions
                Set Flame1 = 0.00
                Countdown Timer - Destroy FlameOn1_time
        Trigger - Run (This trigger) (checking conditions)

This variation made WC3 crash for some reason.
 

garion992

TH.net Regular
Reaction score
17
the first last trigger (post #13) contains this (String((Flame1 x (Remaining time for FlameOn1))))

you see x? thats the problem i think, set it to + :p
 

garion992

TH.net Regular
Reaction score
17
soory my fault, i started to do some things with the editor this half hours since a long time, so i oversee some things..

"I did this a few more times and saw that the number of "IT WORKED"s was based on the number of units I hit, meaning it may not have actually looped."

i think it did, because it had handled all units and couldn't find any more.so that won't be the prob.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top