Latest Posts

Topic: How to use play_sound?

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2548
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: Today 18:00

I am trying to use the play_sound function in a scenario, but somehow this does not work for me. I get always failures similar to:

FATAL EXCEPTION: [:0] FXset: No files matching the pattern 'thunderstorm_<numbers>.ogg' found in directory scripting/sounds/

The soundfile "thunderstorm_00.ogg" is stored in scripting/sounds below the map folder. The documentation for playsound says it should be stored below the data/ folder, but this isn't available for map/scenario authors.

Regardless which pattern i use the file can not be found. The following i have tried:

play_sound("scripting/sounds/thunderstorm_00.ogg")
play_sound("scripting/sounds/thunderstorm")            -- According to documentation this should work?
play_sound("map:scripting/sounds/thunderstorm_00.ogg")
play_sound("map:scripting/sounds/thunderstorm")

Which mistake i do?
How can play_sound be used for scenarios?


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2736
Ranking
One Elder of Players
Location: Bavaria
Posted at: Today 20:51

I had a similar issue once before when trying to add images to scenariospecific units.
you have to specify the complete path of the scenario relative to the data folder

play_sound("campaigns/emp04.wmf/scripting/sounds/thunderstorm" or

play_sound("maps/my_scenario.wmf/sounds/thunderstorm"


Top Quote