• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Cars and Critters

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • 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,240
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