-
Notifications
You must be signed in to change notification settings - Fork 108
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.
HScript also does not support enum
or abstract
types (at least not using the abstract name for them), however there is a ScriptingUtil
class that provides shortcuts to use some of these types.
- You can use
ScriptingUtil.axis{axisType}
for FlxAxes directions. - You can use
ScriptingUtil.rank{rankType}
for song rankings.
There are also other useful functions for certain things that I found did not work or behaved strangely. I recommend taking a look through the class to see what you are able to do with it in more detail.
Normally you cannot use blend mode names with HScript as they are an abstract enum
, however, in FPS Plus if you import openfl.display.BlendMode
you can use BlendMode.{blendMode}
to use that blend mode the same way you would normal. You must include BlendMode
at the begining so you can just do ADD
, you'd need to use BlendMode.ADD
. You can also use FlxTextBorderStyle
the same way you use blend modes, including needing the class name before the type and everything, however, this is automatically imported.
All of the scripted class contain helper variables to make 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
: ThePlayState
tween manager. Use this when making tweens inPlayState
so that they pause when they're supposed to. Alias forPlayState.instance.tweenManager
. -
data
: ADynamic
map inPlayState
that 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
.
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.