Community Forum

Sound samples playing at startup

Forum Overview >> Editor

CategoryEditor
Created17.06.2015 14:15


James Biddulph (Unknown) 17.06.2015 14:20
Is there a way to stop sound samples playing as the game loads, I have created a train and track on my map and have added sound effects to the train, but when the game starts the sound samples are played at very high volume, is there a way to stop this.

I thought at first that the game was playing the first sample in the scenegraph, so I created a silent sound sample and placed this at the top of the scenegraph but it still plays my train sample, this is not a real problem for the map but it sure as hell will scare the pants off anyone loading the map for the first time.

If there is a solution please share it with us.

Thank You in advance.

Emil Drefers (Unknown) 17.06.2015 15:39
Hi,

how did you add the sound sample to the train?


Cheers,
Emil

James Biddulph (Unknown) 17.06.2015 21:54
As a mono wav file using the model as a parent using the create audio source, like this

- passengerTrainAnimated (a transform)
- trainActive (a transform)
- engine_front (a transform)
engineSpline
-train (a transform)
virginTrain (the mesh
trainPassByHighSpeed (the sample)
The 'passengerTrainAnimated' transform is the main tranform that holds all the meshes in individual tranforms and has no user attributes.
The trainActive does the same thing, cannot see why I put it in another transform but it should not make a difference, this also has no user attributes.
the train_front transform holds the main engine mesh, the spline and the sound sample the train transorm is held in this too. The engine_front transform has the user atrributes in them i.e numShips, Ship.onCreate and speed.
there are 2 meshes for the engine front and back and also 4 meshes for the carriages all have their own sound file.

Hope this is clear if not ask again please.

Emil Drefers (Unknown) 18.06.2015 08:02
Hi,

the script for the ship is fairly easy: http://ls-mods.de/scriptDocumentation.php?lua_file=objects/Ship

So you could rewrite the script to support an audio file correctly.

Well, honestly speaking I'm not completly sure why you hear the sound file at the start of the game.
By the way, does start mean "during loading" or "after you've clicked on start"?

I could imagine that it is caused by a "bad location" of the spline's starting point. Is it close to the player's starting point?

Maybe the attributes for the sound source are not correctly set?

Cheers,
Emil


James Biddulph (Unknown) 18.06.2015 10:59
will take a look at the script for it.

The sound is played as the game is loaded into memory by that I mean after the game engine has loaded the last of the log entries and about 5 seconds before the "START" appears.

It does not matter where the careerStartPoint is placed the sound always plays.

As for the sound source attributes are concerned they are below....

Range = 100
Inner Range = 30
Volume = 1
loop = Activated
Frequency = 44100
Duration = 8092.154

I will continue to try and find the possible cause for this at my end and if I find a 'workthrough' I will post it here, meanwhile if you find anything please let me know.

James Biddulph (Unknown) 22.06.2015 09:55
As promised here is the SIMPLE workaround I found to this problem.......

I had all my train models at 0.0.0 (after being advised that this is where they should go) but I did not realize that the player is sent to 0.0.0 just before the game starts and is then placed in the game start position after the start button is pressed, this is why the sample was playing. So I just moved all the models ( the whole transform group along with sound files) way down in the Z axis and this solved the problem.

A little piece of advise for any would be mappers out there ..... DO NOT PUT SOUNDS IN THE 0.0.0 POSITION UNDER ANY CIRCUMSTANCE.

Sorry Emil I should have stated that the sounds were at the 0.0.0 position and you would surely have had the answer.

Hope this helps someone in the future.


Note: Log in to post. Create a new account here.