Hey guys, im back with another noob question. I'm trying to get my model to change when i move, i.e change from idle to walking.
i've decided to use a function, and this is what i have
rem Functions
function handle_player_speed(speed#,actionmode)
rem Handle Speed control
if actionmode=1 or actionmode=2
speed#=speed#+5.0
if actionmode=1 and speed#>30.0 then speed#=30.0
if actionmode=2 and speed#>30.0 then speed#=30.0
else
speed#=speed#-5.0
if speed#<0.0 then speed#=0.0
endif
endfunction speed#
function handle_player(actionmode,subaction)
rem Handle player animation
handle_player_anim(actionmode,subaction)
endfunction
function handle_player_anim(actionmode,subactionmode)
if smoothing=0
if actionmode>0 or subactionmode>0
rem Switch to Walk
if object frame(101)<100 or object frame(101)>115
start=100
newanim=2
smoothing=4
endif
else
rem Switch to Idle
if object frame(101)>25
start=0
newanim=1
smoothing=4
endif
endif
rem Activate smoothing
if smoothing>0
rem Begin smoothing transition
stop object 101
set object interpolation 101,25
set object frame 101,start
endif
endif
rem Switch to new animation
if newanim>0
if smoothing=0
rem Trigger New Anim
if newanim=1 then length=20 : speed=10
if newanim=2 then length=15 : speed=50
rem Set Animation
set object interpolation 101,100
set object frame 101,start
loop object 101,start,start+length
set object speed 101,speed
rem Reset flag
newanim=0
else
smoothing=smoothing-1
endif
endif
endfunction
i run into a "Function Declaration" error. and i can't find why.
help is requested
please be gentle