Sound in passanger car

thom58

Member
I made repaint passenger car and want to put the music file in the car. I need some suggestions what I must add to soundscript ...

soundscript {
door_open {
trigger "door_open"
nostartdelay 1
repeat-delay 1
distance 20,200
sound {
a_body / open.wav
}
}
door_close {
trigger "door_close"
nostartdelay 1
repeat-delay 1
distance 20,200
sound {
a_body/slamdoor1.wav
}
}
}

*****************
I'm add this but don't work (can not hear music) ...

daysingle {
value-range 1,0.1
repeat-delay 0
distance 10,400
sound {
name music file.wav
}

This is repaint ...
Screen_149_zpsb37e55ac.jpg


Screen_150_zpse35eed5b.jpg
 
Firstly, have you converted your music file with right parameters?

Secondly.
For starters, use simple code, make it work, then start to complicate. :)
This code will play and loop your "music.wav" indefinitely:

Code:
soundscript
{
  dayloop
  {
    repeat-delay                        60,0
    distance                            50,100
    
    sound
    {
      0                                 "music.wav"
    }
  }
}
When you enable sound in your car, and confirm it works, you can start tweaking code.
For description of "soundscript" parameters see from page #395 of TRS2006 Content Creation Guide and/or relevant Wiki Trainz page.

For instance, you can add multiple music files, which will be played at random, example:

Code:
0                                 "music.wav"

1                                 "music1.wav"

2                                 "music2.wav"
 
I solved the problem, this need to type


soundscript {
daysingle {
repeat-delay 1
distance 20,80
volume 0.9
sound {
music_file_name.wav
}
}
}

... and car will sing a song :hehe:
 
Back
Top