Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Animate character

Author
Message
Behdadsoft
17
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 14th Jun 2013 22:26 Edited at: 14th Jun 2013 22:48
Hello

I learn The Basics Monster hunt Tutorial.I have a barbarin model and I want know how can import it to darkbasic and run walk animation after press up key?

49 - 92 = My Player walk animation

THANKS
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 14th Jun 2013 22:32
I'm having a hard time understanding you, but I think the command you're looking for is loop object #, 49, 92 .

http://mattsmith.carbonmade.com/
Behdadsoft
17
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 15th Jun 2013 08:09
can you give me sample code for this work?
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 15th Jun 2013 09:31 Edited at: 15th Jun 2013 09:33
load object "MyAnimatedModel.x",1

loop object 1,49,92

sync on
sync rate 60

do
text 0,0,"Current Frame: "+str$(object frame(1))+"/"+str$(total object frames(1))
yrotate object 1,object angle y(1)+1

//set object speed 1,1 < you can also activate it to set the animation speed.
sync
loop

Stream SnifferTools/Plugins/Models/Games and more!
Daniel wright 2311
User Banned
Posted: 15th Jun 2013 20:32
If upkey=1 then loop object 1,49,92 is also a easy set up, one line of code, but then you will have other animations, so what I do is set up a animation list then set everything to 0 other then the animation playing.

So

If upkey=1 then animation=1
If downkey=1 then animation=2

if animation=1 then loop object 1,49,92
if animation=2 then loop object 1,what ever , what ever.

my signature keeps being erased by a mod So this is my new signature.
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 15th Jun 2013 21:48
I always set my start and end frames to variables as I've had a few problems in the past changing frames from within the loop. So what I'd personally do is
loop object 1, start#, end# : set object speed 1, speed#
do
if upkey()=0 then start#=1 : end#=10 : speed#=10 (for a breathing animation)
if upkey()=1 then start#=11 : end#=20 : speed#=20 (walking animation)
loop

http://mattsmith.carbonmade.com/

Login to post a reply

Server time is: 2026-07-07 15:11:23
Your offset time is: 2026-07-07 15:11:23