可以在mod中自定义programmable-speaker
的instruments
实现添加音效。对音乐格式应该是有一定要求的,反正我试了下最高码率的WAV异星工厂是播放不了的。
local speaker = data.raw["programmable-speaker"]["programmable-speaker"]
speaker.instruments[#speaker.instruments+1] = {
name = "Other",
notes = {
{name = "FSSMSL", sound = {filename = "__EnhancedSpeaker__/sound/FSSMSL.wav"}},
{name = "NGGYU", sound = {filename = "__EnhancedSpeaker__/sound/NGGYU.ogg"}},
}
}
效果如图所示,为程控扬声器添加循环播放 “发生什么事了?发生什么事了?发生什么事了?”的选项