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.

Newcomers DBPro Corner / walking and chilling, play and stop object

Author
Message
Kjetil
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Norway
Posted: 20th Mar 2003 13:10
this wil make the object(player) walk when pressing up, and stop when not pressing up.


But I want him to to move when he stands still so I made a chill cycle. But I don't manage to get this into code. I've tried for quite some days now to change the animation looping. But its probably something I'v missed
- Kjetil
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 20th Mar 2003 14:23
instaed of stop object player

put
loop object player,chillstart#,chillend#


btw the variables for the frame numbers should be integers i think
Kjetil
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Norway
Posted: 20th Mar 2003 16:47
nope, that don't work. Because if I write

then it wil start looping the animation 60 times per second (depends on fps). So I realy should have a code like

but that don't work either because [object playing (player] return a 1, because he is already walking, because of the walk cycle.

So I wish I could have a code like

now, that would work.

but seriusly, I need that animation code to work, anyone?

- Kjetil
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 20th Mar 2003 23:28 Edited at: 20th Mar 2003 23:42
LOL if only it were that easy
i see what you're saying though
how about this

sync on
load object "idle.x",1
append object "walk.x",1,105
position object 1,0,0,0
point camera 0,0,0

sync on
load object "idle.x",1
append object "walk.x",1,105
position object 1,0,0,0
point camera 0,0,0
loop object 1,0,20
yrotate object 1,180
fix object pivot 1
do
if upkey()=1 then walking = 1 : move object 1,5
if upkey()=0 then walking = 0
if walking<>anim_state
if walking = 1
set object frame 1,105.0
loop object 1,105,125
endif
if walking = 0
set object frame 1,0.0
loop object 1,0,20
endif
anim_state=walking
endif
sync
loop
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 20th Mar 2003 23:43
wow i edited it after i tested (lol) and it got messed
still works though
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 21st Mar 2003 14:39
Uhh, just a question but wouldn't something like this work:

Quote: "
if upkey()=1
loop object player,walkstart#,walkend#
endif

if upkey()=0
loop object player,chillstart#,chillend#
endif
"


If up's being pressed then play walking animation, if it's not then play chilling animation?

"Computers are useless they can only give you answers."
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 22nd Mar 2003 18:15
yes it will work (if you add the set object frame command) BUT
when you press the upkey then it will play the WHOLE walk animation, if you let go, it will still finish it... my code will switch in the middle

Login to post a reply

Server time is: 2024-11-24 05:59:40
Your offset time is: 2024-11-24 05:59:40