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

Unit Facing Direction Question

Status
Not open for further replies.
Hello everyone, as I am sure many of you know I have not been online for a very long time. Hi again to those of you who remember me! I am working on a hero for a map and one of his skills is proving to be a major pain in the butt, so I decided to come and consult the brilliant minds at the hive.

The skill I am working on involves the hero very quickly dashing to his target and dealing damage when he gets there. I am having a few problems with this.

The first problem is that of the casting unit arriving at the location of the target unit, I have it set so that after the dash begins it will stop as soon as the casting unit arrives at his target, I also have it set so that the casting unit is made to face his target every time he is moved along the dash, this way the skill homes in on its target. My problem is that if the hero is close to his target, and facing the opposite direction he will swing around as the dash starts, but if he misses the target, he will overshoot and spin in circles around the target indefinitely because he never actually gets there. The obvious way to fix this would be to make it so the caster instantly faces the target before anything else happens when you cast the ability. When I use the trigger Make unit face point over 0.00 seconds, however, he just plain doesn't do it, and he shoots off in an arc as usual. Another way to make this work would be to make it so during the dash itself the hero turns faster so he doesn't overshoot the target. So my base question is, how the heck do you make the the trigger for making a unit face a point work, it just doesn't seem to do anything.

The other question involves the animation for the unit, I am using the blademaster model and I want his attack slam animation to play along the course of his dash to the target. I have this animation is a separate trigger from the movement, since the movement is a periodic event so the animation would play over and over really fast. I have it set so the movement trigger is initially off, and the initialization trigger sets variables for the caster and target and also turns on the animation and movement triggers. What I don't understand is how to make the animation trigger, because I cant figure out an event to start the animation. I wan't to use an event that refers to a specific unit casting an ability, and obviously would use a condition to ensure that it only works for the ability in question. What I can't figure out though is how to make events refer to variables, I want the event to refer to the variable that I stored the casting unit in, but I seem to be unable to do so. All I can do is pick a unit on the map, I cant pick one of my stored variables.

If anyone can help me solve either of these problems I would be very appreciative.

All in all here is a very quick synopsis of what I said if it was too much to take in:
1. How do I make caster face target at beginning of ability or during movement?
2. How do I make casters animation play when I am unable to make an event refer to the variable that I stored the caster in?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
When I use the trigger Make unit face point over 0.00 seconds, however, he just plain doesn't do it, and he shoots off in an arc as usual. Another way to make this work would be to make it so during the dash itself the hero turns faster so he doesn't overshoot the target. So my base question is, how the heck do you make the the trigger for making a unit face a point work, it just doesn't seem to do anything.

You can't make a unit face an angle after 0.00 seconds, there is a minimum amount of time that you must wait while the unit is turning. Why do you have to use the unit's facing angle though? You can just use a real variable to determine which direction he will move and from there just make sure he's always "trying" to face the designated direction.

2. How do I make casters animation play when I am unable to make an event refer to the variable that I stored the caster in?

I'm not sure what you mean, but I'm thinking you're going to want to look at hashtables. From the sound of it you're still using GUI; I'm not much of a GUI user.
 
I am indeed a GUI user, I don't have the patience to learn jass at this point in my life, haha. I have the movement set up so that he moves in the direction that he is facing, and the facing thing set up so that every time it moves him it also turns him towards the target. How would I make it so he is guaranteed to be facing the target by the time he gets there?
 
Status
Not open for further replies.
Top