Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: No sound ID.  (Read 10130 times)

Kane98

  • Jr. Member
  • *
  • Posts: 11
  • There's always a reason to smile, regardless.
No sound ID.
« on: June 05, 2023, 11:34:52 pm »

Hello I've been on a wild goose chase with making basic engine sounds work for a mod I'm working on. I can't seem to figure out what I'm doing wrong, and its getting really frustrating... All I'm getting is a No Sound ID error resulting in zero sound from my mod.


Logged
Check out my vehicle development page here! https://forum.outerra.com/index.php?topic=3813.0

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: No sound ID.
« Reply #1 on: June 07, 2023, 02:07:18 am »

Hi
the problem in your script is that your command " return {mass:1842, steering:2.0, steering_ecf:60, centering: 1.6, centering_ecf:20};" you put it before load_sound_command...return command means it exits the init_chassis function before it ever gets to the load_sound commands.
The return command needs to be the LAST command in init_chassis function like so :

Code: [Select]

//invoked only the first time the model is loaded, or upon reload
function init_chassis(){
  ....
    this.add_wheel('UAZ_PU_W_FL',wheelparam);
    this.add_wheel('UAZ_PU_W_FR',wheelparam);
    this.add_wheel('UAZ_PU_W_RR',wheelparam_Rear);
    this.add_wheel('UAZ_PU_W_RL',wheelparam_Rear);

  return {mass:1842, steering:2.0, steering_ecf:60, centering: 1.6, centering_ecf:20};
 
  //sounds
  _starter_sound =  this.load_sound("diesel-engine-start.ogg");
  _engine_sound = =this.load_sound("diesel-engine-idle.ogg");
  _stopping_sound = this.load_sound("diesel-engine-stop.ogg");
  _sound_source = this.add_sound_emitter("UAZ_Engine",1);
 
  this.set_interior_sound_attenuation(0.15);

   return {mass:1842, steering:2.0, steering_ecf:60, centering: 1.6, centering_ecf:20};
}

Logged

Kane98

  • Jr. Member
  • *
  • Posts: 11
  • There's always a reason to smile, regardless.
Re: No sound ID.
« Reply #2 on: June 07, 2023, 09:19:58 pm »

Thanks Fly77, Youre a life saver! Ill be sure to do that in my mods moving forward!
Logged
Check out my vehicle development page here! https://forum.outerra.com/index.php?topic=3813.0