HScript: Notes and Strumlines - SlightlySimple/FNF-Restructure-Engine GitHub Wiki

The following variables are used to access the sprite groups used to store the game's notes, sustain notes, and strumlines.

  • game.notes is the sprite group that stores all of the notes currently on screen.
  • game.sustainNotes is the sprite group that stores all of the sustain notes currently on screen.
  • game.strumNotes is the sprite group that stores all of the strumline notes currently on screen.

All of these groups can be affected either by accessing the members property (ex. game.notes.members) or by using the forEachAlive function (ex. game.notes.forEachAlive(function(note) {})).

Notes and sustain notes share the following list of properties which can be used to perform certain operations on them.

  • strumTime is how far into the song the note is hit, in milliseconds.
  • beat is how far into the song the note is hit, in beats.
  • column is the column the note falls on, starting at 0. Note that all strumlines collectively count their columns, so for example, a note on the player's side will usually be in columns 4-7.
  • strumColumn is the column the note falls on, relative to it's own strumline, starting at 0. For example, a note in column 7 will usually have a strumColumn of 3.
  • downscroll will cause the note to travel in the reverse of it's normal direction. This will by default be set by the player's scroll direction setting.
  • noteType is the name of the note's type. If the note has no type, this will be the empty string "".
  • typeData is the information about the note's type as defined by the note type's JSON, if it has one.
  • singers is a list of characters that will be affected by the note when it is hit or missed.
  • hitAnim is the animation that the note's singers play when the note is hit.
  • missAnim is the animation that the note's singers play when the note is missed.

Notes also have the isLift variable which, if true, means the player must let go of the note's corresponding key at the right time in order to hit the note instead of pressing the key.

Strumline notes have the following properties for modchart purposes.

  • ang is the angle of the strumline relative to it's base angle as defined in the noteskin.
  • noteAng is the direction from which the strumline's notes travel into the strumline.

By default, notes and sustain notes will copy several properties from their strumline. The following variables can be set to false to disable this.

  • calcX and calcY cause the note to follow the strum's position.
  • calcVis causes the note to set it's visibility to that of it's strum.
  • calcAngle causes the note to set it's relative angle to that of it's strum. This does not affect sustain notes, as their angle is determined by what direction they travel in.
  • calcNoteAng causes the note to set it's travel direction to it's strum's noteAng value.
  • calcAlpha causes the note to set it's transparency to that of it's strum, multiplied by the value of the note's alph variable.