Adding sounds to scripts

Status
Not open for further replies.

Jacobthebus

Weeeeeeeeeee
Mar 7, 2016
1,047
@Lowlander21 @AD156 As this is your bus, I think you may be able to help. I want to add a sounds for when the Wayfarer TGX goes into standby mode on the Lothian variant of the B9TL. Could you possibly help? I thought that it would be a simple matter of scripting in a sound file to a script but that seems not to be the case. Any help would be appreciated! :)  


Thanks in advance,


-Jacobthebus
 

Road-hog123

An Orange Bus
Administrator
UKDT
Dec 10, 2015
1,784
Firstly you're going to want to look in the sound config file (Sound/sound_D92_zf.cfg for the B7L) and add a section like the following to it (the bottom is probably fine), filling in the lines with the correct information:


[sound]
TGX_standby.wav
1

[3d]
x
y
z coordinates of where the sound source is
distance fading (I assume to 0 or half volume)?

[trigger]
soundTriggerVariable


Now, to actually trigger the sound to play you need to have (T.L.soundTriggerVariable)at the point that the ticket machine goes into standby. If standby isn't already implemented, you'll have to add a timing variable, each frame add Timegap to it, reset it to 0 whenever a button is pressed and trigger the sound when the time goes over a limit (remembering to have some sort of anti-repeat).


Hopefully this helps. :)
 

Jacobthebus

Weeeeeeeeeee
Mar 7, 2016
1,047
Firstly you're going to want to look in the sound config file (Sound/sound_D92_zf.cfg for the B7L) and add a section like the following to it (the bottom is probably fine), filling in the lines with the correct information:



[sound]
TGX_standby.wav
1

[3d]
x
y
z coordinates of where the sound source is
distance fading (I assume to 0 or half volume)?

[trigger]
soundTriggerVariable


Now, to actually trigger the sound to play you need to have (T.L.soundTriggerVariable)at the point that the ticket machine goes into standby. If standby isn't already implemented, you'll have to add a timing variable, each frame add Timegap to it, reset it to 0 whenever a button is pressed and trigger the sound when the time goes over a limit (remembering to have some sort of anti-repeat).


Hopefully this helps. :)
Thanks there, I'll give it a try when I next get a chance :)
 
Status
Not open for further replies.