RDCode
RDCode (abbreviation of Rhythm Doctor Code) is the set of features in Rhythm Doctor that encompass Custom Methods, Tags, conditionals, and simple programming via reading and writing to variables. Hereinelsewhere and in the community, the word "RDCode" on its own usually refers to its programming language.
Custom Methods
See Call Custom Method.
Tags
See Tag Action and Call Custom Method.
To add a tag to an event, click on the "Bar" text in the top of the Event window, and it will turn into a "Tag" textbox.
It's best practice to encompass individual and separate tags in square brackets ([]
).
Conditionals
Conditionals are a way to check for conditions when running events. The list of conditionals can be accessed from the Conditionals button in the Actions (VFX) tab.
Click Add New... to create a new conditional. To edit an existing one, hover over it and click the wrench icon. The icon beside it is to duplicate it. Deselect All only appears when applying conditionals to events, and removes all of the applied ones from the event.
Conditionals have a Tag (text identifier), ID (unique numerical identifier), and Name (text that appears in the conditional (select) list).
Events can also have set timers. Though they aren't exclusively used in combination with conditionals, they nearly always go together. They allow an event to be triggered during a set timeframe defined by the timer in beats, as long as the conditionals are true at any point during that timeframe. E.g., setting a numMistakes > 5
conditional alongside an 8-beat timer will run the event when the mistake amount surpasses 5 at any point within those 8 beats.
Conditionals can have multiple types:
Last Hit
Last Hit checks a hit type of the last hit. It can check for Perfect, Slightly Early, Slightly Late, Very Early, Very Late, Any Early or Late, and Missed completely. It can also check for individual rows or any row in the level.
Max Times Executed
Max Times Executed allows a looping or tagged event to stop executing after a certain number of executions. E.g., if a level has Set Play Style to loop and an event within this loop should only run thrice, Max Times Executed can stop its execution after 3 loops. Note that execution count is global, meaning that if two events have the same Max Times Executed conditional, both will contribute to its count.
Player Mode
Player Mode allows the detection of 1-player or 2-player within the same level file (useful in case both modes is selected in export settings and a different 2-player file is not provided). Note that in the editor, if the player changes from 1-player to 2-player during playback, the "player mode" state (1P/2P) will not switch.
Language
Language allows the detection of the player's Rhythm Doctor language. Useful for localising text and vocals (e.g. One Shift More). It supports the languages English, Chinese (Simplified), Chinese (Traditional), Spanish, Korean, Portuguese, Polish, Japanese, French, German, and Arabic.
Narration
Narration allows the detection of the narration accessibility setting.
Custom
Custom conditionals allow for RDCode conditional expressions to be inputted, such as comparisons (e.g. i0 < 5
) and boolean reading (e.g. b0
).
RDCode programming
More commonly referred to as just RDCode, RDCode programming is the programming language built into Rhythm Doctor. It allows reading and writing to variables and performing basic arithmetic.
RDCode can be input within conditionals to check or Call Custom Method events to run.
Variables
Variables in RDCode are readable and writeable items to store numerical and boolean information. The 30 readable and writeable variables appear in the Level Editor's Event Window when nothing is selected. They update dynamically during runtime.
The provided readable and writeable variables in RDCode are 10 boolean variables, 10 integer variables, and 10 float variables, with the naming b/i/f
+ [0-9]
(e.g. i0
, f5
, b9
). Arrays can't be made, nor classes.
Note that, when converting between data types (e.g. i0 = f0
, b0 = i0
), floats will be rounded (0.5 rounding is inconsistent, can be upwards or downwards), and integers to booleans will return false if its equal to 0, otherwise true.
There are non-readable but writeable variables that affect gameplay and visuals, and they're only able to be used in Call Custom Method events. E.g. wobblyLines
(bool), noHitFlashBorder
(bool), and room[]
(this is a special array variable that can accept custom methods that affect individual rooms). See List of Custom Methods for a further list.
Finally, there are non-writeable variables that can still be read and used only in conditionals, such as autoplay
(bool), levelSpeed
(float), and numMistakes
(float).
Operations
Type | Operator |
---|---|
Addition | +
|
Subtraction | -
|
Multiplication | *
|
Division | /
|
Value writing | =
|
Equal to | ==
|
Not equal to | !=
|
Greater than | <
|
Smaller than | >
|
Logical not | !
|
Logical and | &&
|
Logical or | ||
|