Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Outputs text to the player console associated with the script.

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
console(text[, text[, ...]]);

Parameters

ParameterTypeMandatoryDescriptionGame version
textString(tick)

The text to output to the console.

If you pass multiple parameters, each string will be output on a new line.

(warning) Maximum 255 characters per string.

3.1 Beta 1

Return values

ValueTypeDescriptionGame version
undefinedUndefinedNo errors occurred, so if the human was watching your script's player then they will have seen the text in the console.3.1 Beta 1
<error>Error(question) I assume an error will be thrown if something went wrong deeper in the C++ code.3.1 Beta 1

Example

Code Block
themeRDark
languagejavascript
titlePut some text in the console
linenumberstrue
console("Greetings Commander,", "Welcome to Warzone!");

Notes

The following characters are silently removed from strings output to the console: @

If you specify a string greater than 255 characters long, only the first 255 characters will be output – the rest will be silently discarded.

Div
classnotice box ping

The console() output is only displayed if the human player uses the Debug Menu to select the player the script is associated with. So, by default, a human player won't see console messages issued by AI bots.

Div
classbox
Availability
Status
colourGreen
title3.1 b1+

Requires:

  • Warzone 3.1 Beta 1 and above.
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related API features:

  • debug() – outputs text to the terminal or log files
  • chat() – send messages to other players via the in-game chat system

Add-on APIs: