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 Song Script

Author
Message
kaixboi
14
Years of Service
User Offline
Joined: 9th Aug 2010
Location: UK
Posted: 1st Feb 2011 00:03
Hello all,


As most of you will probably know, in the popular "Nazi Zombies" games there are easter eggs where you hold a button and a song will play. I wanted t do something like this.

This was my attempt





The only problem is, it only plays the song when I keep m held down. I wanted it to continue playing after only pressing m once, if that makes sense. Could someone perhaps explain where i'm going wrong, or correct the script?


Thanks in advance

Nazi Zombies = RULES!
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 1st Feb 2011 00:15
Put the music= thing in state 2

Srry about my english im from sweeden
kaixboi
14
Years of Service
User Offline
Joined: 9th Aug 2010
Location: UK
Posted: 1st Feb 2011 00:26
Do you mean like this:



Nazi Zombies = RULES!
Bejasc3D
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Down Under
Posted: 1st Feb 2011 02:53 Edited at: 1st Feb 2011 03:07
Yeah, just like that and it should work.
In your original, the condition was if the player was pressing M (which you should change to 50) and the action was then to play the music.
So only if M was being pressed, it would play the music.
Also, in your revised script above, you had the music as a condition. for it to play you would need an action instead.

;Artificial intelligence script

;Header

desc = player uses code to play a song

;Triggers

:state=0,plrdistwithin=50:state=1
:state=1,scancodekeypressed=50:state=2
:state=2:music=audiobank\song0.wav,musicvolume=100,state=0


;End of script

I havent tested it yet, and I am nothing of a scripter, but that should solve the problem.

EDIT:
I am loading a testgame now, to see if it will work, but by looking at it, I realized at the end of state 2, it goes straight back to state 1. That could also be a problem there, but I am not sure until I try it myself.

EDIT 2:
Yeah, change it to this, and apply the script to any DNYAMIC entity. Or light if you want to get real tricky. Its also a good idea to keep the music in the music folder of the audiobank.

kaixboi
14
Years of Service
User Offline
Joined: 9th Aug 2010
Location: UK
Posted: 1st Feb 2011 21:30
aah thank you.

Nazi Zombies = RULES!

Login to post a reply

Server time is: 2025-06-06 10:21:21
Your offset time is: 2025-06-06 10:21:21