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 / How to play animation backward

Author
Message
Zigi
17
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 7th Jan 2013 00:00
Hi everyone.

I would like to play a character animation backward in DarkBasic Pro.
My character has walk forward animation but no walk backward animation.
So I would like to play the walk forward animation backward.
But I don't know how to do it.
I have tried this way:

play object objnum,higher_frame_num,lower_frame_num

But it don't work this way,don't play the frames backward from high to low,only from low to high (forward).

Anybody could help me please?

Thanks.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 7th Jan 2013 05:32
I'm taking an extremely wild guess; Set Object Speed -1. I think if you set its speed to negative it plays in reverse. Otherwise just set the object's frame manually.

Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 7th Jan 2013 09:19
You can manually handle object animation by using the Set Object Frame command.

You mimic Set Object Speed by treating it as "number of frames per second" so it's easy to keep track of speeds manually and convert everything.

If you do a good job at setting up a manual system, then it actually gives you better control. You can more easily and elegantly implement bullet time effects, and more reliably start and stop animation.

For example to render the screen without advancing animation, you simply omit processing animation. With built-in animation you need to stop all animating objects, render, and possibly resume all of those objects later.

Additionally, it will make things easier if you decided at a later date to convert to Enhanced Animations, or another advanced animation system.

Zigi
17
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 7th Jan 2013 18:59
Thanks all the replies.

Well,the Set Object Frame don't work neither.The same happend.Don't play the animation frame from high value to low (backward),only from low to high.
If I set the object speed to negative value,it works but only if I specify the start frame without end frame.But in that case it plays all the animations backwards from the start frame,I can't stop it,because if I try to specify the end frame where to stop which is a lower value,it don't play the animation neither.

I have been looked Enhanced Animation for DBP.It sounds good and the demo very impressive maybe I'l buy it,but I'm not sure,It would be nice to see that 70 commands and maybe a few examples also to get an idea how it works exactly how my animations fits in.Maybe worth the money.
Thanks.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Jan 2013 00:11 Edited at: 8th Jan 2013 00:12
Hi there.

@Zigi ...try this:



Then you have to choose the frames you need for your animation.

Cheers.

I'm not a grumpy grandpa
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 8th Jan 2013 00:50 Edited at: 8th Jan 2013 00:52
I literally just did this, lol. This is what I did:



I took out a lot of my code on here, so you may have to alter a couple things, but this worked great for me so hopefully it'll help.
This was also only for one play, you'll have to change a couple things to make it loop

The fastfood zombie killer
Zigi
17
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 8th Jan 2013 21:04 Edited at: 9th Jan 2013 23:34
Thanks all the codes,it helped me to find the solution.
Helped a lot.
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 9th Jan 2013 05:23
That's awesome. Thanks for posting a followup.

On a side note:
On this thread and many others, I find it interesting that we keep proposing all these awesome clever and intricate ways of doing things... And the people are only ever after a simple unambitious solution. It makes me wonder if posting anything more then 2-3 lines of code is just a waste of time.

Login to post a reply

Server time is: 2026-07-07 07:11:20
Your offset time is: 2026-07-07 07:11:20