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 / making "play object" use variables?

Author
Message
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 26th Apr 2007 00:07
'ello all,

I have a question and I will try to ask it the best that I can...

Say I have 10 guns and all of the guns have identicle animation properties, all animations are at the same keyframe. and I wanted to code out the animations for let's say:

select weapon
move
fire
reload
scope
put away

I am going to have to use the "play object #,#,#" command. This is fine for a single object but if I am calling say 10 objects that use the same animation it makes the task long winded. Does anyone have a method that they ave used in the past? I am not asking for you to write it for me but rather point me in the right direction. I was thinking that the append object may work but that just transfers animation properties amongst files. I was also thinking that if I could use say



Now it could just be me and that I am way off base with this, but I hope that is not the case. Once I know where to look (the help files really weren't that helpfull for this matter) I can get things sorted and write proper code for it.

Cheers,
Dave


Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Apr 2007 00:34
I would think of using a generic gosub (or function ) in this fashion:

playgun:
set object frame active,startframe
play object active,startframe,endframe
return

and then assign object number to "active" according to what gun you are choosing and startframe,endframe according to what animation you need to play.
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 26th Apr 2007 01:00
ok my question now is the play object requires an initial object to get the frames from. so wouldn't I have to declare the initial object as a number? "play object #,#,#" so how is "play object "active",#,#" going to help me if it does not have the inital object to rip the animation frames from?

Cheers,
Dave


Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Apr 2007 01:20
you gosub to "playgun:" ONLY when there is an active object assigned

that call could be on a line like this:
if active <> 0 and keystate etc.. then gosub playgun

maybe I'm not getting what you are trying to do
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 26th Apr 2007 01:44
I think you are, I will give it a go tomorrow, I need sleep now though...Thanks for the help man, I will elt you know how it turns out..

Cheers,
Dave


Login to post a reply

Server time is: 2024-09-25 21:19:08
Your offset time is: 2024-09-25 21:19:08