Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: hhrhhr on June 23, 2013, 12:16:32 am

Title: difference between a "load_sound()" and "sound().load_sound()"
Post by: hhrhhr on June 23, 2013, 12:16:32 am
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()?
Title: Re: difference between a "load_sound()" and "sound().load_sound()"
Post by: cameni 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.
Title: Re: difference between a "load_sound()" and "sound().load_sound()"
Post by: hhrhhr 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?
Title: Re: difference between a "load_sound()" and "sound().load_sound()"
Post by: cameni 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.