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 / Little more help on Player Legs sounds

Author
Message
TGPEG
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location: Bristol, United Kingdom
Posted: 16th Jun 2010 19:29 Edited at: 16th Jun 2010 19:31
I've given up trying to add animations, but I have a robot character that I'd like to give servo sounds to. So far I've got it working for crawling leg movements, but for reasons unbeknownst to me, walking/running/strafing sounds do not work at all.

Here's my modified script so far:



Interestingly, I found out that if I press say W and S at the same time, the sound repeats itself (even when the player isn't moving) until you press either W or S again, and the same with A and D. Can anyone point out what I'm doing wrong because for the life of me I can't see it...

EDIT: And also having moved the 'loopsound' actions to the bit where the variables are calculated means that nothing happens at all. Shifting them around to a different place in the actions string does nothing either.

[center]
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Jun 2010 08:34
If you press "W", then "keypressed=17 1" is TRUE..... but at the same time, you're NOT pressing "S", so "keypressed=31 0" is ALSO true, and will immediately stop the sound.

That looks to be your problem at first glance.


The one and only,


TGPEG
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location: Bristol, United Kingdom
Posted: 18th Jun 2010 19:33
Well, that makes sense.

I can't think of a way to stop the sounds without adding extra states, and I discovered with the animation thing that that is liable to mess the whole thing up...

[center]
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 19th Jun 2010 01:53
Instead of placing your sounds inline with everything else, why not have the sounds handled on their own at the end of the script?



Stop the sound when none of the keys are being pressed. So if ONE of them is being pressed, the sound may continue to loop.


The one and only,


TGPEG
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location: Bristol, United Kingdom
Posted: 19th Jun 2010 02:56
Aha! It lives!
Thanks very much.

[center]
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 20th Jun 2010 03:20
You're very welcome.


The one and only,


Login to post a reply

Server time is: 2024-11-24 21:21:21
Your offset time is: 2024-11-24 21:21:21