• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Sonik-hedgehog

Corporal
15 Badges
Jan 29, 2011
39
0
  • Cities in Motion
  • Cities in Motion 2
  • Naval War: Arctic Circle
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
Please help me to replace the sounds of the original models in scripts correctly (via directory addons). I understood how to replace the simple characteristics price or fuel consumption. Approximately as follows:
Create a file ***.script and put it into the GS-archive to "addons" directory with these strings:
Code:
// Circs:
$grid = MAIN.$grid;
$level = MAIN.$level;

//Find in game environment "metro-01"
if($grid.getGridObject("metro-01")) {
with ($grid.getGridObject("metro-01")) {

.displayName = "NameIt";
.capacity = 5;
.$price =1000000;
.$fuelConsumption = 0;
.$electricityConsumption = 100;
}
}

For enabling the sound file in original script there is a function:

Code:
with (this.doorOpenSound = new_sound(this)) {
  .load("/metro/sounds/Subway1_door_open.wav");
  .volume = 1.0;
  .minDistance = 50.0;
  .maxDistance = 150.0;
}

How can I change name of the audio file by simply replacing the string in a separate script in a folder? What syntax?

Maybe this is so?

Code:
$grid = MAIN.$grid;
$level = MAIN.$level;

if($grid.getGridObject("metro-01")) {
with ($grid.getGridObject("metro-01")) {
with (this.doorOpenSound = new_sound(this)) {
  .load("/metro/sounds/My_sound_Subway1_door_open.wav");
  .volume = 1.0;
  .minDistance = 50.0;
  .maxDistance = 150.0;
}
}

Doesn't work...

Thank you!