It seems that the override_sound_type property has no effect at all. If you set it to a garbage value (not a member of the SoundType union), the game halts with a script error, detecting the illegal value. But otherwise, the sounds produced are always of the type specified in the sound prototype ("game-effect" by default).
To reproduce, set all of your volume sliders except Master and Game effects to zero, turn on the recently played sound info F4 debug setting, and try the following:
Code: Select all
/c game.player.surface.play_sound{path="utility/build_small",position=game.player.position,override_sound_type="game-effect"}
/c game.player.surface.play_sound{path="utility/build_small",position=game.player.position,override_sound_type="environment"}
/c game.player.surface.play_sound{path="utility/build_small",position=game.player.position,override_sound_type="alert"}
Edited to add, this seems to be the case for both LuaSurface.play_sound() and LuaPlayer.play_sound(), and for sounds of both types utility-sounds and sound.