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.

FPSC Classic Scripts / Play animation on button press.

Author
Message
TGPEG
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location: Bristol, United Kingdom
Posted: 8th Jun 2010 22:58 Edited at: 9th Jun 2010 01:35
I've been trying all night to get this thing to work. Essentially I'm trying to modify the "player body" script that comes with project blue so that the character I made will play an animation I've given it (tagged on at the end of the animation set). The animation works because throughout the evening on some occasions I've managed to get it to play in FPSC.

Basically, what I'm hoping the script will do is that when the player presses 'F' (ie key 33) the player freezes (got that working on occasion), the field of view of the camera shifts slightly so that the animation of the arm lifing can be seen (got that working too), play the animation while the view is shifted and then play a decal in front of the player where the hand is. That bit can come later, but for now, I just want the animation to play once, once the player taps F.

Now I can make it happen when the player holds it down, but then it just repeats and doesn't really work. I'm rubbish at scripting, but here's what I've got so far (that doesn't work).


[center]
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 10th Jun 2010 00:05

to


There should ONLY be two colons per line. The first one appears before the conditions of the line and the second one appears before the actions of the line. No more, no less.

I also changed "timer" to "etimer", which has more consistent results. "timer" is the global timer and if used in more than one script, can mess up very easily.


Try that out and let us know how it goes.


The one and only,


TGPEG
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location: Bristol, United Kingdom
Posted: 10th Jun 2010 21:36
It didn't go well. When walking, it shows the first frame or so of the animation repeatedly, both for forward/backwards walking and sidesteps. The animation doesn't play, but the plrfreeze does work and it does go for 4600 (the animation's 46 frames long). The camera fov changes after the player is unfrozen but goes straight back to normal again. The legs animations DO work when the player is frozen and if the player is unfrozen again when the body is not at the first frame, that frame and the one after it flicker until the player stops moving and it resets to normal again.

Think that's about everything. I'll keep fiddling with it.

[center]
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 11th Jun 2010 00:52
Remember, that you have the last line of the script doing ALL of the animations. So, for you to say "animate=92" near the top, it will almost immediately be over-ridden by the animate=%Anim at the bottom.

You can counter this by setting "Anim" to 92 instead of attempting to animate right there.

So change:

to:


That will keep things orderly and should have it show the proper animation.

Also, the animations being played are being set in the movement area of the script. Perhaps add a condition onto those, so that they won't be set (or played) if the player is currently forzen.

Hope that helps.


The one and only,


Login to post a reply

Server time is: 2024-11-24 23:18:01
Your offset time is: 2024-11-24 23:18:01