RDCode: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 25: Line 25:
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.
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 (<code>[]</code>).-->
<!--It's best practice to encompass individual and separate tags in square brackets (<code>[]</code>).-->
See [[List_of_Custom_Methods#Tags|List of Tags]] for a set of special tags that can't be affected by Tag Action but rather are handled by game input.
See [[List_of_Custom_Methods#Tags|List of Tags]] for a set of special tags that can't be affected by Tag Action but rather are handled by game input.



Latest revision as of 11:47, 7 March 2025

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.

Note that all RDCode is affected by the player's Visual Offset, which can cause timing issues in certain cases.

Custom Methods

Custom Methods are functions that can be executed for various uses, whether to manage audio, VFX, gameplay, or specific built-in cases like a Gameover or custom Rank screen.

See Call Custom Method for how to execute Custom Methods and List of Custom Methods for a list of the available ones.

Note that Custom Methods are not officially endorsed to be used by the devs, and can break anytime when the game updates.

Comment Commands

See Comment.

Tags

Tags can be set on events to run them at any time, in order. If an event or series of events are tagged, they will run whenever the tag is run. This is useful for looping the same events or running them based on player inputs or choices (i.e. not bound to a specific beat nor bar).

Tagged events only run at the same time if, on the timeline, they're placed on the same beat and bar. They're run in order, such that if a tagged event is placed on beat 1 and another on beat 2, when running the tag, the first event will run immediately and there will be a 1 beat delay to the next event.

See Tag Action for running and managing tags. (Call Custom Method also has a set of Custom Methods that equate to Tag Action's functionality.)

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.

See List of Tags for a set of special tags that can't be affected by Tag Action but rather are handled by game input.

Conditionals

EditorConditionalsMenu.png

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 durations. 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 duration 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 duration 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 update accordingly.

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.

Custom

Custom conditionals allow for RDCode conditional expressions to be inputted, such as comparisons (e.g. i0 < 5) and boolean reading (e.g. b0).

See List of Variables for variables that can be checked within these types of conditionals.

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.

Certain events that have text-boxes are able to read these 30 variables, using curly brackets ({}), and having inside a valid RDCode arithmetic expression. (e.g. in a Floating Text event, Current score: {i0} will display the current value of i0).

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 ||