Repository navigation
scripting

This page is still wip. Sorry if it take too long to finish, we are working on it.
Hscript Iris Page || Haxe API || Psych Engine's Lua API || Lua API
PsychWiki (made by MemeFlavor!) || CNE API || NMV Scripting page || Vslice Hscript page
-
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
.luaand.hxc. The paths are almost quite the same and essentially, works by the same.
-
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 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,boyfriendorgf. 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 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 from0to3. (
= 0||
= 1||
= 2||
= 3) -
noteType- Current note-type of your note. -
isSustainNote- Whether the notes are a sustain note, or not.
strumIndex- which strum index. (0to whatever index of strum. Or![]()
playerto Specifically Player's Strum. )
Up-to-date Field
-
missType- Can be eitherpress,missorboth.
deixar aqui cmg pra dps eu coisar em casa bleeehhh
function onNoteMiss(noteData:Int, noteType:String, isSustainNote:Float, ?missType:Int, ?strumIndex:Int)
- Hscripting is a way of writing haxe on scripts easier. And also, it's the most recommended way of scripting at the engine, with the supported file formats are
.hx,.hxcand.hscript. - You can do whatever you want with Haxe scripts. Including, but not limited to:
Characters,Stages,States,In-game Scripts,Icons,Notesand etc.
| Function | About |
|---|---|
| onLoad() / onCreate() | runs immediately upon the script is created. |
| onCreatePost() | runs immediately AFTER super.create();. |
| onUpdate(elapsed:Float) | runs at update function. |
| onUpdatePost(elapsed:Float) | similar to onUpdate(), but it runs AFTER onUpdate(). |
| onDestroy() | runs right upon a state is destroyed. |
| onSubstateOpen() | aint got no time |
| onSubstateClose() | fuck |
- Creating new characters
- Creating new songs
- Creating new stages
- Creating new levels
- Creating new stickers
- Creating new freeplay tabs
- Creating new mixes
- Creating new states
- on Songs
- on Characters
- on Notetypes
- on Events
- on Dialogues (DialoguePlus)
- on GameOver
- on Dialogue Portraits
- on Icons
- on StoryMenu
- on Pause Screen
- Globally
