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

changing animation names

Status
Not open for further replies.
Level 16
Joined
Jan 21, 2011
Messages
999
by the way guys,i have a villager with 40 animations i downloaded earlier.
it seems that it's animation names are the same, like, attack gold: where the villager sweeps his sword.
then the other attack gold: where he stabs it.
i want to specify the animation to be played in triggers.
BTW, when i use The_Witcher's advanced camera,Keyboard system, the villager uses it's stand ready animation instead of running...
 
Level 15
Joined
Sep 27, 2009
Messages
669
by the way guys,i have a villager with 40 animations i downloaded earlier.
it seems that it's animation names are the same, like, attack gold: where the villager sweeps his sword.
then the other attack gold: where he stabs it.
i want to specify the animation to be played in triggers.
BTW, when i use The_Witcher's advanced camera,Keyboard system, the villager uses it's stand ready animation instead of running...

Yea i was making an orpg map with villager, The_Witcher's advanced camera and keyboard and it was sliding :D
 
Out of curiosity, why do you need to change the animation names? :) If you want it to have certain animations, just use this function:
  • Animation - Add the <animation name> animation tag to <unit>
As for The_Witcher's movement system, there is a function for it. You simply use:
JASS:
    call SetMovementUnitAnimation( player , animation )

Replace player with whatever player you want to change it for. (Player(0) is Player 1 - Red, Player(1) is Player 2 - Blue, Player(2) is Player 3 - Teal, and so on)

Then you need to replace animation with the animation index of whatever you want to be the "running" animation. If you are not sure what the animation number is, then add this script to your map, make sure you have JASS NewGen:
JASS:
scope AnimationIndeces initializer Init
    globals
        integer array currIndex
    endglobals
    
    private function runIndeces takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local integer id = GetHandleId(u)-0x100000
        call SetUnitAnimationByIndex(u,currIndex[id])
        call BJDebugMsg("Running "+GetUnitName(u)+"'s Animation #: "+I2S(currIndex[id]))
        set currIndex[id] = currIndex[id]+1
        set u = null
        return false
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 11
        loop
            exitwhen i < 0
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SELECTED,null) 
            set i = i - 1
        endloop
        call TriggerAddCondition(t,Condition(function runIndeces))
    endfunction
endscope

Just click a unit to play their animation. Each time you click it, it will show which animation index it is playing. Once you find the right animation to choose, just pick that index that was read out in the map and use it like this, for example:
JASS:
    call SetMovementUnitAnimation( Player(3) , 5 )
// This will set the unit movement animation for The_Witcher's system
// to the unit's animation of index 5. It will set it for the unit controlled 
// by Player 4 - Purple

Eh, it is a bit confusing but maybe it will help. :ogre_haosis:
 
Level 1
Joined
Feb 11, 2011
Messages
4
im new here someone please tell me how can get in the chat in the lobby
avatar193162_3.gif
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
First of all GAB, you shouldn't post such questions in other people's threads.
Second, don't double post.
Third, in upper-left corner, there is First News, then Chat. Click it, then scroll down, to the big button that says to join lobby.

On-topic: Maybe try using other system for moving?
 
Status
Not open for further replies.
Top