Jump to content

Dedicated component to push event music

Recommended Posts

Unique music is triggered by periodic tasks from their sources. That system could use some improvements. My suggestion is to dedicate a specialized component for this purpose.

This is my mockup. Note that prefabs were taken from v463347.

For example, the Bee Queen's event is reduced to merely a line of code:

--Dedicated server does not need to trigger music
if not TheNet:IsDedicated() then
	MakeEventTriggerer(inst, "beequeen", true, "flight", 20, 40, 50)


  • Unified structure across the board
  • More consistent than periodic tasks
  • Easier to access or edit

You can enable the mod and see that music plays just like before, but internally it's cleaner – here's before and after:




Tips for testing:

  • GetDebugString is included in the component 
  • "dummytarget" prefab has an example event

More examples with the new component, notice the debug string:






Any thoughts?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...