This repository was archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
HScript Commands
Bulby edited this page Aug 17, 2021
·
9 revisions
Hscript is just haxe so a lot of it will require documentation.
Link to Flixel
Link to Haxe
I'll list types I've given you first. (These apply to all hscript things!)
| Type | Description |
|---|---|
| FlxSprite | Basic Sprite, what you use to display visual stuff |
| MetroSprite | A custom sprite that handles dancing for you. If 3rd param is true, "Idle" will be used. If 3rd param is false, "danceLeft" and "danceRight" will be used |
| FlxAtlasFrames | How you make animated shit. This is what you assign to the frames field of FlxSprite |
| FlxGroup | Group of FlxBasic. All shit in it updates automatically. |
| FlxMath | Helper for math. |
| FlxAngle | Helper for angles. Mostly used for converting degrees to radians and vice versa. |
| FlxTimer | Helps time things. Runs a function on end of time. |
| FlxTween | Moves things smoothly between positions. |
| FlxEase | Use with FlxTween, includes functions that help move things differently smooth |
| FlxG | All of the global shit. Includes save data, which I should really get around to blocking. |
| Std | Convert types and shit |
| StringTools | You can't use it like shown in documentation but you can still use it staticly. |
| Conductor | What the game uses to keep track of time. |
| makeRangeArray | Function that makes a range array. Gamers, the 1st param is the max. Be careful! |
| FNFAssets | What is used to read files. No writing files tho! |
| FlxTrail | What Spirit uses. Lets sprites leave trails. |
| Character | The Character thingie. No documentation but the source code is there :hueh: |
That's all the shared stuff, but now characters & stages/modcharts are seperate. These usually aren't utility shit but actual objects. Stages/Modcharts
| Variable | Description |
|---|---|
| BEHIND_GF | Helper variable, used with addSprite. Layer behind gf. (you can use bitwise or to combine layers!) |
| BEHIND_BF | Layer behind bf. Same as above. |
| BEHIND_DAD | Layer behind enemy. Same as above. |
| BEHIND_ALL | Layer behind everyone. Same as above. |
| BEHIND_NONE | Layer behind no one. Same as above. |
| difficulty | Current difficulty. Actually a number, which is realllllll fucky. Don't use lol |
| bpm | Bpm of current song. Deprecated, use Conductor.bpm instead. |
| songData | Data of the song. Includes name, p1, p2, gf, stage... |
| curSong | Song name |
| curStep | current step |
| curBeat | current beat |
| camHUD | Camera used for the hud (arrows n shit) |
| showOnlyStrums | Whether to hide everything except strums (this is specifically for hscript!) |
| playerStrums | Strums of the player |
| enemyStrums | Strums of... the opponent |
| mustHit | Whether current section must be hit |
| strumLineY | Y pos of the strumline. |
| hscriptPath | Directory to the folder with images. |
| boyfriend | Boyfriend, the character lol |
| gf | Girlfriend the character |
| dad | The enemy, (the character) |
| vocals | The vocal sound |
| gfSpeed | How faaaaaaast gf go. Higher numbers are slower |
| tweenCamIn | Function that tweens cam in. |
| isInCutscene | Function that returns if we're in a cutscene. |
| camZooming | If the cam is zooming. Live updated on both sides! (if you edit it it gets changed) |
| addSprite | How you add sprites. First pos is a FlxSprite or a MetroSprite, 2nd is a position, based off one of the helper variables |
| setDefaultZoom | Function to set default cam zoom. |
| removeSprite | How you remove sprites. |
| getHaxeActor | How you get strumline members |
| health | Current Health. Can be edited. |
| iconP1 | P1's icon. |
| iconP2 | P2's icon. |
| currentPlayState | The current playstate. Preferred way to get things as you can update in realtime. Check the source for public vars. |
| PlayState | Static PlayState, includes things like SONG |
| window | Lib.application.window |
| scaleChar | Scale a character by an amount (char, amount) |
| swapChar | Swap a character out for another (char, charTo) |
| There are also some functions that need to be defined by you... | |
| Function | params |
| --- | --- |
| start | song |
| beatHit | beat |
| update | elapsed |
| stepHit | step |
| playerTwoTurn | ~~~ |
| playerTwoMiss | ~~~ |
| playerTwoSing | ~~~ |
| playerOneTurn | ~~~ |
| playerOneMiss | ~~~ |
| playerOneSing | ~~~ |
| noteHit | player1, note, goodHit |
That is all of the shit for stages and modcharts... Any further info can be found yo damn self.
For characters...
| Variables | Description |
|---|---|
| Level_NotAHoe | Used for gf, set the char gfEpicLevel. Means character isn't like gf and can't dance left/right |
| Level_Boogie | Means character can dance left right and is like gf. |
| Level_Sadness | Means gf can also cry. |
| Level_Sing | Means gf can sing. |
| portraitOffset | You should set this to what the portrait should be offset. Like offsets in the jsons. |
| dadVar | How long notes are held. |
| isPixel | Bool, you should set. If the character is pixel, set it to true. |
Functions you need to define:
| Function | Params | Description |
|---|---|---|
| init | char | Set shit up. char is character, and this is true for all character functions. |
| update | elapsed, char | Called every frame. elapsed is time since last frame. |
| dance | char | Called every beat, determines how char dances. Reason this is passed because tankman :| |
Characters themselves are like FlxSprite. Some important variables:
| Variable | Description |
|---|---|
| like | Who you are like. This is unused as of now. |
| likeGf | Character replaces gf. |
| hasGun | Uses animation notes, like pico-speaker. |
| likeBf | Like boyfriend. |
| gfEpicLevel | How skilled gf is at being gf. uses helper vars. |
| playerOffsetX | How much the player will be offset on the x axis. Doesn't apply to enemies! |
| playerOffsetY | Same shit just y axis. |
| isPixel | If character like pixel. Idk if this auto sets but be safe my man. |
| enemyOffsetX | Enemy offset on x axis |
| enemyOffsetY | Same shit y axis. |
| camOffsetX | Offset of cam on x axis at start. Was fucked by cutscenes lol |
| camOffsetY | Same deal. |
| followCamX | Same thing but actually used properly. |
| followCamY | Same deal. |
| midpointX | 🤷🏻 I don't fucking know i accepted a pr and poof this appeared. |
| midpointY | Same deal |
| addOffset | Function that adds offsets. First param anim name, 2nd param x pos, 3rd param y pos. |
| enemyColor | Color used by default if an enemy. Default red. |
| opponentColor | Color used by enemy in opponent play or duo mode. Default Yellow. |
| playerColor | Color used by player by default. Default Green. |
| bfColor | Color used by player 1 in duo mode and opponent play. Default bf blue. |
| poisonColor | Poison Color used for player 1. Default purple. |
| poisonColorEnemy | Poison Color used for opponent. Default magenta. |
Those are important ones. All others can be found in the source.