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 / Play Object Question ?

Author
Message
Justice
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location:
Posted: 31st Dec 2004 02:05


Hi,

I have an object (A rope) which has 6 Frames, when the animation gets to frame 6 it jumps back to frame 1 & the animation of the rope swinging look jumpy.
When the animation gets to frame 6 I would like it to go backwards. (ie. go backwards from 6 to 1 to make the swinging rope look smooth)

Has anyone got any code which could do this ?
Mason
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: Arizona
Posted: 31st Dec 2004 02:41
I'm not sure if you can do that. Your best bet would be to make your animation smooth in what ever animation tool you used to animate it. That way when you put it in the game, it has a smooth transition from frame 6 to 1 and the program uses less code.

¤§Mason§¤

Free Programs, models, and image at http://www.geocities.com/blacklab_studios
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 31st Dec 2004 02:57
When animating the object make sure you start the animation at frame 1 and put an extra frame on the end which is the same as frame 1. Then when you loop it don't include the extra frame.
eg. Make the animation from 1-6 with 7 the same as 1. then have it loop from 1-6.

Realms Of Tutopia: Rise Of Evil
http://www.freewebs.com/elbsoftware/index.htm
Mason
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: Arizona
Posted: 31st Dec 2004 03:23 Edited at: 31st Dec 2004 03:23
Andrew, thats true but, that will not solve his problem if the rope doesn't gradually return back to its orignal spot. If you just add another frame thats the same as the first 1, it is still going to do the exact same thing.

Try Making the rope have more frames. Make frames 1 - 6 have the roping doing its animation. Then have frames 7 - 13 do the same animation that 1 - 6 does backwards. I believe thats what you were asking for earlier. This will make the animation smooth and require no extra code.

¤§Mason§¤

Free Programs, models, and image at http://www.geocities.com/blacklab_studios
bibz1st
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 31st Dec 2004 19:43
use SET OBJECT FRAME instead of PLAY OBJECT, ie..
x=1
DO

if x=1 then up=1 (play frames in right order)

if x=6 then up=0 (play frames in reverse order)

if up=1 and x < 6
inc x,1
set object frame object num,x
endif

if up=0 and x > 1
dec x,1
set object frame object num,x
endif

LOOP
Mason
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: Arizona
Posted: 1st Jan 2005 05:45
That works fine, but it would be more code than is needed. I think he should stick to just animating it correctly. It would require a lot less code and would make a lot more sense.

¤§Mason§¤

Free Programs, models, and image at http://www.geocities.com/blacklab_studios
bibz1st
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 2nd Jan 2005 00:28
yes, if its just a basic swinging motion that's required then getting the animation right in the first place is the best bet,
make the anim 10 frames instead of 6, then copy frame 5 into frame 7, 4 into 8, 3 into 9 and 2 into 10, then just PLAY OBJECT should work fine
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 29th Mar 2005 09:58
Quote: "use SET OBJECT FRAME instead of PLAY OBJECT"


Thank you bibz1st for the code that will reverse and objects animation, i have been tring to do this all day and now with ur help, i got it to work, cheers!

Login to post a reply

Server time is: 2024-09-23 15:38:39
Your offset time is: 2024-09-23 15:38:39