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

trigger help

Status
Not open for further replies.
Level 4
Joined
Dec 4, 2014
Messages
97
Hi iam pretty new in triggering and i need some help pls.

I need a trigger like if Hero .... leaves playable map and move him back to last point of playablemap where he was.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
I think you have problem with Blink ability because it takes out of some region? Do this:
lel
  • Events
    • Unit - Start the effect of an ability
  • Conditions
    • (Ability Being Cast) Equal to 'Your Blink Ability'
  • Actions
    • Set Blinker = (Triggering Unit)
    • Set BlinkerPoint = (Position of Blinker)
    • Set BlinkerTargetPoint = (Target Point of Ability being cast)
    • If / Then / Else Multiple Actions
      • Conditions
        • === HERE WE CHECK IF THE TARGET POINT OF BLINK IS OUT OF OUR REGION ===
        • ( #Your Region# contains 'BlinkerTargetPoint ) is FALSE.
      • Then - Actions
        • Unit - Move Blinker to BlinkerPoint facing...
        • Unit - Order Blinker to Stop
      • Else - Actions
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
At map initialization, set a variable for the playable map area (I call it your_playable_map_area_variable).

Then, make a new trigger like this:
  • Melee Initialization
    • Events
      • Unit - A unit leaves your_playable_map_area_variable
    • Conditions
      • ((Leaving unit) is A Hero) Equal to True
    • Actions
      • Set unitPos = (Position of (Leaving unit))
      • Set tmppoint = (unitPos offset by -100.00 towards (Facing of (Leaving unit)) degrees)
      • Unit - Move (Leaving unit) instantly to tmppoint
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_unitPos)
And don't forget to RemoveRect(udg_your_playable_map_area_variable) at the end of the game.
You can add effects and whatnot if you want to.
It essentially moves the leaving hero 100 units backwards.
Untested trigger so I may stand corrected...
 
Status
Not open for further replies.
Top