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 / Breakable Objects with Custom sounds

Author
Message
MaimedSoldier
14
Years of Service
User Offline
Joined: 2nd Nov 2010
Location: In The Matrix
Posted: 10th Dec 2010 04:42
I have another noobish question. I am trying to add sounds to objects so when u break them it plays. I set sound 1 and 0 as the same sound. When I went to break it, it didnt play the sound but just broke. Why? and how do I properly get sounds added when u destroy objects?

War Doesn't Make boys men, it makes men dead.
The Storyteller 01
16
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 10th Dec 2010 15:31
Any sounds except for "material sounds" (footsteps and collision afair) are triggered by the scripts.

This is the destroy script for the stock window:

;Artificial Intelligence Script

;Header

desc = Window Destroy

;Triggers

:state=1:destroy
:state=0:sound=audiobank\smash\glass.wav,rundecal=1,shapedecal,state=1

;End of Script


So you simply have to give the destroyable object a custom destroy script (I named my custom ones destroyglass, destroywood, destroyfire etc.) which includes the path to the soundfile.

In case you find my grammar and spelling weird ---> native German speaker ^^
MaimedSoldier
14
Years of Service
User Offline
Joined: 2nd Nov 2010
Location: In The Matrix
Posted: 10th Dec 2010 16:42
do I put the name of the file replacing the glass.wav?

and where does this script go?

War Doesn't Make boys men, it makes men dead.
The Storyteller 01
16
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 10th Dec 2010 20:26 Edited at: 10th Dec 2010 20:27
Sorry for being blunt but after that question it seems to me, you are a little ahead of your time.

I heartily recommend to start out getting the community guide for FPSC (download link in this thread):
http://forum.thegamecreators.com/?m=forum_view&t=131868&b=21
Its the best tool to learn scripting.

At least in my case it worked

In case you find my grammar and spelling weird ---> native German speaker ^^
MaimedSoldier
14
Years of Service
User Offline
Joined: 2nd Nov 2010
Location: In The Matrix
Posted: 10th Dec 2010 23:28
thanks for the help but My PC wont read PDf documents. So is there another way to find out how to do this?

War Doesn't Make boys men, it makes men dead.
The Storyteller 01
16
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 11th Dec 2010 00:07
Afair there is also an online read for the CG.

But the best is to download the file, put it on a usb stick and give it to someone for printing it out ( I am lucky to have a friend who does stuff like this for me in his office )

In case you find my grammar and spelling weird ---> native German speaker ^^
Seth Black
FPSC Reloaded TGC Backer
20
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 11th Dec 2010 00:35 Edited at: 11th Dec 2010 00:41
Quote: "do I put the name of the file replacing the glass.wav?"


...yep. Using the script provided above:

:state=0:sound=audiobank\[ANY FOLDER OF YOUR CHOOSING]\[YOUR SOUND
FILE HERE]
,rundecal=1,shapedecal,state=1


Quote: "and where does this script go?"


...typically, generic destroy scripts are placed simply into the scriptbank folder,
located The Game Creators/FPS Creator/files/scriptbank.

Your destroy script above could be placed into the
destroy folder, located The Game Creators/FPS Creator/files/scriptbank/destroy.

In actuality, you can place it into The Game Creators/FPS Creator/files/scriptbank/
[ANY FOLDER NAME YOU WISH]
, and it will function just fine.

The best way to apply your custom script to your entity is to open the entity's
.fpe file, and choose one of the following options to assign your script to the entity:

aidestroy = [NAME OF YOUR CUSTOM SCRIPT HERE]

or

aidestroy = destroy\[NAME OF YOUR CUSTOM SCRIPT HERE]

or

aidestroy = [NAME OF YOUR FOLDER\[NAME OF YOUR CUSTOM SCRIPT
HERE]


Login to post a reply

Server time is: 2025-06-04 21:04:51
Your offset time is: 2025-06-04 21:04:51