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

Prevent unit from walking over region

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
Unit enters region

set point1 = position of unit
set point2 = point1 offset by x towards (facing of triggering unit - 180)
Custom script : call SetUnitX(GetTriggerUnit(), GetLocationX(udg_point2))
Custom script : call SetUnitY(GetTriggerUnit(), GetLocationY(udg_point2))
remove point1
remove point2

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

You can turn the trigger off.
 
Level 10
Joined
Dec 15, 2012
Messages
650
  • Environment - Set terrain pathing at (Center of (Playable map area)) of type Walkability to Off
  • Environment - Set terrain pathing at (Center of (Playable map area)) of type Walkability to On
cuz Blizzard Entertainment doesn't create a "Pick point in Region" function for World Editor so I think you need to do them 1 by 1 . . .
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
What do you meant by "prevent" ?
Unit gets pushed when nearing the region ?
Unit dies when enters the region ?

If you follow Maker's trigger, the unit will be moved instantly to the direction behind the unit by X offset.

But if you use this trigger, it's dangerous because if your unit is knockbacked by another trigger, entering the region with the angle of the unit facing behind, the trigger will move the unit closer to the "forbidden area".

But this will unlikely to happen.
 
Level 14
Joined
Dec 28, 2012
Messages
379
What do you meant by "prevent" ?
Unit gets pushed when nearing the region ?
Unit dies when enters the region ?

If you follow Maker's trigger, the unit will be moved instantly to the direction behind the unit by X offset.

But if you use this trigger, it's dangerous because if your unit is knockbacked by another trigger, entering the region with the angle of the unit facing behind, the trigger will move the unit closer to the "forbidden area".

But this will unlikely to happen.

i dont want unit to be teleported out of region
i want to make him not crossable
so unit wont walk over it
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 102 <gen>
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to ((Center of Region 102 <gen>) offset by (0.00, 0.00))
When a unit enters your region, try moving it an offset. Its up to you on what numbers you like at the offset. Also try setting in a variable Entering Unit or Triggering unit (whatever you used).
 
Status
Not open for further replies.
Top