.mp3 can be used but it's not recommended please use .ogg or .wav
You give this function your modID and it'll search and load every sound in the assets/sounds
folder next to your .lua file.
The name of every sound file will be the sound_code (without the extension) so for example TEST.ogg its sound_code is TEST (it's case sensitive)
This is the main player of custom_sound everytime something plays a custom sound it calls this function.
Arguments :
- sound_code : the sound_code from the sound file you wanna play
- stop_previous_instace : set to false by default, if you wanna play a sound and it's already playing should we stop it to play the new one ?
- volume : set to 1 by default
- pitch : set to 1 by default
This functions directly interacts with the base game and stops the desired sound_code from the base game
Arguments :
- sound_code : the sound_code you wanna stop (it can be a single string or a table of strings)
Same as register_stop_sound but will only trigger the desired number of time Arguments :
- sound_code : the sound_code you wanna stop (it can be a single string or a table of strings)
- number_repeat : the number of time we should keep it to stop sounds
This function also directly interacts with the base game but instead of completely stopping the sound from the base game, it stops it and plays a desired one instead
replace_code_table:
Structure of replace_code_table:
{base_sound_code = "custom_sound_code"}
if you don't want to customize the playing sound volume, pitch, etc
otherwise if you want to customize :
{base_sound_code = {sound_code ="custom_sound_code",volume = X}}
with each arguments can be an argument of Custom_Play_Sound(sound_code,stop_previous_instance, volume, pitch)
Plus continue_base_sound that can be set to true to still play the base sound_code after playing the custom one
A full one will look like this :
{
base_sound_code =
{
sound_code ="custom_sound_code",
stop_previous_instance = bool,
volume = X,
pitch=X,
continue_base_sound=bool
}
}
Same as register_replace_sound_played but will only trigger the desired number of time Arguments :
- replace_code_table : same as register_replace_sound_played
- number_repeat : the number of time we should keep it to replace sounds
play_sound is from the base game, it's modified non destructively to be able to do manipulation on it with Add_Custom_Stop_Sound or Add_Custom_Replace_Sound
modulate_sound is from the base game it is what handles the music being played, it's modified non destructively to be able to do manipulation on it with Add_Custom_Stop_Sound or Add_Custom_Replace_Sound