Skip to content

scripting

Mily_0 edited this page Jul 16, 2026 · 10 revisions

weepoh

This page is still wip. Sorry if it take too long to finish, we are working on it.




1000014992

About

  • This section is entirely about the scripting feature of the engine. Highly modified from Psych Engine's system.

    As you may have seen, the engine supports scripting in .lua and .hxc. The paths are almost quite the same and essentially, works by the same.

Scripting on Songs

  • Scripting on songs is quite simple. You just need to add your LuaScript / Hscript at <ModFolder>/songs/<songName>/. Then, it should work normally.

  • All the callbacks and functions work perfectly at song scripts.

  • An example of a working Script for a song:

function onMoveCamera(target:String)
{
    if (target == 'boyfriend' || target == 'player') {
        cameraZoom(0.83, 4, 'elasticInOut', 'nll');
    } else if (target == 'dad' || target == 'opponent') {
        cameraZoom(0.75, 4, 'elasticInOut', 'nll');
    }
}

This script basically changes the camera zoom depending on who is focused.


Scripting on Characters

  • Scripting on Characters is almost the same thing. You just need to add your LuaScript / Hscript at data/characters/<charName>.*.
  • Thankfully by a wonderful person on Psych Mint server, now the characters itself don't have the specific functions for it.
  • What i mean is, instead of:
function onLoad() {
    dad.alpha = 0.6;
    dad.color = 'RED';
    dad.x = var + 445;
}
  • The characters scripts now work with:
function onLoad() {
    alpha = 0.6;
    color = 'RED';
    x = var + 445;
}
  • This is because, once a script is placed inside a character's folder, the engine automatically binds it to that character. From that point on, you no longer need to specify whether it's dad, boyfriend or gf. The script always refers to the character itself, regardless of which slot it is currently using. This means that if the same character is loaded as the opponent, the player, or the girlfriend, the exact same script will work without any changes.

Neutral functions can be seen on the API down below!


Important

Just noticed this was not added to the actual build FOR WAY TOO LONG HOLY SHIT

Scripting on Notetypes

  • Scripting on notetypes are the way custom notes react when they are pressed. Naturally, their path is <modFolder>/data/notetypes/<notetype>.*.

  • Notes work similar to Characters. Their Scripts are binded to the note itself, not needing to nothing but but vars from functions.

  • example script:

function onLoad() {
    // later i put shit on here
}

makes the character sings a different animation prefix.

  • noteData - Note index from 0 to 3. ( l = 0 || image = 1 || image = 2 || image = 3 )
  • noteType - Current note-type of your note.
  • isSustainNote - Whether the notes are a sustain note, or not.
  • strum - which strum index. ( 0 to whatever index of strum. Or image player to Specifically Player's Strum. )

Up-to-date var

  • missType - Can be either press, miss or both.

deixar aqui cmg pra dps eu coisar em casa bleeehhh

function onNoteHit(noteData:Int, noteType:String, isSustainNote:Float, ?strum:Int)

function onNotePre(noteData:Int, noteType:String, isSustainNote:Float, ?strum:Int)

function onNoteMiss(noteData:Int, noteType:String, isSustainNote:Float, ?missType:Int, ?strum:Int)

function onSpawnNote(noteData:Int, noteType:String, isSustainNote:Float, ?strum:Int)

Clone this wiki locally