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: difference between a "load_sound()" and "sound().load_sound()"  (Read 3155 times)

hhrhhr

  • Member
  • **
  • Posts: 60

What's the difference between a load_sound() and sound().load_sound()? apart from the fact that the first one can only be called from the init_chassis()?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: difference between a "load_sound()" and "sound().load_sound()"
« Reply #1 on: June 23, 2013, 01:54:50 am »

load_sound() is a shortcut, but it's also used to optimize the loading internally since it's used only once in the chassis definition.
Logged

hhrhhr

  • Member
  • **
  • Posts: 60
Re: difference between a "load_sound()" and "sound().load_sound()"
« Reply #2 on: June 23, 2013, 03:11:12 am »

and yet, how to make proper loading of sounds, from init_chassis() or init_vehicle()? how many times is called these functions if spawn more of the same vehicles?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: difference between a "load_sound()" and "sound().load_sound()"
« Reply #3 on: June 23, 2013, 04:10:53 am »

init_chassis is called only once, initially, and it's meant for the definition of the vehicle structure. Sound emitters and samples should be defined here as well.
init_vehicle is called for every new vehicle, in case something needs to be done per each instance, but it shouldn't be used much now.

Logged