Gametype Code

The gametype code page allows you to decompile a gametype's script code, and compile new code into a gametype.

The top half of the page consists of a code editor textbox and buttons to decompile or recompile. The bottom half of the page is a results log for the compiler. You can resize how much of the page each half uses by dragging the space between the two halves.

There is no confirmation prompt on decompiling or compiling; decompiling will wipe the code editor and fill it with decompiled code, while compiling will immediately replace the gametype's script code with whatever's in the code editor (unless an error occurs, in which case no data is changed).

Unresolved string references

When you write and compile a gametype script, you don't need to add all of the text that you use to the string table in advance. You can just use a string literal, and ReachVariantTool will try to handle it:

for each player do
   current_player.set_round_card_title("i didn't bother defining this text\nin advance lol")
end

However, ReachVariantTool needs just a little bit of help to handle these. When it detects a new string literal in your script, it will display this dialog box:

For each string literal, you can choose to create the string's text, or you can choose to use an existing string in the string table. This decision isn't "per string," but "per string reference." If the same string literal occurs in two different places in the string, you can have one of those use an existing string in the table and have the other define a new string. Moreover, you can also edit existing strings from here by selecting them and clicking the "..." button.

The default course of action is to just define a new string, so you usually won't have to worry about this. You can click "Commit" and be on your way.

Compiler messages

Each compiler message can be double-clicked to jump to the line and column in the script where the error was detected. This will usually be near, or at the end of, whatever construct actually has the error. You can also click the "Warnings" and "Errors" buttons to filter which log items are displayed.

Warnings are non-essential notifications regarding things that are not necessarily errors, but that you may want to be aware of. For example, some functions can only take a number between -128 and 127. If you specify a number outside of this range, then it will overflow or underflow, and you will be warned; however, it will not prevent your script from compiling.

Errors are important issues that have prevented your script from compiling. If an error occurs, then your script will not be compiled into the game variant file; you need to fix the problem and try again. Even if an error occurs, ReachVariantTool's compiler will keep trying to process the rest of your script, so that if there are any other errors, it can tell you about all of them and you can handle them all at once.

Fatal errors are errors that prevent ReachVariantTool's compiler from continuing to read your script; they are errors that prevent the compiler from being able to understand anything that comes next.

An example of a non-fatal error is passing an invalid argument to a function, while an example of a fatal error is using a keyword like end in the wrong place.