• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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)
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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.
 
Level 2
Joined
Jun 20, 2008
Messages
15
  • 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?
 
Level 2
Joined
Jun 20, 2008
Messages
15
would that fix it? because the units aren't getting paused in the first place, and that's before the wait action.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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).
 
Level 2
Joined
Jun 20, 2008
Messages
15
i dont know that much about world editor yet. i don't know how to do that yet. Thanks anyways.
 
Status
Not open for further replies.
Top