Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Event Script

skellypupper edited this page Jun 25, 2023 · 6 revisions
Empty Script

Example events can be found here.

function init() {
    name = "My Cool Event";
    description = "A cool description for this cool event";
}

function createPost() {}
function preload(value1:String, value2:String) {}
function callback(value1:String, value2:String) {}

How to Use

Global events can be made at events/<coolname>.hxs.

Song exclusive events can be made at songs/<songnamehere>/events/<coolname>.hxs.

Events are loaded in the following order:

  1. Song Events (songs/*/events)
  2. Mod Events (mods/*/events) (if applicable)
  3. Asset Events (assets/events)

If you have two events with the same init name, the first one to load will be used.

If your event loads properly, you'll see it under the events tab in the charting state.

image

Variables

Only available inside init callback

  • name: A string representing your event's display name, if unset your event will not load.
  • description: A string representing a description of your event for the charting state. Will appear as N/A if unset.

Available outside init callback

  • game: The active playstate instance.
  • Paths: The global paths instance.

Callbacks

Required

  • init(): Used to get a name and description for the event.

Optional

  • createPost(): Called shortly after the event script is loaded, if your event comes with sprites or anything of the like, you can load them here.
  • preload(value1:String, value2:String): Called each time the event appears in the chart.
  • callback(value1:String, value2:String): Called when the event is invoked.