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

Zone Enter Trigger

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,384
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Hero level of (Triggering unit)) Less than 15
    • Actions
      • Set loc1 = (Position of (Triggering unit))
      • Set loc2 = (loc1 offset by 150.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)
      • Unit - Move (Triggering unit) instantly to loc2
      • Custom script: call RemoveLocation(udg_loc1)
      • Custom script: call RemoveLocation(udg_loc2)
      • Custom script: set udg_loc1 = null
      • Custom script: set udg_loc2 = null
loc1 and loc2 are mandatory variables (they're variables of type "point") to prevent memory leaks.
The trigger could be further improvized by using unit variable, saving the triggering unit into the variable and then referencing the variable instead of using "triggering unit" all the time.

What the trigger does is if unit enters region000 and its level is less than 15, then the unit is moved back by 150 units.
 
Level 5
Joined
Jun 17, 2014
Messages
103
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Hero level of (Triggering unit)) Less than 15
    • Actions
      • Set loc1 = (Position of (Triggering unit))
      • Set loc2 = (loc1 offset by 150.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)
      • Unit - Move (Triggering unit) instantly to loc2
      • Custom script: call RemoveLocation(udg_loc1)
      • Custom script: call RemoveLocation(udg_loc2)
      • Custom script: set udg_loc1 = null
      • Custom script: set udg_loc2 = null
loc1 and loc2 are mandatory variables (they're variables of type "point") to prevent memory leaks.
The trigger could be further improvized by using unit variable, saving the triggering unit into the variable and then referencing the variable instead of using "triggering unit" all the time.

What the trigger does is if unit enters region000 and its level is less than 15, then the unit is moved back by 150 units.

Ty REP
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Hero level of (Triggering unit)) Less than 15
    • Actions
      • Set loc1 = (Position of (Triggering unit))
      • Set loc2 = (loc1 offset by 150.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)
      • Unit - Move (Triggering unit) instantly to loc2
      • Custom script: call RemoveLocation(udg_loc1)
      • Custom script: call RemoveLocation(udg_loc2)
      • Custom script: set udg_loc1 = null
      • Custom script: set udg_loc2 = null
loc1 and loc2 are mandatory variables (they're variables of type "point") to prevent memory leaks.
The trigger could be further improvized by using unit variable, saving the triggering unit into the variable and then referencing the variable instead of using "triggering unit" all the time.

What the trigger does is if unit enters region000 and its level is less than 15, then the unit is moved back by 150 units.

Haha I once abused this trigger in one of War3 RPG, it's called The Black Road, it uses the same trigger to prevent unit from entering that zone.

How did I abuse it ?
Simple, by using knockback spell that causes my unit to be thrown backwards while I was facing the other way around.

So when the system triggers, my direction + 180 = Entering the zone, very fun indeed :)

Luckily TBR creator only cover some small portion of the map with the region (only the entrance).
If they covered whole region with that system, my unit won't be able to move at all, constantly being pushed by the trigger :)
 
Level 5
Joined
Jun 17, 2014
Messages
103
Haha I once abused this trigger in one of War3 RPG, it's called The Black Road, it uses the same trigger to prevent unit from entering that zone.

How did I abuse it ?
Simple, by using knockback spell that causes my unit to be thrown backwards while I was facing the other way around.

So when the system triggers, my direction + 180 = Entering the zone, very fun indeed :)

Luckily TBR creator only cover some small portion of the map with the region (only the entrance).
If they covered whole region with that system, my unit won't be able to move at all, constantly being pushed by the trigger :)

i changed it a bit and when ur lvl is too low u teleport instant to middle of region
 
Status
Not open for further replies.
Top