• 🏆 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] Making a unit turn (nearly) instantly?

Status
Not open for further replies.
Level 4
Joined
Jun 10, 2019
Messages
69
Hello again everyone,

Today I'm working on making what I thought would be a fairly simple spell. Here's what I was hoping for it:

The assassin casts the spell on a target enemy unit, instantly teleporting 100 units behind them, facing the target. This requires the unit to turn 180 degrees (facing the target from the north vs facing the target from the south), and I would like this to happen as quickly as reasonably possible.

I did some googling on this but haven't found out much other than that turn rate has a set maximum, but I figure, movement speed also has a set maximum and there are ways around that; surely there are ways to speed up turn rate?

Any help would be appreciated!

Thanks!
 
This should work for all intended purposes;

  • Teleport Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your Ability
    • Actions
      • Set TempLocation[1] = (Position of (Target unit of ability being cast))
      • Set TempLocation[2] = (TempLocation[1] offset by -100.00 towards (Facing of (Target unit of ability being cast)) degrees)
      • Set Angle = (Angle from TempLocation[2] to TempLocation[1])
      • Unit - Move (Triggering unit) instantly to TempLocation[2], facing Angle degrees
      • Custom script: call RemoveLocation (udg_TempLocation[1])
      • Custom script: call RemoveLocation (udg_TempLocation[2])
 
Level 4
Joined
Jun 10, 2019
Messages
69
Chaosy, thank you for the suggestion! I'll definitely keep it in mind, and I'm guessing that that's pretty much guaranteed to work, but I'm going to keep on looking for other solutions for a tad bit longer in case something else turns up. Because the assassin is a Hero (I apologize - I should've mentioned that in the original post), I'd have to transfer her current life, experience, mana, items, ability levels, and ability cooldowns to the new unit. I know how to do most of those already, but I'm unsure about cooldowns, and that's something I probably can't ignore (an ability based assassin who can reset their own cooldowns? #op).

FeelsGoodMan, I also appreciate your suggestion. I tried it out, and it works well, but it's unfortunately not instant for some reason/I'm running into the same problem I had when I attempted to trigger this myself. It issues an order for her to turn towards the target unit, but it doesn't move and angle her instantly, which is what I'm hoping for. With that said, I'm realizing that the turn speed not being instantaneous really isn't that big a deal, so I may end up using this if I can't figure out an alternative method/if I can't figure out how to transfer cooldowns as per Chaosy's suggestion.

Thanks to both of you for commenting!

Edit: I just realized that the "remove caster and create a unit" solution is a lot more work than I originally thought. I started working on it, and I realized that I would need a way to transfer all the custom buffs and their effects to the new unit in addition to the things I had previously mentioned.

I'm still very open to suggestions for instant or near-instant turning, but I think that removing and creating a unit probably won't work for this ability :(
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,031
Edit the model to add a head bone that encompasses the whole model, then use the action to lock a unit’s head bone to another unit. Head bone facing can be applied instantly afaik. Unlock it after a fraction of a second and I believe the unit will have properly turned.
 
Status
Not open for further replies.
Top