Script console

From Arx Libertatis Wiki
Jump to: navigation, search

This article is a stub - you can help by expanding it. See the Wiki FAQ.

Arx Libertatis 1.2 and newer comes with a console that can run arbitrary script commands.

In debug builds and development snapshots the console can be opened using a configurable hotkey (` by default).

In release builds the following cheat spell opens the console:

Aam Rune (create)Mega Rune (increase)Stregum Rune (magic)Comunicatum Rune (control)Spacium Rune (field) Aam Mega Stregum Comunicatum Spacium (create increase magic control field)

You do not need to have the runes to cast this spell. Casting the spell once unlocks the console, after which it can be opened using the normal hotkey.

Commands

Some commands are listed on the wiki.

Others can be discovered using the console's suggestion and auto-complete features or by browsing the source code.

Script commands can be preceded by an entity ID followed by a period (.) to specify the context for the command. If no entity is specified, the player entity will be used.

Controls

The console implements a number of features and readline-like hotkeys common in various shells as well as auto-completions for the context entities and command names.

Exiting

While the console is open, any hotkeys that generate text input no longer work. Other hotkeys and mouse input are not blocked.

The console can be exited at any time using the Esc key.

Cursor movement

  • Move left one character: or Ctrl+B
  • Move right one character: or Ctrl+F
  • Move left one word: Ctrl+←
  • Move right one word: Ctrl+→
  • Move to the start: Home or Ctrl+A or Shift+←
  • Move to the end: End or Ctrl+E or Shift+→

Running commands

  • Run command and clear line: Enter or Ctrl+J
  • Run command and move cursor to the end: Ctrl+O
  • Pasting commands using Ctrl+V which have newlines at the end
    This also works for multiple lines.

Editing

  • Erase the character left of the cursor: Backspace or Ctrl+H
  • Erase the character right of the cursor: Delete or Ctrl+D
  • Erase the word left of the cursor: Ctrl+Backspace or Ctrl+W
  • Erase the word right of the cursor: Ctrl+Delete
  • Erase everything to the left: Ctrl+Shift+Backspace or Ctrl+U
  • Erase everything to the right: Ctrl+Shift+Delete Ctrl+K
  • Clear the input: Ctrl+C
  • Paste clipboard contents: Ctrl+V
    If the clipboard contains multiple lines, all of them except for the last one will be immediately executed.

Suggestions

Suggestions will be shown below the command-line whenever the cursor is at least one character into the context entity id or command name.

  • Select the next suggestion: or PageDown or Ctrl+N
  • Select the previous suggestion: or PageUp or Ctrl+P

Using ↑', PageUp or Ctrl+P when the first suggestion is selected will restore the original command.

Using Tab, editing the command or moving the cursor in any way will finalize the selection and show new suggestions based on that.

If the cursor is not at the end of the line, the selected suggestion will be merged with the orignal line.

Auto-completion

Additionally, the console is able to automatically complete the prefix that is the same for all suggestions:

  • Auto-comlete: Tab or Ctrl+I
  • Insert one character from auto-completion: or Ctrl+F (if cursor is at the end)

Additionally, the selected entity (using mouse click) will be available for completion using Tab or Ctrl+I if the cursor is at the start of the line. This works even if there is already a command entered, in which case it will replace any existing context entity id but leave the rest of the command alone.

Command history

The console keeps a record of previously executed commands which can be browsed similar to suggestions:

  • Select the next newest history entry: or PageDown or Ctrl+N
  • Select the next oldest history entry: or PageUp or Ctrl+P

Using or PageDown or Ctrl+N when the history entry is selected will restore the original command.

Using Tab, editing the command or moving the cursor in any way will finalize the selection and show new suggestions based on that.

If the cursor is not at the start of the line, only those history entries prefixed by the text before the cursor will be browsed.