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 / How can i spawn a Sound Zone with a Trigger Zone?

Author
Message
maxi360
10
Years of Service
User Offline
Joined: 26th Mar 2012
Location: Home
Posted: 10th Feb 2015 18:40
Title say everything.

My idea: making a horror game so i put some entity into my game like: piano, clock, phone etc. And when the player walk near them nothing happens but after he wondering around and walk into a trigger zone which activate for example the piano's sound zone and next time when he walk near the piano a scary sound played once.

I only need the code (begging is rude right?) so if you dont give me code just point my head where am i need to look, what am i need to do to get this work. Thanks!

Maxi.

I don't buy games....i make them.
ncmako
10
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Feb 2015 21:12
maxi360
Quote: " walk into a trigger zone which activate"

ok, then use the "plrinzoneactivateused.fpi" and set the "ifused"
field to the SAME NAME as the script to play the sound.(use unique
names) Then for the script to play the sound use something like...

Use something like that in a trigger and place near/over your objects where the player is to walk.
best

My games never have bugs. They just develop random features..
maxi360
10
Years of Service
User Offline
Joined: 26th Mar 2012
Location: Home
Posted: 15th Feb 2015 14:27
so there is no way to set sound zone "hidden"? like with entities spawn at start yes/no.

btw i made a quick map to test a simple T shape. i set the player start to the bottom of the T. the left side the sound zone and the right side the trigger zone.

i renamed the sound zone to s1 and set its main script to:

am i need to set any sound in the sounds zone properties?

with the trigger zone i set the main script to plrinzoneactivatedused.fpi then wrote s1 to "if used" block.

Test: when i walk first to my sound zone nothing happens, neither if i walk to my trigger first.

I don't buy games....i make them.
ncmako
10
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 15th Feb 2015 16:17 Edited at: 15th Feb 2015 16:20
maxi360
Stick with "sound=" not "plrsound="

ok, if your using a "soundzone" try replacing "plrdistwithin"
with "plrwithinzone"

I didn't think it thru before, but if you do use the "plrdistwithin" condition one would attach that script to a
dynamic entity/object.(not using a trigger or soundzone)
But you would still use the first trigger to "activate" this script.
I'm using V1.20_1.14 works just fine.
best

My games never have bugs. They just develop random features..
maxi360
10
Years of Service
User Offline
Joined: 26th Mar 2012
Location: Home
Posted: 15th Feb 2015 17:49
You are awesome sir! Working like a charm.

im really dumb for scripting in any programing language. as far as i know fpsc use its unique program language but it's still hard to understand for me. Do you have any tips where can i learn more about how to make scripts in fpsc x9? its really akward for me every time i need something i begging from the community. also its not allowed tho..

I don't buy games....i make them.
BlackFox
FPSC Master
14
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 16th Feb 2015 08:18
Quote: "Do you have any tips where can i learn more about how to make scripts in fpsc x9?"


Here are a few links...

Official Community Guide- these two PDF's contain various script info/examples as well as other tips and techniques.

General Script Information- a thread I have been working on to put the script knowledge into one location.

Complete Script Syntax- a PDF containing script commands.

Quote: "its really akward for me every time i need something i begging from the community. also its not allowed tho."


Actually, there is no issue with needing something. The general concept is if you have made an attempt and are stuck, then show what you do have and those of us using classic and lurking can help out. We want to attempt to maintain the idea of "teaching"... you know the old saying- "give a man a fish, he eats for a day; teach him to fish, he eats for a lifetime".

There's no problem that can't be solved without applying a little scripting.

Login to post a reply

Server time is: 2022-09-29 11:41:07
Your offset time is: 2022-09-29 11:41:07