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

moving unit without resetting walk animation?

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
I want to move the unit with the arrow keys and right click to attack. The only problem is, if the unit doesnt have 0 movement speed (and therefore no right click) the animations reset when it's moved. How can you get around this?

possible alternatives are detecting right click some other way, which I dont think is possible.

Also, is there some way to hide the stop command button? it freakin annoys me.

thanks
 
Level 6
Joined
Oct 10, 2009
Messages
1,425
well for your first problem you could do
JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call AddUnitAnimationProperties(gg_unit_yourunithere,"walk",false)
    //yourunithere can be replaced with your actual unit :P
endfunction

function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
or in GUI
[trigger="your trigger"]
Actions
Animation - Remove the walk animatin tag to (your unit)[/trigger]
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Does that actually work?

I would have advised using the SetUnitAnimationByIndex function instead of SetUnitAnimation.

After reading further, I don't understand what you're trying to do here. If you can only move with arrow-keys, then what is supposed to happen when you attack the unit? Also, if you issue a "smart" order that means you have right-clicked.
 
Level 8
Joined
Mar 3, 2009
Messages
327
i was thinking of using right click for attack, especially for spells and ranged attacks. Ill test Cweener's thing in a bit, my computers having a fit at the moment. I guess i wasnt thinking when I posted this, patrol is also going to be a problem isnt it...

I guess the smart thing should work though, and solve the problem with the buttons, as I wont have to give the hero movement.. +rep to all :D

Edit: hmm, Cweener's solution doesn't seem to work... and the smart seems to only work if the right click is doing something, like ordering the unit to move :/
 
Last edited:
Level 18
Joined
Jan 21, 2006
Messages
2,552
GoGoTauren said:
and the smart seems to only work if the right click is doing something, like ordering the unit to move :/

I asked this before, but perhaps you over-looked it.

Berbanog said:
After reading further, I don't understand what you're trying to do here. If you can only move with arrow-keys, then what is supposed to happen when you attack the unit? Also, if you issue a "smart" order that means you have right-clicked.

The smart order is only issued when move/attack is issued via right-click. If your unit does not have either of these then the order will not be issued. If the problem is that your unit tries to interrupt the arrow-key commands then you can easily cancel the orders issued and re-issue the previous order using Dusk's LastOrder library.

If you want your unit to be able to turn then it will have to have the Move ability, so how exactly did you test the right-click without your unit being able to move?
 
Level 8
Joined
Mar 3, 2009
Messages
327
oh i replaced my hero with a footman. I dont want the move icons and crap because they take up space i need for abilities... and no I don't an uncloseable spellbook because they stuff up the order of everything and the little exit button in the bottom right of the screen gets in the way.

What i thought would be good is if instead of an attack ability, you could right click and the hero would face that point and attack, but I don't want all the command buttons... I guess its impossible though. thanks anyway...
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I believe there are some hidden secrets on removing the Patrol and Hold Position buttons but you may be out of luck on removing the Attack and Move buttons without actually removing the unit's ability to attack/move.
 
Status
Not open for further replies.
Top