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 Product Chat / does making a sound zone follow an entity possible?

Author
Message
Killj0y17
13
Years of Service
User Offline
Joined: 15th Sep 2012
Location: In a pineapple, under the sea
Posted: 1st Oct 2012 14:20
I want to create a scary sound effect for when the players sees an enemy, question is, is it possible to make a sound zone follow an enemy?
or if not, how can I do the effect? (sudden sound when seeing an enemy)

maho76
15
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 1st Oct 2012 15:46
you have to change the mainscript of the entity, adding

:state=x,inview=1:sound=x,state=x+1

or, if you want to set sound "in the head of the player", using plrsound=x instead of sound.

Killj0y17
13
Years of Service
User Offline
Joined: 15th Sep 2012
Location: In a pineapple, under the sea
Posted: 2nd Oct 2012 12:56
tnx I will try it... I'll edit this if it works..

Killj0y17
13
Years of Service
User Offline
Joined: 15th Sep 2012
Location: In a pineapple, under the sea
Posted: 2nd Oct 2012 13:00
umm what do I put in the x's?

yohan12
17
Years of Service
User Offline
Joined: 8th Mar 2009
Location: Chilliwack, Canada
Posted: 3rd Oct 2012 08:34
Quote: "umm what do I put in the x's?"

Numbers, X is a variable

maho76
15
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 4th Oct 2012 10:33 Edited at: 4th Oct 2012 10:35
Quote: ":state=x,inview=1:sound=x,state=x+1"


sorry for missing explanation, i thought you know something about scripting. if not, this is not that easy to explain. in order to not get the sound played over and over all the time (would be a constant tune-wobble because fpsc would start playing it every second), you have to rewrite your mainscript so that this line is included into every "main-step-state", means every state that is called when player/entity-situation changes.

for example: you have a script as pace10.fpi, you can cut it into different pieces: basic behavior, player in range, attack, defense. something like that. you have to implement the line i posted into every state starting one of these pieces.

:state=x,inview=1: x depends on the state that is called when the sound should start.

sound=x is the soundpath to what you want to play, located in audiobank (x= audiobank/user/.../sample.wav)

state=x+1 is the state that originally follows so the script can move on.

easiest would be if you can post the mainscript you want to use so we can look where to do changes and how. if you dont want to, you can send me a mail and i may look how to do, even if i am not the king-scripter, i think its not that hard.

Killj0y17
13
Years of Service
User Offline
Joined: 15th Sep 2012
Location: In a pineapple, under the sea
Posted: 4th Oct 2012 13:07
Quote: " if you can post the mainscript you want to use so we can look where to do changes and how. "

this is the mainscript of the "Chained Soul" in the dungeon pack.


now how do I add the sound effect? thanks for the help by the way.

Login to post a reply

Server time is: 2026-07-02 19:20:44
Your offset time is: 2026-07-02 19:20:44