Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 1.28 KB

File metadata and controls

20 lines (16 loc) · 1.28 KB

How to use this API

custom-events.json

Place this file in the root folder of your mod. It must contain a list of custom/modded events. Each event must have the following fields:

  • source: the lua file containing code for your event
  • type: must be either "modded" or "vanilla-compatible"

Each event may also have the following fields:

  • icon: default icon to use, if editorDraw is not defined
  • palette: list of folder names, defines where to place the event in the editor event palette

Modded events (type="modded")

Modded events work exactly the same as vanilla events, but with your custom code. Look in game code for examples on how to make these.

Custom events (type="vanilla-compatible")

These events basically act as tags, but with their contents generated by code, with configurable properties. The lua file describing this event is very similar to vanilla events, but must return info, editorDraw, editorProperties, checkActiveRange, convertToVanilla. Note that onLoad, onBeat and onOffset are missing, instead, there is a convertToVanilla function, which takes the event as an argument and returns a list of vanilla events. The API handles saving and loading these events to and from files, so you only need to implement the convertToVanilla function.