• 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] Need help wit timed life triggers

Status
Not open for further replies.
Level 9
Joined
Oct 17, 2007
Messages
547
What im trying to do is trigger the map so that if a player's unit dont come within 900 range of any of the computer control units, then give that comp unit a timed life of 30 sec. Can any1 help?
 
Level 6
Joined
Nov 28, 2007
Messages
203
nah, i think he means u have to stay close a computer's units (The trigger function is "Controller" and he says "computer control")
 
Level 9
Joined
Oct 17, 2007
Messages
547
well basically i dont want the map to be crawling wit computer controlled units, hostile creeps basically, so if a human controlled unit don't come within a certain range of them they get a timed life. So there should only be creeps where the human controlled units are at.
 
Level 6
Joined
Nov 28, 2007
Messages
203
anyway.. here they are:
  • Add to Group Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Matching unit)) Not equal to Neutral Hostile)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to OutOfRange
  • Add to Group
    • Events
    • Conditions
    • Actions
      • Unit Group - Add (Triggering unit) to OutOfRange
  • Remove From Group
    • Events
    • Conditions
    • Actions
      • Unit Group - Remove (Triggering unit) from OutOfRange
  • Add Units Init
    • Events
      • Time - Elapsed game time is 0.15 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Add to Group <gen> the event (Unit - A unit leaves (Region centered at (Position of (Picked unit)) with size (900.00, 900.00)))
          • Trigger - Add to Remove From Group <gen> the event (Unit - A unit enters (Region centered at (Position of (Picked unit)) with size (900.00, 900.00)))
  • Add Units Entering Map
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Trigger - Add to Add to Group <gen> the event (Unit - A unit leaves (Region centered at (Position of (Triggering unit)) with size (900.00, 900.00)))
      • Trigger - Add to Remove From Group <gen> the event (Unit - A unit enters (Region centered at (Position of (Triggering unit)) with size (900.00, 900.00)))
This one is for instant kill after 30 sec:
  • Kill
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Wait 30.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is in OutOfRange) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 100.00)%
And this one's for slow kill. the unit dies in 30 sec (choose one of them >.<):
  • Kill Copy
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is in OutOfRange) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 3.34)%
Variables used: Unit Group (OutOfRange)

Hope u don't mind the number of triggers :wgrin:

[EDIT]: And.. btw, i haven't tested them, so there might be something wrong.
[EDIT2]: i changed some wrong things
 
Last edited:
Level 6
Joined
Nov 28, 2007
Messages
203
w8.. it didn't work. i'll edit this post and change the failing trigger :)
[EDIT]: Replace the Kill triggers with these:
  • Kill
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Wait 30.00 seconds
      • Unit Group - Pick every unit in OutOfRange and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 100.00)%
  • Kill Copy
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in OutOfRange and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 3.34)%
And, the add to trigger action.. you find it in Action\Trigger\Add New Event
Or did u find it? whatever.. :p
 
Status
Not open for further replies.
Top