RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.01k stars 178 forks source link

Angelscript audio bindings #3027

Closed ohlidalp closed 1 year ago

ohlidalp commented 1 year ago

The screenshot shows updated demo script bundled with the game. To run it, open console and say loadscript demo_script.as. obrazek

New objects: SoundClass, SoundScriptTemplateClass, SoundScriptInstanceClass New enums: SoundTrigger, ModulationSource

The principal interface is in the GameScriptClass (global object game):

array<SoundScriptTemplateClass@>@ getAllSoundScriptTemplates()
SoundScriptTemplateClassPtr@ getSoundScriptTemplate(const string &in)
array<SoundScriptInstanceClass@>@ getAllSoundScriptInstances()
SoundClassPtr@ createSoundFromResource(const string &in filename, const string &in rg_name = string())
SoundScriptInstanceClassPtr@ createSoundScriptInstance(const string &in template, int actor_instance_id = -1)
ohlidalp commented 1 year ago

I added a "sound follows player" checkbox to the 'demo_script.as' - you can use it to "pin" the sound to one place and run around to enjoy the spatial effect. obrazek