Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Overview

Excerpt

Send an in-game message to a specific player, your alliance or everyone.

...

 

Syntax

Code Block
theme

...

RDark
languagejavascript
linenumberstrue
chat(to, message);

Parameters

ParameterTypeMandatoryDescriptionGame version
to

Number,

Constant

(tick)

Who should the message be sent to?

  • Specify a player id to send to that specific player
  • Or use one of the following constants:
    Child pages (Children Display)
    alltrue
    depthall
    page

...

  • Player Scope
    excerpttrue
3.2
messageString(tick)The message to send to the recipient.3.2

Return value

...

Not know at present.

...

(question)

Notes

When you send a chat message to another player, it will echo the message to your own eventChat().

Examples

Code Block
theme

...

RDark
languagejavascript
titleSend a message to your allies
linenumberstrue
chat(ALLIES, "Hello friends");
Code Block
theme

...

RDark
languagejavascript
titleSend a message to player 2
linenumberstrue
// remember that players are zero-referenced, so player #1 = 0, player #2 = 1, etc.
chat(1, "Hello player 2");

...

 

See also

...

Div
classbox
Availability
Status
colourYellow
title3.2+

Requires:

  • Warzone 3.2 and above.
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related API features:

  • Player Scope – constants relating to chat messages
  • eventChat() – receive chat messages
  • console() – send a message to the script's player console
  • debug() – send a message to the terminal or logs

Add-on APIs:

  • Babel API – send data objects between scripts using the chat interface.
  • Chat API – define chat commands and orchestrate chat conversations.
  • Util API – its out() function supports chat messages