-
Notifications
You must be signed in to change notification settings - Fork 120
General HScript Information
There are a few things to keep in mind when working with HScript classes. You can read the Limitations section of the HScript README and the Abilities and Limitations of Scripted Classes section of Polymod's Scripted Classes documentation for a basic rundown of what is and isn't allowed with scripted classes.
Additionally, the scripted class are not namespaced, meaning if you define the class Boyfriend as a freeplay character and also define Boyfriend as a character select character it will only be able to find one of them despite them being separated into different locations. Each class needs a unique name like BoyfriendFreeplay and BoyfriendCharacterSelect. Keep the class names descriptive.
ScriptingUtil is a class that has a variety of helpful functions that can be useful in scripts or allow you to access some functionality that either doesn't work or could possibly be janky in scripts. It gets new features added to it somewhat often so I recommend looking through the file.
Normally certain thing like BlendMode or FlxTextBorderStyle may not work or don't always work properly with hscript. FPS Plus provides redefinitions of certain classes or typedefs to allow for proper use. For example instead of importing openfl.display.BlendMode and using ADD you can just use BlendMode.ADD without an import and it will work properly.
All of the scripted class (except for scripted states) contain helper variables to make interfacing with the current PlayState instance and accessing certain variables more simple:
-
boyfriend: The current player character. Alias forPlayState.instance.boyfriend. -
dad: The current opponent character. Alias forPlayState.instance.dad. -
gf: The current GF character. Alias forPlayState.instance.gf. -
playstate: The current instance ofPlayState. Alias forPlayState.instance. -
tween: ThePlayStatetween manager. Use this when making tweens inPlayStateso that they pause when they're supposed to. Alias forPlayState.instance.tweenManager. -
data: ADynamicmap inPlayStatethat can store any type of data. Alias forPlayState.instance.arbitraryData. -
gameover: The current instance ofGameOverSubState. Alias forGameOverSubState.instance. -
resultsScreen: The current instance ofResultsState. Alias forresults.ResultsState.instance.
-
withDance: Used to access an abstract enum. Alias forAttachedAction.withDance. -
withSing: Used to access an abstract enum. Alias forAttachedAction.withSing. -
withPlayAnim: Used to access an abstract enum. Alias forAttachedAction.withPlayAnim. -
splitVocalTrack: Used to access an abstract enum. Alias forVocalType.splitVocalTrack. -
combinedVocalTrack: Used to access an abstract enum. Alias forVocalType.combinedVocalTrack. -
noVocalTrack: Used to access an abstract enum. Alias forVocalType.noVocalTrack.
-
left: Can be used when refering to note directions. Alias for0. -
down: Can be used when refering to note directions. Alias for1. -
up: Can be used when refering to note directions. Alias for2. -
right: Can be used when refering to note directions. Alias for3.
-
isInPlayState: Istrueif you are in PlayState andfalse.
Note that for variables like boyfriend or dad you cannot directly set these, you need to use the full variable like playstate.boyfriend to set it to a new character object for example.