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

[Trigger] Attacking while moving trigger

Status
Not open for further replies.
Level 2
Joined
Oct 16, 2013
Messages
18
Hey guys!

Normally I only come here after I've got a working prototype that I'm having trouble with, but in this situation I don't really even know where to start or if it's possible. I'm hoping for some ideas on how to make this work.

I have a hero that I want to be able to cast an ability, and then for a set duration that hero can attack while moving.

I've already looked into Phoenix Fire but I want his attack animations to play, so that's a no-go. From what I've heard, there's a way to use GUI to simulate "movement" through triggers so that the hero could theoretically attack while moving. My first question is - how would something like that work? Mouse-click as an event trigger, then I'm lost trying to make it work after that.

Second question is - if I'm using GUI to reposition the hero to simulate movement, am I going to be able to trigger both attack and moving animations at the same time? I'm guessing I may need a specific custom unit with those coded in.

Any advice or answers would be extremely helpful! Thanks in advance.
 
Level 11
Joined
Jul 4, 2016
Messages
627
I have also tried stimulating movement while attacking in the past. But too many problems popped up, so I gave up on it.

But yes, you are going to need have a model that has animations where its both moving and attacking if you don't want it to look strange.

Using the GUI actions to simulate movement will disrupt his orders preventing him from attacking.

You should instead use something like


page.gif
Custom script: call SetUnitX(unit, GetUnitX(unit) + some speed* Cos(bj_DEGTORAD * some angle))
page.gif
Custom script: call SetUnitY(unit, GetUnitY(unit) + some speed* Sin(bj_DEGTORAD * some angle))

to simulate movement.
 
Level 2
Joined
Oct 16, 2013
Messages
18
I have also tried stimulating movement while attacking in the past. But too many problems popped up, so I gave up on it.

But yes, you are going to need have a model that has animations where its both moving and attacking if you don't want it to look strange.

Using the GUI actions to simulate movement will disrupt his orders preventing him from attacking.

You should instead use something like


page.gif
Custom script: call SetUnitX(unit, GetUnitX(unit) + some speed* Cos(bj_DEGTORAD * some angle))
page.gif
Custom script: call SetUnitY(unit, GetUnitY(unit) + some speed* Sin(bj_DEGTORAD * some angle))

to simulate movement.

Thanks for the reply! Based on everything I've looked up, I may not be able to do this the way that I'd like to so I'm thinking I might just scrap the idea, as cool as it would be.
 
Status
Not open for further replies.
Top