Versions Compared

Key

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

Outputs text to the terminal or log file depending on operating system.

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
try {
  debug(text);
} catch(e) {
  console(e.message); // error occurred
}

Parameters

ParameterTypeMandatoryDescriptionGame version
textString(tick)The text to output to the command line.3.1 Beta 1

Return value

ValueTypeDescriptionGame version
undefinedUndefinedThe text was successfully sent to the console / logs.3.1 Beta 1
<error>ErrorIf something went wrong, eg. unable to write to the logs, an error will be thrown.3.1 Beta 1

Example

Code Block
themeRDark
languagejavascript
titleSend some text to the terminal
linenumberstrue
debug("Greetings Commander!");

Notes

As of Warzone 3.1 RC3 (and earlier) the output will go to different places depending on operating system:

Operating SystemOutput location
Microsoft Windows

Windows Debugger

Duha's Debug Reader provides an easier way to see the output.
Apple OS X

System console (also known as "System Messages")

View using Console.app.

Linux

Linux console

There are some plans to update the debug() function so that it always outputs to the Warzone log file regardless of operating system.

Messages sent using debug() can be put in to the Warzone log file by using the command line option:

warzone2100 --debug=script

Div
classbox suggest

This page not what you were looking for?
Maybe you meant Debug Menu instead?

Div
classbox
Availability
Status
colourYellow
title3.1 b1+

Requires:

  • Warzone 3.1 Beta 1 and above.
  • (warning)Broken in Warzone 3.1 Beta 4
    (fixed in beta 5).

Changes are likely in future release (see Notes).

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See Also

Related API features:

  • hackAssert() – throw an error and game assert if a value is falsey
  • console() – send a message to the in-game console
  • chat() – send a message using in-game chat

Add-on APIs: