Trigger Not Working After a Certain Action

zaqer50

TH.net Regular
Reaction score
3
Im creating a frost nova like ability.

Code:
Frost Nova
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Frost Nova 
    Actions
        Unit Group - Pick every unit in (Units within 500.00 of (Position of (Casting unit))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Picked unit) Not equal to (Casting unit)
                        ((Picked unit) is alive) Equal to True
                    Then - Actions
                        Unit - Pause (Picked unit)
                        Unit - Create 1 Ice for (Owner of (Casting unit)) at (Position of (Picked unit)) facing Default building facing degrees
                        Wait 2.00 seconds
                        Unit - Remove (Last created unit) from the game
                        Unit - Unpause (Picked unit)
                    Else - Actions
                        Do nothing

Everything works fine until it gets to the "wait 2.00 seconds", After that, nothing seems to work, the units dont unpause and the Units arent removed. Any suggestions? :confused:

Thanks in advance
 

Battlemapsta

I am the Conduit of Change
Reaction score
101
Try setting the dummy to a unit variable and the picked unit I think should be targeted unit.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Never insert waits in ''Pick every units and...'' actions.

It won't work.
 

SFilip

Gone but not forgotten
Reaction score
633
1. never use Unit - A unit Begins casting an ability for triggered spells like this. use Unit - A unit Starts the effect of an ability instead.
2.
Code:
Unit Group - Pick every unit in (Units within 500.00 of (Position of (Casting unit))) and do (Actions)
      Loop - Actions
          If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  (Picked unit) Not equal to (Casting unit)
                  ((Picked unit) is alive) Equal to True
use units within range matching condition. then put the condition "and" and the two conditions you already used within it. just make sure you replace picked unit with matching unit here.
3. this trigger leaks memory
4. are you aware that this will also effect allies?
5. listen to daxtreme ^^
 

zaqer50

TH.net Regular
Reaction score
3
First of all, thanks for the help :D

I had a feeling it would cause leaks but I wasnt sure how to change it.
If wait commands dont work with the "pick every unit and..." commands, how would you recommend I do it?

Here's the new code:

Code:
Frost Nova
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Frost Nova 
    Actions
        FN_TARGET = (Picked Unit)
        Caster = (Casting Unit)
        Unit Group - Pick every unit in (Units within 500.00 of (Caster) matching (((FN_TARGET) is alive) Equal to True) and ((FN_TARGET) Not equal to (Caster))
            Loop - Actions


(And yes, I was aware it targeted allies also, its suppose to work that way :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