Console commands
 
These are the commands which control console entities (gameX86 source code reference: console.cpp). For more details on how consoles work, refer to the Consoles tutorial in the SinEd Tutorials section.

Console commands are colored in lavender in my custom SinScript syntax coloring wordfile for UltraEdit32.


cols  
 
Function
 
This sets the maximum number of columns of text that can be displayed on the console. Consequently, this will determine the width of the text characters on the console: the more columns there are, the narrower the text will be.

Syntax
 
%<console_name> cols <no_of_columns>

Notes & examples
 
Setting this will override the previous value of the console entity's "cols" key.


conactivate  
 
Function
 
This activates the entire console display. When the console is active, it is drawn on the console entity.

Syntax
 
%<console_name> conactivate

Notes & examples
 
Since the console is active by default, this command is normally used to re-activate the console display after the condeactivate command was used previously.


conapplayout
 
Function
 
This will append the layout string in the command argument to the console's current layout.

Syntax
 
%<console_name> conapplayout "<layout_string>"

Notes & examples
 
For more details on layout strings, please refer to the Console Black Magic page.


conclear
 
Function
 
Clears the text printed on the scrolling part of the console with the last conprint command.

Syntax
 
%<console_name> conclear

Notes & examples
 

conclearlayout
 
Function
 
Clears the layout currently displayed on the console.

Syntax
 
%<console_name> conclearlayout

Notes & examples
 

condeactivate  
 
Function
 
This deactivates the entire console display. When the console is inactive, it is not drawn on the console entity.

Syntax
 
%<console_name> condeactivate

Notes & examples
 
To re-activate the console, use the conactivate command.


confraction
 
Function
 
Determines the percentage of the total console surface to use for the scrolling part of the console (console prompt and conprint area).

Syntax
 
%<console_name> confraction <fraction>

Notes & examples
 
Values for the <fraction> argument range fom 0 to 1. So for example, 0.3 is 30% and 1 is 100%. Setting this will override the previous value of the console entity's "fraction" key.


conlayout
 
Function
 
This clears the current layout and displays the layout string specified in the argument on the console.

Syntax
 
%<console_name> conlayout "<layout_string>"

Notes & examples
 
For more details on layout strings, please refer to the Console Black Magic page.


conlayoutfile
 
Function
 
This will display all the layout strings contained in the layout file specified in the command argument. This is useful for large layouts in DM maps so they don't have to be sent over the network. Having all the layout strings in a separate file instead of in the middle of a large script makes them easier to manage and keeps the script "clean".

Syntax
 
%<console_name> conlayoutfile <path/layout_filename>.txt

Notes & examples
 
The path information is relative to the PAK file's root folder or the game's base folder and must be included. Also, the layout file must have a .txt file extension (which must be specified in the filename argument otherwise the game crashes).


conmenufile
 
Function
 
This sets what menu file is used for the console's menus. The menu file contains all the menu and header items for the console. This is useful for large menus in DM maps so they don't have to be sent over the network. Having all the menu items in a separate file instead of in the middle of a large script makes them easier to manage and keeps the script "clean".

Syntax
 
%<console_name> conmenufile <path/menu_filename>

Notes & examples
 
The path information is relative to the PAK file's root folder or the game's base folder and must be included. Also, the menu file can have any file extension you want (.mnu, .mn1, .mn2, etc.) but it must be specified in the filename argument. Sin's menu files usually reside in the game's base/menus folder.

Setting this will override the previous value of the console entity's "menufile" key.


connewline  
 
Function
 
This outputs a carriage return on the scrolling part of the console. It will make the currently displayed conprint text scroll upward by one line.

Syntax
 
%<console_name> connewline

Notes & examples
 

conprint
 
Function
 
Prints a text string on the scrolling part of the console (right above the console prompt). The string will remain on the console screen until cleared by a conclear command.

Syntax
 
%<console_name> conprint "<text_string>"

Notes & examples
 
The text string argument must be enclosed between double quotes ("). Using \n (newline) in the string produces a carriage return which makes the text scroll upward on the console so the following text will print on a new line (does the same thing as a connewline command).


convirtualheight
 
Function
 
This sets the virtual height of the console display. This will override the value set in the console entity's "virtualheight" key.

Syntax
 
%<console_name> convirtualheight "<units>"

Notes & examples
 
The virtual height serves as a virtual grid for the console display. This sets a user-defined coordinate system for the vertical placement of layout strings and menu items on the console display.

The <units> argument is an arbitrary value determined by the user according to the size of the console brush face and the amount and size of the text and images he needs to display on the console. For more details, illustrations and examples, see the consoles tutorial.


convirtualwidth
 
Function
 
This sets the virtual width of the console display. This will override the value set in the console entity's "virtualwidth" key.

Syntax
 
%<console_name> convirtualwidth "<units>"

Notes & examples
 
The virtual width serves as a virtual grid for the console display. This is used as a coordinate system for the horizontal placement of layout strings and menu items on the console display.

The <units> argument is an arbitrary value determined by the user according to the size of the console brush face and the amount and size of the text and images he needs to display on the console.


focus
 
Function
 
Determines to which part of the console has the focus: the menu part or the scrolling part. This command must be used before the player can select an item from the console menu or input data at the console command prompt.

Syntax
 
%<console_name> focus menu|console

Notes & examples
 
When the focus is on the menu part of the console, the player can scroll through the menu choices with the up/down arrow keys and select one by pressing enter. When the focus is on the scrolling part of the console, a command prompt appears at the bottom and the user can type text at the prompt and press enter.

Once the enter key is pressed, the menu selection or text input data is automatically passed to the console variable and can then be processed by the thread waiting for the console (see waitForConsole and coninput commands).


foreground
 
Function
 
This sets the default foreground color and alpha blending of the text on the scrolling part of the console display (command prompt and conprint text) to the values specified in the command argument.

Syntax
 
%<console_name> foreground <R G B A>

Notes & examples
 
The RGB (red, green, blue) and Alpha (translucency) values range from 0 to 1. This command does not affect the foreground of the menu part of the console (menu items and layout strings).


menuactive
 
Function
 
This activates the menu part of the console. When the menu is active, it is drawn on the console display.

Syntax
 
%<console_name> menuactive

Notes & examples
 
Since the menu is active by default, this command is normally used to re-activate the menu after the menuinactive command was used previously.


menuinactive
 
Function
 
This deactivates the menu part of the console. When the menu is inactive, it is not drawn on the console display.

Syntax
 
%<console_name> menuinactive

Notes & examples
 
To re-activate the menu, use the menuactive command.


rows  
 
Function
 
This sets the maximum number of rows of text that can be displayed on the console. Consequently, this will determine the height of the text characters on the console: the more rows there are, the shallower the text will be.

Syntax
 
%<console_name> rows <no_of_rows>

Notes & examples
 
Setting this will override the previous value of the console entity's "rows" key.


sbar
 
Function
 
This creates a status bar on the console display. The status bar parameters are set in the command arguments. These include: status bar number (for identification), width, height, minimum, maximum and initial values, color and translucency. It is possible to have several status bars on the same console, thus the reason for a status bar id number.

Syntax
 
%<console_name> sbar <id_number> <width> <height> <min_value> <max_value> <initial_value> <R G B A>

Notes & examples
 
The RGB (red, green, blue) and Alpha (translucency) values range from 0 to 1. The <width> and <height> arguments are in virtual units (see the convirtualwidth and convirtualheight commands).


sbarvalue
 
Function
 
This sets the value of an existing status bar on the console display to the new value specified in the command argument. A status bar is refered to by its id number.

Syntax
 
%<console_name> sbarvalue <id_number> <new_value>

Notes & examples
 
In order to use this command, the status bar must first be created with the sbar command.