tango_functions.zh#

Variables#

const int

__TANGO_MAX_FUNCTION_ARGS

const int

__TANGO_CODE_FACTOR

const int

__TANGO_SETTER_SET

const int

__TANGO_SETTER_INC

const int

__TANGO_FLOW_IF

const int

__TANGO_FLOW_ELSE

const int

__TANGO_FLOW_ELSEIF

const int

__TANGO_FLOW_WHILE

const int

__TANGO_FLOW_WAITUNTIL

const int

__TANGO_FUNC_ADD

const int

__TANGO_FUNC_OR

const int

__TANGO_FUNC_AND

const int

__TANGO_FUNC_NOT

const int

__TANGO_FUNC_TAB

const int

__TANGO_FUNC_CHAR

const int

__TANGO_FUNC_GOTO

const int

__TANGO_FUNC_LESS

const int

__TANGO_FUNC_NEXT

const int

__TANGO_FUNC_RAND

const int

__TANGO_FUNC_SYNC

const int

__TANGO_FUNC_DELAY

const int

__TANGO_FUNC_CLOSE

const int

__TANGO_FUNC_EQUAL

const int

__TANGO_FUNC_APPEND

const int

__TANGO_FUNC_CHOICE

const int

__TANGO_FUNC_DOMENU

const int

__TANGO_FUNC_NUMBER

const int

__TANGO_FUNC_PRESSA

const int

__TANGO_FUNC_STRING

const int

__TANGO_FUNC_GREATER

const int

__TANGO_FUNC_ORDINAL

const int

__TANGO_FUNC_PLAYSFX

const int

__TANGO_FUNC_SUSPEND

const int

__TANGO_FUNC_MENUWAIT

const int

__TANGO_FUNC_NOTEQUAL

const int

__TANGO_FUNC_SAVENAME

const int

__TANGO_VAR_A0

const int

__TANGO_VAR_A1

const int

__TANGO_VAR_X

const int

__TANGO_VAR_Y

const int

__TANGO_VAR_CSET

const int

__TANGO_VAR_COLOR

const int

__TANGO_VAR_SPEED

const int

__TANGO_VAR_SFX

const int

__TANGO_VAR_STYLE

const int

__TANGO_VAR_NEXT

const int

__TANGO_VAR_CHOSEN

const int

__TANGO_VAR_DEFAULT

const int

__TANGO_NUM_MARKER

const int

__TANGO_VAR_MARKER

const int

__TANGO_SETTER_MARKER

const int

__TANGO_FUNC_MARKER

const int

__TANGO_FUNC_END_MARKER

const int

__TANGO_FLOW_MARKER

const int

__TANGO_FLOW_END_MARKER

const int

__TANGO_ALT_COLOR_START_MARKER

const int

__TANGO_ALT_COLOR_END_MARKER

Functions#

int

__Tango_RunFlowControl(int pos)

void

__Tango_RunSetter(int pos, bool clear)

int

__Tango_RunFunction(int pos, bool clear)

int

__Tango_ReadArgLength(int pos)

int

__Tango_ReadArg(int pos)

int

__Tango_BoolToInt(bool value)

void

__Tango_AppendMessage(int pos, int messageID)

void

__Tango_FuncClose()

void

__Tango_FuncNumber(int number, int pos)

void

__Tango_FuncOrdinal(int number, int pos)

int

__Tango_GetOrdinal(int num)

void

__Tango_FuncSaveName(int pos)

void

__Tango_FuncString(char32[] string, int pos)

void

__Tango_FuncTab(int value)

void

__Tango_FuncAddMenuItem(int pos, int value)

void

__Tango_FuncActivateMenu(int pos, int flags, int initialPos)

void

__Tango_FuncGoto(int newString)

void

__Tango_FuncPressA()

int

__Tango_FuncSync(int[] args)

bool

__Tango_FindSyncingStrings(int value)

int

__Tango_GetVar(int var)

void

__Tango_SetVar(int var, int value)

void

__Tango_Delete(int pos, int end)

void

Tango_LogUndefinedFunction(int function)

void

Tango_LogUndefinedVariable(int var)

void

__Tango_SetAlternateColor(int num)

void

__Tango_ClearAlternateColor()

Variable descriptions#

const int __TANGO_MAX_FUNCTION_ARGS = 4 πŸ”— Source

Constants and functions relating to functions and variables. Max function args; should match array size in __Tango_RunFunction


const int __TANGO_CODE_FACTOR = 7 πŸ”— Source

Used in converting names to numbers


const int __TANGO_SETTER_SET = 0.0986 πŸ”— Source

Setters


const int __TANGO_SETTER_INC = 0.0542 πŸ”— Source


const int __TANGO_FLOW_IF = 0.0069 πŸ”— Source

Flow control functions


const int __TANGO_FLOW_ELSE = 0.2441 πŸ”— Source


const int __TANGO_FLOW_ELSEIF = 11.9678 πŸ”— Source


const int __TANGO_FLOW_WHILE = 5.8497 πŸ”— Source


const int __TANGO_FLOW_WAITUNTIL = 13486.5 πŸ”— Source


const int __TANGO_FUNC_ADD = 0.0081 πŸ”— Source

Other functions


const int __TANGO_FUNC_OR = 0.0123 πŸ”— Source


const int __TANGO_FUNC_AND = 0.0151 πŸ”— Source


const int __TANGO_FUNC_NOT = 0.0811 πŸ”— Source


const int __TANGO_FUNC_TAB = 0.0989 πŸ”— Source


const int __TANGO_FUNC_CHAR = 0.1446 πŸ”— Source


const int __TANGO_FUNC_GOTO = 0.3291 πŸ”— Source


const int __TANGO_FUNC_LESS = 0.4513 πŸ”— Source


const int __TANGO_FUNC_NEXT = 0.5235 πŸ”— Source


const int __TANGO_FUNC_RAND = 0.6325 πŸ”— Source


const int __TANGO_FUNC_SYNC = 0.7843 πŸ”— Source


const int __TANGO_FUNC_DELAY = 1.1939 πŸ”— Source


const int __TANGO_FUNC_CLOSE = 1.2192 πŸ”— Source


const int __TANGO_FUNC_EQUAL = 1.8884 πŸ”— Source


const int __TANGO_FUNC_APPEND = 6.1058 πŸ”— Source


const int __TANGO_FUNC_CHOICE = 7.5241 πŸ”— Source


const int __TANGO_FUNC_DOMENU = 10.8066 πŸ”— Source


const int __TANGO_FUNC_NUMBER = 29.0329 πŸ”— Source


const int __TANGO_FUNC_PRESSA = 31.491 πŸ”— Source


const int __TANGO_FUNC_STRING = 37.4073 πŸ”— Source


const int __TANGO_FUNC_GREATER = 113.945 πŸ”— Source


const int __TANGO_FUNC_ORDINAL = 208.066 πŸ”— Source


const int __TANGO_FUNC_PLAYSFX = 209.604 πŸ”— Source


const int __TANGO_FUNC_SUSPEND = 263.973 πŸ”— Source


const int __TANGO_FUNC_MENUWAIT = 1158.8 πŸ”— Source


const int __TANGO_FUNC_NOTEQUAL = 1364.94 πŸ”— Source


const int __TANGO_FUNC_SAVENAME = 1615.17 πŸ”— Source


const int __TANGO_VAR_A0 = 0.0034 πŸ”— Source

Variables


const int __TANGO_VAR_A1 = 0.0035 πŸ”— Source


const int __TANGO_VAR_X = 0.0024 πŸ”— Source


const int __TANGO_VAR_Y = 0.0025 πŸ”— Source


const int __TANGO_VAR_CSET = 0.2015 πŸ”— Source


const int __TANGO_VAR_COLOR = 1.3059 πŸ”— Source


const int __TANGO_VAR_SPEED = 5.1391 πŸ”— Source


const int __TANGO_VAR_SFX = 0.0997 πŸ”— Source


const int __TANGO_VAR_STYLE = 5.3793 πŸ”— Source


const int __TANGO_VAR_NEXT = 0.5235 πŸ”— Source


const int __TANGO_VAR_CHOSEN = 7.5754 πŸ”— Source


const int __TANGO_VAR_DEFAULT = 57.0513 πŸ”— Source


const int __TANGO_NUM_MARKER = -100 πŸ”— Source

Data markers


const int __TANGO_VAR_MARKER = -200 πŸ”— Source


const int __TANGO_SETTER_MARKER = -300 πŸ”— Source


const int __TANGO_FUNC_MARKER = -400 πŸ”— Source


const int __TANGO_FUNC_END_MARKER = -500 πŸ”— Source


const int __TANGO_FLOW_MARKER = -600 πŸ”— Source


const int __TANGO_FLOW_END_MARKER = -700 πŸ”— Source


const int __TANGO_ALT_COLOR_START_MARKER = -1000 πŸ”— Source


const int __TANGO_ALT_COLOR_END_MARKER = -1100 πŸ”— Source


Function descriptions#

int __Tango_RunFlowControl(int pos) πŸ”— Source

Runs @if, @elseif, @else, @while, and @waituntil.


void __Tango_RunSetter(int pos, bool clear) πŸ”— Source

Runs @set or @inc. If clear is true, the setter and its arguments will be deleted from in __Tango_Buffer[] afterward.


int __Tango_RunFunction(int pos, bool clear) πŸ”— Source

Runs other functions. If clear is true, the function and its arguments in __Tango_Buffer[] will be deleted.


int __Tango_ReadArgLength(int pos) πŸ”— Source

Determines the length of an argument.


int __Tango_ReadArg(int pos) πŸ”— Source

Get the value of an argument, reading variables or running functions if needed.


int __Tango_BoolToInt(bool value) πŸ”— Source

Convert true to 1 and false to 0, since ZScript doesn’t allow casting bool to int. This is just used to make the conditional functions less ugly.


void __Tango_AppendMessage(int pos, int messageID) πŸ”— Source

Implementation of @append


void __Tango_FuncClose() πŸ”— Source


void __Tango_FuncNumber(int number, int pos) πŸ”— Source

Implementation of @number


void __Tango_FuncOrdinal(int number, int pos) πŸ”— Source

Implementation of @ordinal


int __Tango_GetOrdinal(int num) πŸ”— Source

Helper for __Tango_FuncOrdinal.


void __Tango_FuncSaveName(int pos) πŸ”— Source

Implementation of @savename


void __Tango_FuncString(char32[] string, int pos) πŸ”— Source

Implementation of @string


void __Tango_FuncTab(int value) πŸ”— Source

Implementation of @tab


void __Tango_FuncAddMenuItem(int pos, int value) πŸ”— Source

Implementation of @choice


void __Tango_FuncActivateMenu(int pos, int flags, int initialPos) πŸ”— Source

Implementation of @domenu


void __Tango_FuncGoto(int newString) πŸ”— Source

Implementation of @goto


void __Tango_FuncPressA() πŸ”— Source

Implementation of @pressa


int __Tango_FuncSync(int[] args) πŸ”— Source

Implementation of @sync


bool __Tango_FindSyncingStrings(int value) πŸ”— Source

Helper for __Tango_FuncSync() and Tango_Sync(). Finds any strings waiting for the given sync value and restarts them. Returns true if any were found.


int __Tango_GetVar(int var) πŸ”— Source

Get the current value of a variable.


void __Tango_SetVar(int var, int value) πŸ”— Source

Set a variable to the given value.


void __Tango_Delete(int pos, int end) πŸ”— Source

Fills the string with filler characters from pos to end, inclusive. Used to blank out functions so __Tango_Process() can proceed.


void Tango_LogUndefinedFunction(int function) πŸ”— Source

Log an error when an unknown function is called.


void Tango_LogUndefinedVariable(int var) πŸ”— Source

Log an error when an unknown variable is used.


void __Tango_SetAlternateColor(int num) πŸ”— Source

Set an alternate color for [[bracketed text]]. These aren’t exactly functions, though…


void __Tango_ClearAlternateColor() πŸ”— Source