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

Stopable teleport

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
It happens naturally on Warcraft. Teleport is a channeling spell, and skills that stun or Hex break channeling.

However, if you want any regular hit to stop the channel, use triggers.

1) When the unit starts the teleport, set a Boolean == true
2) Use a Damage detector and check if Boolean == true for the damaged unit. If it's, break the channeling (Setting unit position to the same position it has works, or make a dummy ministun. Care for the leaks.)
3) Set the Boolean == false again.
 
Level 11
Joined
Jun 26, 2014
Messages
497
It happens naturally on Warcraft. Teleport is a channeling spell, and skills that stun or Hex break channeling.

However, if you want any regular hit to stop the channel, use triggers.

1) When the unit starts the teleport, set a Boolean == true
2) Use a Damage detector and check if Boolean == true for the damaged unit. If it's, break the channeling (Setting unit position to the same position it has works, or make a dummy ministun. Care for the leaks.)
3) Set the Boolean == false again.

Can you show how the triggers look?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I don't have the editor atm and i've ben away from it for years now. It should look similar to this

YOU WILL NEED A Damage Detection Sysem (I used Weep's GDD here) (Thanks to Alright for pointing it out)
Create an Integer variable called ID
Create a Hashtable variable (I will call ti "Hash" here, you can name it whatever you want)
On Map Init trigger set "Hash" = "Last created Hashtable"

Event
A unit begins casting an ability
Conditions
Ability being cast is equal to Teleport
Actions
Custom Script: set udg_ID = GetHandleId(GetTriggerUnit())
Hashtable (Boolean) - Save true as 0 of ID on Hash

Event
GDD_Damage_Event is equal to 0
Conditions
Actions
set udg_ID = GetHandleId(udg_Damaged_Unit)
If/Then/Else
If 0 of ID in Hash is equal to True
Then Stop the unit (however you want)
Else (leave this blank)

Event
A unit starts the effect of an ability
Conditions
Ability being cast is equal to Teleport
Actions
Custom Script: set udg_ID = GetHandleId(GetTriggerUnit())
Hashtable (Boolean) - Save false as 0 of ID on Hash
 
Last edited:
Level 6
Joined
May 20, 2014
Messages
228
Keep this in mind that you'd need a DDS for this event
  • GDD_Damage_Event is equal to 0
to actually run.
 
Status
Not open for further replies.
Top