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 / Animation problems (adding reload animation problems)

Author
Message
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 23rd Apr 2007 19:14
I need a bit of help with this animation sequence. I have the firing animation and walking animations working very nicely with a lot of help from a fellow forum member. I am attempting to add the reload animation in to the mix of things and I run in to a couple of problems. First here is my code.



To clerify a variable, the "move=1" is used to state the W,A,S,D keys. And here are the problems I am having.

1) The player must be standing still in order to play the reload animation
2) The reload animation will only play one time through

Any suggestions? Thanks in advance.

Cheers!
Dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 23rd Apr 2007 19:19
Can I ask what the frames 51-67 are? Just to help me understand this a bit better. Is it that you are playing the whole walk animation when move=1?
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 23rd Apr 2007 19:35
Vorconan-

Move = 51,67
Idle = 26,50 (I had to play them backwards to get them to fit right)


Cheers,
Dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 23rd Apr 2007 21:13 Edited at: 23rd Apr 2007 21:22
It seems a bit of an odd way to organise it, my way of animating the models is to have the idle animation working, as the 'w' key is pressed, the frame is set to the start of the animation then increased as the key is held, then reverts back to the beginning again.

Here's some code to keep it organized if you want, you don't have to though, it just may help. I adapted it a bit to keep with the animations of your model. It's not tested, just adapted so there maybe a mistake in it.



I was not sure if the frames were the animations of the player or the weapon, but they should work the same. I went on a bit here, but this was an attempt to improve my own programming and help you.

I think I know what the problem was in the first place if you just wish to keep your code and correct it -

The reload animation will only play once as you have told it to.

The reload variable will only return to 0 if the object is not in an animation at the present time, since you have an idle animation going then it will constantly be playing.

Hope that helped, I may not have solved your problem but here it is anyway.

V
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 23rd Apr 2007 22:04
thanks for the help man!


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 23rd Apr 2007 22:05
It worked!?!?

No problem, means I'm getting better at this
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 23rd Apr 2007 23:47 Edited at: 23rd Apr 2007 23:47
With the help of another friend we got the reload animation to play correctly. We loaded the animations and use the following to call on it.


This works rather well, i setit up so if you are scoped and hit reload you come out of the scoped view..

Cheers,
Dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 23rd Apr 2007 23:54
Nice one, you seem to be making progress. I haven't had DBP for very long, but I'm getting used to it, just mainly messing around with Dark Physics and getting a character from FPSC to walk, run, turn, strafe, crouch etc. I'm really impressed with the quality of this program, I must say.
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 24th Apr 2007 00:07 Edited at: 24th Apr 2007 00:13
Same here..I am adding the zoom, crouch, lean and jump actions tomorrow..I think...once that is done then I can move back to my modelling for a few weeks.

In case you are intrested here is the player controls from start to finish..'er to the point that i am at now anyway. This is with alot of help from TehCoderer, that dude is a god send..



Cheers,
Dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 25th Apr 2007 20:30
Some nice code you got there, If you look on the newcomer's rpg tutorial there's a camera code to keep the camera in the same position to the player constantly, you just change two numbers to change the zoom amoun

Best
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:14
I got the zoom working by adding the "camera FOV" Once I uncomplicated it in my brain I got it to work. turns out that all I needed to do was add this "set camera fov ##" in three different places. I added it to the "mousclick()=2" and then again for the reload=1 variable line...it works just fine, though I soon realized that I had to add it to the main camera or things got goofy looking...but I got it sorted out. Now I have to figure out how to add a recoil that pushes the camera back and up to about a 45 degree angle and have it smoothly reset to the starting position, I had found a few lines of code around the forums btu I could not get it to work properly. It would not move slowly and no matter what the angle (45 or -45) it would move the camera down on the Xangle instead of up 45 on the Xangle. I tried using that curve command but could not get it to work at all.


Cheers,
Dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 26th Apr 2007 18:39
I've never used that FOV command, I'll look into it. I might look at the FPSC source code for those commands though, it's long but looks resourceful
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 10th Jul 2007 15:09
To get recoil why not try creating a limb at the scope, then when zoomed positioning the camera at the limb. Set the rotation of the camera to that of the limb, then when your weapon recoils the camera will recoil too.

Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 11th Jul 2007 15:09
This is what we did to get the recoil.


Quote: "if recoil=0
cx#=wrapvalue(cx#+mousemovey())
cy#=wrapvalue(cy#+mousemovex())
else
t=mousemovex()
t=mousemovey()
if recoil>16
cx#=cx#-2
text 0,0,"YEP"
else
cx#=cx#+1
endif
recoil=recoil-1
endif
rotate camera cx#,cy#,0"



Cheers,
dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 11th Jul 2007 19:23
Quote: "To get recoil why not try creating a limb at the scope, then when zoomed positioning the camera at the limb. Set the rotation of the camera to that of the limb, then when your weapon recoils the camera will recoil too."


Thats a nice idea

Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 11th Jul 2007 21:07
Thanks. I've been using it to position my camera. It means you don't have to code things like smooth camera sway, you can just animate a limb to swing smoothly during the walk cycle, and the camera will move accordingly (the same is true for a shaky cam running effect)

I know this is off topic, but I'm really glad to see some other FPSC users here. I was starting to feel like a kid that's got lost in a massive supermarket.

heres an "if" that'll print the limb numbers and names of the specified object to the screen:


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 12th Jul 2007 00:32 Edited at: 12th Jul 2007 00:33
Quote: "I know this is off topic, but I'm really glad to see some other FPSC users here. I was starting to feel like a kid that's got lost in a massive supermarket."


I felt that way looking at the main DBP discussion board, then again, i still do mostly

That command will probably come in handy aswell, thanks

Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 13th Jul 2007 23:02 Edited at: 13th Jul 2007 23:03
I think a few of us are wanting more from our game dev experiences. There are a few more of us around in the DBP forums. I haven't worked on this project in a month or maybe a little longer. I hop eto pick it back up in a few days or weeks. I am working on more content to add in and different types of foliage...


Cheers,
Dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 14th Jul 2007 00:19
I know what you mean, I keep switching projects over and over, I think I've finally found a project that I'll stick with

Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 14th Jul 2007 00:39
I am with the same project, I was just in a different country for the past month and working way to hard the few weeks before that. I hope things start settling down again...


Cheers,
Dave


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 14th Jul 2007 00:41
Yeah, sounds like a good project, at least you have the gun working, or it sounds like it anyway

Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 14th Jul 2007 00:45
Yeah the gun is all working, I have the terrain loaded and most of the trees placed with collision and am just about done setting the culling up on them...


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 14th Jul 2007 16:31 Edited at: 14th Jul 2007 16:50
Cool, can I ask how you are setting up the culling? I have no idea about it at the moment

EDIT - Found the exclude object command now, is this what you used?


Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 16th Jul 2007 00:48
This is what I am using....




vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 16th Jul 2007 19:29
wow, that looks quite complicated, i'm just using this to start with-




Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 16th Jul 2007 20:27
RF, that's a pretty nice mod of the distance function. I hadn't thought of doing it like that. Do you have any trouble if you have large entities that are both within and outside the distance?

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 16th Jul 2007 20:55
Wow, I was having this same exact problem the other day. I might take a look at it again...

Quote: "
I know this is off topic, but I'm really glad to see some other FPSC users here. I was starting to feel like a kid that's got lost in a massive supermarket."


Haha, same here.

vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 16th Jul 2007 20:56
Good question Butters, also RF, can I ask why you reposition the camera within the for loop?


Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 17th Jul 2007 02:39 Edited at: 17th Jul 2007 16:18
Quote: "RF, that's a pretty nice mod of the distance function. I hadn't thought of doing it like that. Do you have any trouble if you have large entities that are both within and outside the distance?"


I do depending on what angle I look at the object from. If I stair at it dead on then everything works but if I am close to an object and I look up or down that object vanishes. I have to play with the angle portion a bit more.

I still can not seem to get it working correctly.uhm..doesn't seem
to want to cull the trees very well, any suggestions?

Quote: "can I ask why you reposition the camera within the for loop?"


that was not needed so I removed it....

try something like this..




vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 19th Jul 2007 00:18
Thanks for that, it'll come in handy


Login to post a reply

Server time is: 2024-11-26 12:29:11
Your offset time is: 2024-11-26 12:29:11