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 / More trhan one animation i 3d object?

Author
Message
deathAngel
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 14th Aug 2003 15:11
Hi, I wonder how i can swich betwen aniomatin in 3d object? For example if i have player object which has walk and run animation, when i use the play object command it playes the walk animation, how to change it to run animation?

(sorry for my bad english, it's not my main language.)
Thanx!
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 14th Aug 2003 17:24
LOOP OBJECT Object Number, Start Frame, End Frame
or
PLAY OBJECT Object Number, Start Frame, End Frame


see the "Room Demo" for a template

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 14th Aug 2003 20:24
What I do is:

Animations(1,1) = 0
Load object "standing.x",1
Animations(1,2) = total object frames(1)
Append object "running.x",1,total object frames(1)
Animations(1,3) = total object frames(1)
Append object "jumping.x",1,total object frames(1)
Animations(1,4) = total object frames(1)

etc.

Now you've got a nice array of all the frame positions for your animations.
So to stand:
loop object 1,Animations(1,1),Animations(1,2)
To run:
loop object 1,Animations(1,2),Animations(1,3)
To jump:
play object 1,Animations(1,3),Animations(1,4)

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Chenak
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 14th Aug 2003 20:31 Edited at: 14th Aug 2003 20:34
append object doesnt work does it? it just crashes dbpro for me

This code will work for switching animations, just put it in your main loop and change the code a bit and it will work.


Once you start down the Dark Path, forever will it dominate your destiny...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Aug 2003 22:47
See my update to your bug post ...
Chenak
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 14th Aug 2003 23:51
cheers IanM

Once you start down the Dark Path, forever will it dominate your destiny...
Morales
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: - Please Select -
Posted: 15th Aug 2003 00:06
Im useing a good way to do what you wont
im doing it in a loop a for loop.

are you useing darkmatter objects?
deathAngel
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 19th Aug 2003 03:28
Guys thanx for the answers, and sorry it took me so long to replay, i live in toronto and had no internet conection since thersday(hydro blackout) `till today.

What i want to do is to swich betwen animation that are saved in an .mdl charcter from half life. it has many animations like walk/run/jump/shoot... and evrey animation has it's own separate frames. for example walk anim has 30 frames, shoot has 30, when i use the loop object, or play object commands it plays only the firs animation which is walk.
hope now you can anderstand may problem(Sorry for the bad English, it's not my main language).

Login to post a reply

Server time is: 2026-07-25 08:10:53
Your offset time is: 2026-07-25 08:10:53