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

Teleport Ability Trigger Help?

Status
Not open for further replies.
Level 4
Joined
Jul 14, 2012
Messages
100
Hi, so I'm trying to make an ability that is a line skillshot that teleports the caster to the struck unit after a short delay, based off of the Pandaren Brewmaster's Drunken Haze-Breath Fire combo. Kind of like Leona E-Zenith Blade in League of Legends.

To give context to the trigger, all the heroes start with the drunken haze debuff already, but it applies no debuff and is masked as a status called Hero. The caster's line ability triggers it into Space Ripped debuff. I've done this to keep track of units that get hit by the ability so that the caster can teleport to them.

Is there a better way to get my caster to teleport to heroes(only) struck by a line aoe ability? It seems this one doesn't work. The 1 second delay is intentional as well; I wanted there to be a delay before teleporting to the unit, and I would like for it to teleport to the struck unit at that time, not when it was initially hit a second ago.

Please help and thanks!

  • Crezshibar Phase Shift
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Phase Shift (Crezshibar)
    • Actions
      • Wait 1.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) has buff Space Ripped) Equal to True) and (((Matching unit) is A Hero) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Move (Casting unit) instantly to (Position of (Picked unit))
          • Unit - Create 1 Pandaren Brewmaster for Player 11 (Dark Green) at (Position of (Matching unit)) facing Default building facing degrees
          • Unit - Add Drunken Haze to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Matching unit)
P.S. There is a separate trigger that removes the dummy Pandaren Brewmaster after it casts its ability. I added him here to put the dummy buff that allows the target to receive the Space Ripped buff again.

EDIT: While I'm here I'd also like help with a similar ability, also a teleport, but this one is a target-dependent teleport, and is instant. I can't seem to figure out what's wrong with it; it doesn't work. Help on this too would be greatly appreciated. Can't seem to get any of my teleports to work heh.

  • Vezax Blink
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Blink (Vezax)
    • Actions
      • Set tempunit = (Triggering unit)
      • Set tempunit2 = (Target unit of ability being cast)
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (2.00 x (Real((Agility of (Casting unit) (Include bonuses))))) damage of attack type Spells and damage type Normal
      • Set temploc = (Position of tempunit2)
      • Unit - Move tempunit instantly to temploc
      • Custom script: call RemoveLocation (udg_temploc)
 
Last edited:
Level 6
Joined
Mar 17, 2012
Messages
105
First, you should change "Finishes casting an ability" to "Starts the effect of an ability" in all of your triggers. Finishes casting an ability is unreliable, begins casting an ability is prone to glitches, but "Starts the effect of an ability" is definitely the best of them.

Second, why are you setting "tempunit" to "Triggering unit" in the second trigger rather than the casting unit?

Third, you are calling the position of the Matching unit rather than the picked unit. I think you should change the "matching unit" to the "picked unit" in the first trigger, under the Unit Group loop.

Fourth, your trigger leaks. You should create a temp unit group variable, and in the phase shift trigger, assign that variable to "Units in region matching Condition", where the region is the playable map area and the condition is an "And" function calling "Matching unit has buff Space Ripped" and "Matching unit is A Hero". Then you should do a Unit Group function where it is picking every unit in your new temp unit group variable.

After you have completed the actions within the Unit Group function, do a custom script with the following code:

call DestroyGroup( udg_<VARIABLE_NAME> )

Read more about memory leaks here: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
 
Level 4
Joined
Jul 14, 2012
Messages
100
So I changed the Vezax Blink to this like you said.

  • Vezax Blink
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink (Vezax)
    • Actions
      • Set tempunit = (Casting unit)
      • Set tempunit2 = (Target unit of ability being cast)
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (2.00 x (Real((Agility of (Casting unit) (Include bonuses))))) damage of attack type Spells and damage type Normal
      • Set temploc = (Position of tempunit2)
      • Unit - Move tempunit instantly to temploc
      • Custom script: call RemoveLocation (udg_temploc)
And I changed the Crezshibar Phase Shift to this like you said:

  • Crezshibar Phase Shift
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Phase Shift (Crezshibar)
    • Actions
      • Wait 1.00 seconds
      • Set tempgroup = (Units in (Playable map area) matching ((((Matching unit) has buff Space Ripped) Equal to True) and (((Matching unit) is A Hero) Equal to True)))
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Unit - Move (Casting unit) instantly to (Position of (Picked unit))
          • Unit - Create 1 Pandaren Brewmaster for Player 11 (Dark Green) at (Position of (Picked unit)) facing Default building facing degrees
          • Unit - Add Drunken Haze to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Picked unit)
      • Custom script: call DestroyGroup(udg_tempgroup)
And the Phase Shift works perfectly now, thank you.

But the Vezax Blink doesn't work right. It teleports instantly like it's supposed to, it does damage like it's supposed to, the trigger runs and everything like it's supposed to... but the ability doesn't go on cooldown. It consumes mana like it's supposed to yet somehow the ability doesn't go on cooldown? How do I fix that?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
It consumes mana like it's supposed to yet somehow the ability doesn't go on cooldown? How do I fix that?
Replace...
Unit - Move tempunit instantly to temploc
With these two lines of custom script.
JASS:
call SetUnitX(udg_tempunit, GetLocationX(udg_temploc))
call SetUnitY(udg_tempunit, GetLocationY(udg_temploc))
The problem is that the GUI "Unit - Move" action sends a stop order to the unit. The event is firing after resources have been used but before the ability goes on cooldown. By executing "stop" at that stage, the ability is saved from going on cooldown.

The natives SetUnitX/Y do not send a stop order when moving the unit so the cooldown will be allowed to begin. Do note that they do not check collision so you might be able to become stuck or "bound glitch" depending on the sort of map you are making.

Another solution would be to use a timer with 0 second timeout to allow the ability to enter cooldown and then move the unit. This would allow you to keep the collision checking of the GUI unit move action.
 
Level 6
Joined
Mar 17, 2012
Messages
105
Hmm. I'd like to point out some syntax errors with your custom scripts, you should have a space after the open parentheses and before the closed parentheses "call DestroyGroup( udg_tempgroup )".

Dr. Supergood seems to know what he's talking about
 
Level 4
Joined
Jul 14, 2012
Messages
100
Thanks! I was able to get the teleport to work perfectly using the custom scripts you provided :)
 
Status
Not open for further replies.
Top