• 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.

Crash

Status
Not open for further replies.
Level 9
Joined
Apr 7, 2010
Messages
480
i have a trigger that makes a unit move a few steps every sec but when the unit gets too far inside the border of the map the game crashes, so how do i put this on trigger, --> kill the unit once it went inside the border?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Playable map area) contains *UnitLocation* Equal to True
    • Then - Actions
    • Else - Actions
      • Unit - Kill *Unit*
Real Example Trigger
  • Unit Group - Pick every unit in FireballGroup and do (Actions)
    • Loop - Actions
      • Set HandleID = (Key (Picked unit))
      • Set AbilityLevel = (Load (Key AbilityLevel) of HandleID from Hashtable)
      • Set Units[1] = (Picked unit)
      • Set FacingAngle = (Facing of Units[1])
      • Set Points[1] = (Position of Units[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Playable map area) contains Points[1]) Equal to True
        • Then - Actions
          • Set Points[2] = (Points[1] offset by FireballSpeed towards FacingAngle degrees)
          • Custom script: call SetUnitX(udg_Units[1], GetLocationX(udg_Points[2]))
          • Custom script: call SetUnitY(udg_Units[1], GetLocationY(udg_Points[2]))
          • Unit - Create 1 Dummy Fire Trail for (Owner of Units[1]) at Points[2] facing Default building facing degrees
          • Set Units[2] = (Last created unit)
          • Unit - Add a FireTrailLifespan second Generic expiration timer to Units[2]
          • Unit - Set level of Fire Trail for Units[2] to AbilityLevel
          • Custom script: call RemoveLocation(udg_Points[2])
        • Else - Actions
          • Unit - Kill Units[1]
      • Custom script: call RemoveLocation(udg_Points[1])
The condition is "Boolean Comparison -> Region - Region Contains Point"
 
Status
Not open for further replies.
Top