[BNW] Is there a way to trigger additional SFX using lua?

lordplane

Chieftain
Joined
Jul 8, 2016
Messages
22
I know you can straight up replace existing sounds using VFS but is there a way to trigger SFXs using lua? E.g. when building a specific building to trigger a sound (like a wonder's quote but without the wonder splash screen).
 
I know you can straight up replace existing sounds using VFS but is there a way to trigger SFXs using lua? E.g. when building a specific building to trigger a sound (like a wonder's quote but without the wonder splash screen).
Yes there is!
Code:
Events.AudioPlay2DSound("AS2D_INTERFACE_ANCIENT_RUINS");
will play the Ancient Ruins discovered sound. (Note that the game window must be focused otherwise it will not play; i.e. triggering this method inside FireTuner won't work)
 
Yes there is!
Code:
Events.AudioPlay2DSound("AS2D_INTERFACE_ANCIENT_RUINS");
will play the Ancient Ruins discovered sound. (Note that the game window must be focused otherwise it will not play; i.e. triggering this method inside FireTuner won't work)
Ah thank you! I didn't find it through the modding wiki so I thought it would be better to ask here, thanks again!
 
Ah thank you! I didn't find it through the modding wiki so I thought it would be better to ask here, thanks again!
The modding wiki is incomplete and/or outdated in quite a few forms. Even though for most uses it functions good enough, if you need some obscure function it's better to search in the game's files itself (using a tool such as Agent Ransack). Moreover, for an updated overview of Lua methods you can use the BNW API Reference linked here. (of which I finally re-found the thread).
 
Top Bottom