• 🏆 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!

Prevent unit from walking over region

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