Skip to content

Custom States

Brainy7980 edited this page Jun 22, 2026 · 6 revisions

As of 0.1.0

This engine supports modifying existing states and even making completely new states!

States use HScript files. Callbacks supported at the moment are:

onCreatePre()
onCreate()
onCreatePost()
onUpdate(event:UpdateEvent)
onUpdatePost(event:UpdateEvent)
onStepHit(event:StepHitEvent)
onBeatHit(event:StepHitEvent)
onSectionHit(event:StepHitEvent)
onDestroy(event:ScriptEvent)

State files (including custom states) go in the modsfolder as follows:

mods/modname/states/StateName.hx

In order to make states, I recommend reading source code.

Custom States

You can switch to custom states by calling

ScriptedStateHandler.switchState(stateName:String);

or, if you are using 0.1.1a or earlier

CustomState.switchState(stateName:String);

State JSONs (WIP)

As of 0.1.1b

State JSON files allow you to modify some behavior of when a state is loaded. Put them in the same folder as your state file and give them the same name.

Fields:

  • mode - If this field is set to "override", instead of simply modifying a state, you get a blank state you can use to make completely custom states.

Example:

{
   "mode": "override"
}

Clone this wiki locally