• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Staff of Teleportation without interupting targets movement

Status
Not open for further replies.
Level 24
Joined
Feb 27, 2019
Messages
833
Hello!

I am trying to make a spell that acts as Staff of Teleportation without interupting the target unit. It will have to work while clicking the minimap aswell, just as Staff of Teleportation.

My goal is that you use the staff, select desired unit the same way as one would with staff(even through pressing on the minimap) and the unit is telported to the target immediatly.

Do you think this is possible? How would one make that happen?

EDIT: I can set a variable to an order but I cant use the order. How can I use the order in the variable?
My friend also pointed out that I could use a dummy unit that always is in the position of the unit that I wish to teleport to and on my map this would work since there are a max of 6 units to teleport to.
 
Last edited:
If one gives an order using the minimap it becomes a point order onto the ground.

Stopping the cast during casting would prevent mana costs and cooldown.

My friend also pointed out that I could use a dummy unit that always is in the position of the unit that I wish to teleport to and on my map this would work since there are a max of 6 units to teleport to.
Sounds like the way DotA managed teleports.

I can set a variable to an order but I cant use the order. How can I use the order in the variable?
The order options inside the order actions are an type, that can not be a global (on default), Hence you can not use the GUI action. You need to write a custom script.
 
Last edited:
Level 24
Joined
Feb 27, 2019
Messages
833
Catch when a unit begins casting teleport ability. (Begins starts when channeling starts.) Then immediately move the caster to Target Point of Ability Being Cast and order the unit to stop.
I tried something like that. Perheaps I made some mistake however it seems that at least while using the teleport ability it would "stun" the target unit even with a casting time.
If one gives an order using the minimap it becomes a point order onto the ground.

Stopping the cast during casting would prevent mana costs and cooldown.


Sounds like the way DotA managed teleports.

The order options inside the order actions are an type, that can not be a global (on default), Hence you can not use the GUI action. You need to write a custom script.
Thanks for the info. I ended up using the method proposed to me by my friend.
you can just use a dummy ability and check if target unit = none, if yes then pick the closest out of valid units.
Hmm, I can see that work with a dummy ability like far sight. It would not target the unit but it probably doesnt matter.
 
Level 24
Joined
Feb 27, 2019
Messages
833
A duration/cast time of 0 is infinite. The lowest you can go is 0.01.
I accidentelly put 0.1 on casting delay instead of casting time. When I put a value on casting time it works. If I put 0 on casting time its instant. Now I need to trigger the cooldown somehow.
the ability 'channel' lets you customize things like this and also has no effects of its own. it's what people usually use for dummy abilities.
So Ive heard but Ive never had much success with channel. Ive tried to use it at least a few times. Perheaps I can find a guide that helps me. I will attempt to use channel again if I cant trigger the cooldown.
Stopping the cast during casting would prevent mana costs and cooldown.
Yes. I cant seem to find any action in the gui that allows me to easily trigger a cooldown so I guess it doesnt exist?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Here's a map with the Staff working the way you wanted. It became slightly more complex than I had originally planned for but it works great!

The problem:
If you use Move Instantly in response to "A unit starts the effect of an ability" you will interrupt and skip the mana cost/cooldown of the ability.

However, if you do this using the "A unit uses an Item" Event the mana/cooldown will work as normal.

The issue with "Uses an Item" is that it doesn't provide us with any information like Target unit of ability being cast or Target point of ability being cast.

The solution:
Use these two Events together. So when a unit starts the effect of our Item ability store the "Target" of the ability as a Unit variable. This is done using a Unit Indexer so each caster has it's own unique "Target". Then when that same casting unit Uses the Item (this happens immediately after the cast event) reference it's previously set Target and move the caster to the Target's position.

Note: You can target ANY unit with the Staff in my map. Change the "Targets Allowed" on the Staff Ability to filter which units can be targeted.

@Pyrogasm
The only issue with your method is that it will put the unit inside of the target since "SetUnitX/Y" ignores collision. Sure, the collision fixes itself if you issue any order but it's still sort of undesirable.
 

Attachments

  • Staff Instant v.1.w3x
    24.2 KB · Views: 35
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
You can use the normal GUI move instantly instead of SetUnitX/Y. In that case I was considering it to be fine to actually interrupt the item cast.

There’s no way to manually trigger a cooldown, but you can do this: Passive ability with cooldown - Best method!

A cast time of 0 on the spell should work entirely as you want it to without the need for a trigger. I thought for some reason this wasn’t working.
 
Level 8
Joined
May 21, 2019
Messages
435
Hello!
I am trying to make a spell that acts as Staff of Teleportation without interupting the target unit. It will have to work while clicking the minimap aswell, just as Staff of Teleportation.

  1. Make a spell based on Channel and shove it into whatever context you wanna use this teleport.
  2. Make channel target "Ground".
  3. Run a distance check from the point channel was cast, to your 6 possible teleport units.
  4. Instantly move the caster to the closest of the 6.
There. Done. :)

If you want the teleport to have a cast time, Channel naturally supports this as well. This also works with the minimap as requested. In fact, it has the added bonus of not even needing you to be all that accurate with the minimap click.
 
Last edited:
Status
Not open for further replies.
Top