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.

FPS Creator X10 / How can i make my HUD emit sounds?

Author
Message
animation help
13
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 20th Nov 2011 20:59
(wasnt sure where to post this) I'm not sure if this is possible, but im wondering how i would be able to make my HUD emit a sound. I want to add this fast heart rate sound effect when the players health is lower than 60. But I'm not entirely sure how to do that. does any one mind giving me a little help? It may not be much but i will give you credit in my game if you help. TY 4 reading this!


-Deadwalking12345

*AAGH, HOW HARD IS IT TO FIND A DAMN CUSTOM ANIMATION!?!?*
animation help
13
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 20th Nov 2011 23:23
hmm, idk why my name is "animation help" what ever :p

Troll Science = Hilarious possibility's
srealist
13
Years of Service
User Offline
Joined: 18th Dec 2010
Location: Orlando, Florida, USA
Posted: 21st Nov 2011 05:01
You could put it in the script for HUD but that's not necessary.

Here's how I would do it.

1) Open notepad and type in the follow
:state=0,plrhealthless=60:loopsound=$0

2)Save it in the script folder as "plrhealthless_loopsound.fpi" or whatever is meaningful to you.

3) Place a trigger zone in your scene. Note: don't worry about the size of the zone, it does not matter; your script will be active across the whole level.

4) Right click on the trigger zone and change its main script to the script you made above. Change Sound0 in the trigger zone's properties to the sound you want to use.

And you are done.

Also, if you don't want the sound to loop, just use sound=$0.

If this doesn't work for some reason, change the script to point directly to the file you want to play rather than using the "$0" value. But this shouldn't be an issue.

You can email me if you have any problems. I'm quicker to respond to email.
srealist
13
Years of Service
User Offline
Joined: 18th Dec 2010
Location: Orlando, Florida, USA
Posted: 21st Nov 2011 06:40
Just one side note I was thinking about. You should place the trigger zone close to the user start point. Even tho, this should have no effect, I have noticed that on some occasions, FPSC will not load a script that is embedded in an entity or trigger zone when it is far away from the player.

Whenever I have global scripts that effect the game play, I make a habit of arranging the trigger zones around the player start point. It's a good habit anyway.
Squalker
16
Years of Service
User Offline
Joined: 22nd Apr 2008
Location: Canada
Posted: 21st Nov 2011 12:45 Edited at: 21st Nov 2011 13:24
Quote: "You could put it in the script for HUD but that's not necessary.

Here's how I would do it.

1) Open notepad and type in the follow
:state=0,plrhealthless=60:loopsound=$0

2)Save it in the script folder as "plrhealthless_loopsound.fpi" or whatever is meaningful to you.

3) Place a trigger zone in your scene. Note: don't worry about the size of the zone, it does not matter; your script will be active across the whole level.

4) Right click on the trigger zone and change its main script to the script you made above. Change Sound0 in the trigger zone's properties to the sound you want to use.
"


There is an alternate method that will save you needing a trigger zone and just make it a permanent throughout the game..

First add the following to state=0 section of your levelsetup.fpi file


(make sure you have a hud image or icon for called lowhealth.png in the gamecore\huds folder of the FPDC X10 root folder
Also you will have to adjust the hudx and hudy numbers to make hud image line up on the screen where you want it to.)

And then add the following to the state=1 section of your levelsetup.fpi file


(make sure you added a custom folder to the audiobank folder in your Fpsc X10 root directory and place your sound file in it.)

that will save you having to add a trigger zone to every level and give you the desired hud and sound effect you are looking for.

the levelsetup.fpi file can be found at..


(OPEN it with notepad)

hope this helps

-Squalker
srealist
13
Years of Service
User Offline
Joined: 18th Dec 2010
Location: Orlando, Florida, USA
Posted: 21st Nov 2011 16:34
Good call. Most all of my games are one level so I don't think as much about those things.
animation help
13
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 21st Nov 2011 22:25
THX GUYS 4 HELPING, ALL UR ANSWERS ARE AWESOME! (both of you will get credit in my game/level) ALL OF U R AWESOME!

Troll Science = Hilarious possibility's

Login to post a reply

Server time is: 2024-11-21 12:35:40
Your offset time is: 2024-11-21 12:35:40