• 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] Cars and Critters

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Kill Unit
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 128.00 of (Position of MyHero) matching ((Matching unit) Not equal to MyHero)) and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • Unit - Kill (Picked unit)
It leaks and you may want to set other restrictions for units to be killed. Set the range to something reasonable. You may want to turn collision off for all critters by default, since your unit will try to automatically navigate past them if they have collision on.


Or this maybe better:

  • Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Trigger - Add to Kill Unit 2 <gen> the event (Unit - A unit comes within 256.00 of MyHero)
  • Kill Unit 2
    • Events
    • Conditions
    • Actions
      • Unit - Turn collision for (Triggering unit) Off
      • Unit - Kill (Triggering unit)
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
If you find one, please let me know...

Meanwhile, use these:

  • Pick
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Car))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Trigger - Add to (Detection trigger) the event (Unit - A unit comes within 128.00 of (Picked unit))
      • Custom script: call DestroyGroup(udg_TempGroup)
  • Add new
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to (Detection trigger) the event (Unit - A unit comes within 256.00 of (Triggering unit))
 
Status
Not open for further replies.
Top