Commands

commands in chartbuild are executed by the analyzer during analysis.

Currently, no commands are implemented.

Currently, the available commands are

  • version
  • target
  • enable
  • disable
  • meta

Apart from enable and disable, all of the commands can only be used once.

version

Syntax

#version [version number]

The language will receive new features and bugfixes. To ensure consistent behaviour accross versions, Each patch will be in a new version. Each bug could be re-enabled with an enable command.

The result would be the ability to update scripts without changing the behaviour. and the following example could be done

#version x.x

function(true, 1) // old api
#version x.y
#enable x.x/bugs/bugn

function_updated_and_renamed(1, true) // new api

The script could be updates as easily as if it was just being formatted.

Because of this, chartbuild scripts are required to start by specifying a version.
Currently, there are no versions and defining this or not won't change anything.

target

Syntax

#target [CompatibilityLevel]

Chartbuild has a lot of features that is incompatible with other formats and yet, the editor allows exporting to those formats as well. That is because it will ignore all incompatibilities and just carries on. By setting the target, you are setting the format you wish the script to be fully compatible with. Which results in additional errors when incompatible features are used.

Possible values are the members of the CompatibilityLevel enum.

namedescriptionvalue
PCEThe compatiblity level for phigros chart engine0
RPEThe compatibility level for Re:PhiEdit1
PHIThe compatibility level for Phigros2

default value: PCE

Under the hood, setting target just enables and disables certain features; Just think of it as a macro.

enable & disable

Syntax

#enable [feature]
#disable [group]/[nested group]/[feature]

Enable or disable features.

Available feautres that can be enabled or disabled

namefull pathdescriptiondefault
loggingeditor/logGives access to the log, print, info, warn, error functions inside the editor.enabled
custom eventseventsCustom scripted events used in chartbuild charts.enabled
value interpolate eventscompatibility/eventsThe events used in Phigros and RPE which can only interpolate a property between 2 values.disabled
Enable and disable only adds or removes values or applies rules to the current scope.
// global scope
{
    // a child scope of the global scope
    #enable logging
    print("it works"); // no issues
    // a child scope of the child scope
    {
        print("it also works here");
    }
}

// back in the global scope
print("this does not work");

meta

Syntax

#meta name=value
namedescriptionvalue typedefault value
charterThe creator of the chart.strUnknown
composerThe composer of the music used in the chart.strUnknown
artistThe background artist for the background used in the chart.Unknownstr
previewThe song preview in the select menu.range0..=length
titleThe title of the chart (in most cases, the song).strUnknown
nameThe name of the difficulty.strFM
levelThe level of the difficulty.str?