Console Documentation: Difference between revisions

From VisionaireWiki
Jump to navigation Jump to search
(New page: == General == The player console can be shown/hidden with the TAB key. It is basically used for faster and easier testing of a game and to test if animations and actions are running and st...)
 
 
(One intermediate revision by the same user not shown)
Line 234: Line 234:
===EXEC===
===EXEC===


Execute a script command. A detailed description about scriping (including all commands) can be found here TODO Link.
Execute a script command. A detailed description about scriping (including all commands) can be found in the [[Scripting|scripting documentation]].


Example:
Example:
  EXEC setValue(VGameFadeDelay, 1000, "Game")
  EXEC game:setValue(VGameFadeDelay, 1000)


Sets the fade delay for fading to a new scene to 1000 milli seconds.
Sets the fade delay for fading to a new scene to 1000 milli seconds.

Latest revision as of 23:03, 29 September 2010

General

The player console can be shown/hidden with the TAB key. It is basically used for faster and easier testing of a game and to test if animations and actions are running and stopped as expected. Furthermore, the console makes it easier to find errors in the game. It is only available for non-compiled games (so that already complete games cannot be analysed).

Make sure that the font which is used for the console output contains all necessary special characters (e.g. #'".,:>!/%()|- ). Otherwise those characters will not be printed and some information is missing.

The keywords are case insensitve (e.g. it makes no difference if you write 'SET', 'set' or 'Set'). If you are specifying a visionaire object the name is case sensitive. If a name contains spaces then it must be written between quotation marks (e.g. "open door"). If a name contains no spaces it can also be written without quotation marks.

If the output on the console is too big for the screen then the output can be scrolled with the 'Page up'/'Page down' keys. If you press 'Home'/'End' while holding 'Ctrl' the first/last page of the output will be shown. If you press 'Arrow up'/'Arrow down' while holding 'Alt' the recently entered commands can be shown (so they don't have to be entered again if you want to execute a command another time).

The console also offers command completion which makes it easier and faster to enter commands. A list of possible options for the current input is shown below the cursor. With the 'Arrow up'/'Arrow down' keys you can choose an entry and select it with 'Enter' (or TAB key). If you press 'Esc' while there are options below the cursor then the box with the possible options disappears. If there are too many options to display there are three dots ("...") at the bottom to indicate further options.

Command overview

  • CHANGE: used to change current character, scene, etc.
  • SET: used to set objects, properties, etc.
  • PRINT: shows various information on the console output
  • SHOW: shows a visionaire object (character, scene, ...)
  • ADD: adds an item
  • REMOVE: removes an item, action or animation
  • CLEAR: Clears a console property or the log file

Command detail

In this documentation all keywords are written in upper case letters. Words written in lower case letters are names of an object (as shown in the Editor) or have a special meaning. If there are more options for a command then all options are written between square brackets ('[' and ']') and are separated with a pipe ('|').

CHANGE

SET CHARACTER character

Set the current character (the one which is controlled by the user) and change to the scene of this character.

Example:

CHANGE CHARACTER Mother

Changes to the character called 'Mother'.

CHANGE SCENE scene [object]

Change to a scene and set the current character to the scene object. If there is no given scene object the character will be set to the first object of the scene (as shown in the object list in the Editor).

Example:

CHANGE SCENE Forest Grave

Change to the scene 'Forest' and set the current character to the scene object 'Grave'.

SET

SET CONDITION condition [TRUE|FALSE]

Set a condition to true or false.

Example:

SET CONDITION "open door" TRUE

Sets the condition "open door" to true.

SET VALUE value number

Set a value to a number.

Example:

SET VALUE account 1000

Sets the value account to 1000.

SET CURRENTCHARACTER character

Set the current character (the one which is controlled by the user) and change to the scene of this character.

Example:

SET CURRENTCHARACTER Mother

Changes to the character called 'Mother'.

SET CHARACTERTOOBJECT character object

Set a character to a scene object. The scene object is first searched on the current scene. If not found then all objects of all scenes will be searched.

Example:

SET CHARACTERTOOBJECT Daniel "locker (closed)"

Sets the character 'Daniel' to the object 'locker (closed)'.

SET CHARACTERTOSCENE character scene

Set a character to a scene. The character will be set to the first object (as shown in the object list in the Editor) of the scene.

Example:

SET CHARACTERTOSCENE Daniel Forest

Sets the character 'Daniel' to the scene 'Forest'.

SET CHARACTERTOSCENEOBJECT character scene Object

Set a character to a scene object. The object will be searched on the given scene.

Example:

SET CHARACTERTOSCENEOBJECT Daniel Forest Road

Sets the character 'Daniel' to the object 'Road' on the scene 'Forest'.

SET OUTFIT character outfit

Set outfit of a character.

Example

SET OUTFIT Daniel "with hat"

Sets the outfit 'with hat' as the current outfit for the character 'Daniel'.

SET TRACE [ANIMATION|ACTION] [ON|OFF]

Enables/Disables extended messages which are written to the log file.

  • ANIMATION messages for starting and stopping animations.
  • ACTION messages for starting and stopping actions.
  • ON enables and OFF disables the selected message type.

SET CONSOLEALPHA alpha

Set alpha of console font. alpha must be a number between 0 (= transparent) and 100 (= opaque).

Example:

SET CONSOLEALPHA 50

Sets alpha of the console font to half-transparency.

SET CONSOLEFONT fontnr

Set font which is used for the console. fontnr is the position of the font in the font list (as shown in the Editor).

Example:

SET CONSOLEFONT 3

Sets the third font as the current console font.

SET CONSOLEBGCOLOR color

Set the color of the box which is shown under the console output. color is a sequence of 3 hexedecimal color values (each pair represents either red, green or blue). Alternatively the color can also be one of the predefined colors: BLACK, BLUE, CYAN, GRAY, GREEN, DARKBLUE, DARKGREEN, DARKRED, PURPLE, RED, WHITE and YELLOW.

Example:

SET CONSOLEBGCOLOR FF0040

Sets the color of the box to red with a light blue touch (red = 'FF hex', green = '00 hex', blue = '40 hex'). This corresponds to: red = 255, green = 0 and blue = 64.

Example:

SET CONSOLEBGCOLOR GREEN

Sets the color of the box to green.

SET CONSOLEBGALPHA alpha

Set alpha of the box which is shown under the console output. alpha must be between 0 (= transparent) and 100 (= opaque).

Example:

SET CONSOLEBGALPHA 20

Sets the box to a visibility of 20 percent.

SET CONSOLECOMMANDBGCOLOR color

Set the color of the box which is shown under the console command line. color is a sequence of 3 hexedecimal color values (each pair represents either red, green or blue). Alternatively the color can also be one of the predefined colors: BLACK, BLUE, CYAN, GRAY, GREEN, DARKBLUE, DARKGREEN, DARKRED, PURPLE, RED, WHITE and YELLOW.

SET CONSOLECOMMANDBGALPHA alpha

Set alpha of the box which is shown under the console command line. alpha must be between 0 (= transparent) and 100 (= opaque).

SET CONSOLETEXTWRAP [ON|OFF]

Enables/Disables automatic word wrap of the console output.

  • ON lines which are too long will be split up into multiple lines.
  • OFF lines which are too long will be discarded on the screen edge.

Example:

SET CONSOLETEXTWRAP OFF

Disables automatic word wrap of too long output messages.

PRINT

PRINT ANIMATIONS

Print all running animations. This is useful to control if animations of other scenes are still running.

PRINT ACTIONS

Print all running actions. This is useful to control if all actions are running (and stopped) as suggested.

PRINT CONDITIONS

Print all conditions of the game with their current value, sorted by name.

PRINT VALUES

Print all values of the game with their current value, sorted by name.

PRINT SCENES

Print all scenes of the game, sorted by name.

PRINT CHARACTERS

Print all characters of the game, sorted by name.

PRINT CACHE

Shows the contents of the image cache. The cache keeps images in memory (until the cache is full) to speed up loading of images.

PRINT LOG

Print contents of the log file ('messages.log' in projector directory). Please beware that the log file does not get too big (see CLEAR command).

PRINT TEXTURES

Print information of the textures which are stored in graphics memory.

PRINT SOUNDS

Print all loaded sounds. The sounds are either currently playing or loaded into memory (e.g. for walking sounds).

SHOW

SHOW ANIMATIONDETAILS [ON|OFF]

Enables display of all currently loaded animations. The selected animation is shown in a rectangle (256x256) where the currently active frame is shown. If display is enabled then the animations can be scrolled with the 'Page up'/'Page down' keys. No other output is possible while animations are shown.

Example:

SHOW ANIMATIONDETAILS ON

Enables the display of the animations.

SHOW OBJECTANIMATION animation

Start an animation of a scene object.

Example:

SHOW OBJECTANIMATION waterfall water

Starts the animation 'water' which is owned by the scene object 'waterfall'.

SHOW CHARACTERANIMATION character animation

Start a character animation. The animation is searched in the given character.

Example:

SHOW CHARACTERANIMATION Daniel "waving (front)"

Starts the animation 'waving (front)' of the character 'Daniel'.

SHOW SCENE scene

Show a scene. The position of the current character is not changed.

Example:

SHOW SCENE Forest

Shows the scene 'Forest'.

SHOW CHARACTER character

Show a character. The current scene will be changed to the scene where the character is on. The current charcter is not changed.

Example:

SHOW CHARACTER Mother

Changes to the scene where the character 'Mother' is on.

SHOW TEXTURES [ON|OFF]

Enables display of all textures which are stored in graphics memory. If display is enabled then the textures can be scrolled with the 'Page up'/'Page down' keys. No other output is possible while textures are shown.

Example:

SHOW TEXTURES ON

Enables the display of the textures.

ADD

ADD ITEM item

Add the item to the interface of the current character. If the item already exists in the interface then it will not be added a second time.

Example:

ADD ITEM key

Adds the item 'key' to the interface of the current character.

REMOVE

REMOVE ITEM item

Removes the item from the interface of the current character. If the item does not exist in the interface then nothing happens.

Example:

REMOVE ITEM key

Removes the item 'key' from the interface of the current character.

EXEC

Execute a script command. A detailed description about scriping (including all commands) can be found in the scripting documentation.

Example:

EXEC game:setValue(VGameFadeDelay, 1000)

Sets the fade delay for fading to a new scene to 1000 milli seconds.

CLEAR

CLEAR LOG

Clears the complete contents of the log file ('messages.log' in the projector directory).

CLEAR TRACE [ANIMATION|ACTION]

Disables writing extended log messages to the log file. The command is the same as SET TRACE [ANIMATION|ACTION] OFF.