[Trigger] units in range matching condition

Status
Not open for further replies.
Level 2
Joined
Jun 20, 2008
Messages
15
I can't get this trigger to pick my enemies, and pause them. I'm hoping someone can point out some small error of mine, thats easy to fix. I'm Quite new to this, so I'm not very good at it yet. Thanks for the help!



Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to time warp
Actions
Unit Group - Pick every unit in (Units within 1000.00 of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to timewarpgroup
Unit - Pause (Picked unit)
Wait 10.00 game-time seconds
Trigger - Turn on turnonpausewarp <gen>
Unit Group - Pick every unit in timewarpgroup and do (Unit - Unpause (Picked unit))
Trigger - Turn off (This trigger)
 
First error is not using trigger tags.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to time warp
  • Actions
    • Unit Group - Pick every unit in (Units within 1000.00 of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
    • Loop - Actions
      • Unit Group - Add (Picked unit) to timewarpgroup
      • Unit - Pause (Picked unit)
      • Wait 10.00 game-time seconds
      • Trigger - Turn on turnonpausewarp <gen>
      • Unit Group - Pick every unit in timewarpgroup and do (Unit - Unpause (Picked unit))
    • Trigger - Turn off (This trigger)
You can't use Waits inside loops like this. In fact, you shouldn't be using waits at all they tend to screw with thread execution.
 
  • Actions
    • Unit Group - Pick every unit in (Units within 1000.00 of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to timewarpgroup
        • Unit - Pause (Picked unit)
    • Wait 10.00 game-time seconds
    • Trigger - Turn on turnonpausewarp <gen>
    • Unit Group - Pick every unit in timewarpgroup and do (Unit - Unpause (Picked unit))
    • Trigger - Turn off (This trigger)
Thanks, didn't know about that wrap button. Anyway, the wait isnt inside the loop. Is there any other way to pause my enemies for 10 seconds, besides the wait?
 
would that fix it? because the units aren't getting paused in the first place, and that's before the wait action.
 
Try putting this before your wait:

  • Actions
    • Custom script: return
That will stop the trigger after the units are paused, which should mean that the units are permanently paused. If the units are still not being paused then there is some other problem. Try printing the location x/y values of (Target point of ability being cast).
 
Status
Not open for further replies.
Back
Top