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

Movement system

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
As far as I understand this system, the animation is set into an integer. So you just have to
replace the integer value with the value of of the walk animation of the ghoul.

But don't ask where to find this simple line. He said, you can try around to find the correct index, but for this you need to find the line of it first -_-;
 
When you use:
function SetMovementUnit takes unit u, player p, integer anim returns nothing

Make sure you input the right animation index.

Just mess around with the number until you get the right one. (It starts from 0 and increments by 1 until the unit has no more animations)

Or, you can just use:
function SetMovementUnitAnimation takes player p, integer animation returns nothing

Like this, for example:
call SetMovementUnitAnimation(udg_MyPlayer,5)

That will change the animation too.

EDIT: The animation index for "walk" for the ghoul is 1. :)
 
its on the botom part of the movement system library...

JASS:
function ReleaseMovementUnit takes player p returns nothing
        if ArrowKeyMovement.u != null then 
            set ArrowKeyMovement.walking = 0
            call SetUnitAnimation(ArrowKeyMovement.u,"stand")
            call SetUnitTimeScale(ArrowKeyMovement.u,1)
            set ArrowKeyMovement.u = null
        endif
    endfunction

    function SetMovementUnit takes unit u, player p, integer anim returns nothing
        if u == null then
            call ReleaseMovementUnit(p)
            return
        endif
        if ArrowKeyMovement.u != null then
            call ReleaseMovementUnit(p)
        endif
        call SetUnitAnimation(ArrowKeyMovement.u,"stand")
        set ArrowKeyMovement.u = u
        set ArrowKeyMovement.animation = anim
    endfunction

    //! runtextmacro ArrowKeyMovement_Plugins_Functions()

    private function Init takes nothing returns nothing
        //! runtextmacro Init_ArrowKeyMovement_Plugins()
    endfunction

endlibrary
 
JASS:
function SetMovementUnitAnimation takes player p, integer animation returns nothing
    set ArrowKeyMovement.animation = animation
endfunction
/*
 First and foremost: Do not edit anything on the library... 
 
 just call this function and play with the value of integer anim until you get the right animation index...
 

 You should have no problems doing this, unless you don't know how to call functions...
*/
 
Status
Not open for further replies.
Top