Global

Members

(readonly) CommandType :number

Console command and variable types.

Type:
  • number
Properties:
Name Type Description
COMMAND number

A command.

INT number

An integer variable.

INT64 number

A 64-bit integer variable.

FLOAT number

A floating-point variable.

STRING number

A string variable.

Source:

(readonly) DewErrorCode :number

Error codes.

Type:
  • number
Properties:
Name Type Description
OK number

The method ran successfully.

UNKNOWN_ERROR number

An unknown error occurred while running the method.

JS_EXCEPTION number

A JavaScript exception occurred while running the method.

BAD_QUERY number

A game communication error occurred.

UNSUPPORTED_METHOD number

The method is not supported by the game.

INVALID_ARGUMENT number

An invalid argument was passed to the method.

NETWORK_ERROR number

An error occurred while performing a network operation.

NOT_AVAILABLE number

The requested information is not available.

COMMAND_FAILED number

The console command failed to execute successfully.

Source:

(readonly) GameMode :number

Game modes.

Type:
  • number
Properties:
Name Type Description
NONE number
CTF number
SLAYER number
ODDBALL number
KOTH number
FORGE number
VIP number
JUGGERNAUT number
TERRITORIES number
ASSAULT number
INFECTION number
Source:

(readonly) MPEventAudience :number

Multiplayer event audiences.

Type:
  • number
Properties:
Name Type Description
CAUSE_PLAYER number
CAUSE_TEAM number
EFFECT_PLAYER number
EFFECT_TEAM number
ALL number
Source:

(readonly) MPEventCategory :number

Multiplayer event categories.

Type:
  • number
Properties:
Name Type Description
GENERAL number
FLAVOR number
SLAYER number
CTF number
ODDBALL number
FORGE number
KOTH number
VIP number
JUGGERNAUT number
TERRITORIES number
ASSAULT number
INFECTION number
SURVIVAL number
WP number
Source:

Type Definitions

ConsoleCommand

Contains information about a console command and its current state.

Type:
  • object
Properties:
Name Type Description
type CommandType

The type of the command or variable.

module string

The module name.

name string

The name of the command or variable. This includes the module prefix.

shortName string

The short name of the command or variable.

description string

A description to display in a help listing.

value *

The current value of the variable. For commands, this will be null.

defaultValue *

The default value of the variable. For commands, this will be null.

minValue *

The minimum value of the variable. For string variables and commands, this will be null.

maxValue *

The maximum value of the variable. For string variables and commands, this will be null.

replicated boolean

true if the variable should be synchronized to clients.

archived boolean

true if the variable should be saved when the config file is written.

hidden boolean

true if the command or variable should be omitted from a help listing.

hostOnly boolean

true if the command or variable can only be used by the game host.

hideValue boolean

true if the variable's value should be omitted from a help listing.

internal boolean

true if the command or variable can only be set internally.

arguments Array.<string>

A list of arguments for the command. Each string will contain a value name, a space, and then a description. For variables, this will be empty.

Source:
See:

DewPromise

A promise made by an asynchronous ElDewrito method.

If the promise is rejected for a reason related to ElDewrito, it will be rejected with a DewError object. This object includes an error code which can be used to easily figure out what went wrong.

If the promise is rejected for any other reason, it may be rejected with a generic Error. Therefore, you must use instanceof DewError to check that the error is actually an ElDewrito error before getting specific information.

Type:
  • Promise.<(*|Error)>
Source:

EventCallback(event)

A callback function for responding to events.

Parameters:
Name Type Description
event object

The event information.

Properties
Name Type Description
event string

The name of the event.

screen string

The ID of the screen the event was sent to.

data string

Event-specific data.

Source:

GameVariantInfo

Contains information about a game variant.

Type:
  • object
Properties:
Name Type Description
mode GameMode

The base game mode.

name string

The name. Can be empty.

description string

The description. Can be empty.

author string

The author. Can be empty.

teams boolean

true if teams are enabled.

timeLimit number

The time limit in minutes (0 if unlimited).

rounds number

The number of rounds.

scoreToWin number

The score-to-win (-1 if unlimited).

Source:
See:

MapVariantInfo

Contains information about a map variant.

Type:
  • object
Properties:
Name Type Description
name string

The name. Can be empty.

description string

The description. Can be empty.

author string

The author. Can be empty.

mapId number

The map ID.

Source:
See:

ScoreboardInfo

Contains information about the scoreboard.

Type:
  • object
Properties:
Name Type Description
hasTeams boolean

true if the current session has teams.

teamScores Array.<number>

The scores of all of the teams in the game.

gameType string

The gamemode type.

players Array.<ScoreboardPlayer>

Players listed on the scoreboard.

Source:
See:

ScoreboardPlayer

Contains information about a player on the scoreboard.

Type:
  • object
Properties:
Name Type Description
name string

The player's name.

team number

The player's team index.

color string

The player's primary armor color.

UID string

The player's UID.

kills number

The number of kills.

assists number

The number of assists.

deaths number

The number of deaths.

score number

The player's score.

Source:
See:

SessionInfo

Contains information about the current game multiplayer session

Type:
  • object
Properties:
Name Type Description
established boolean

true if a session is established.

hasTeams boolean

true if the current session has teams.

isHost boolean

true if the player is the host of the session.

mapName string

Name of the currently loaded map.

Source:
See:

StatsInfo

Contains information about the player's stats

Type:
  • object
Properties:
Name Type Description
medals Array.<number>

The medals earned during this game.

weapons Array.<WeaponStats>

Information about the weapons used during this game.

Source:
See:

WeaponStats

Information about a weapon's use in the current game

Type:
  • object
Properties:
Name Type Description
BetrayalsWith number

How many times the player used this weapon to betray their teammates.

HeadshotsWith number

How many headshots the player got with this weapon.

KilledBy number

How many times the player was killed by this weapon.

Kills number

How many kills the player got with this weapon.

SuicidesWith number

How many times the player killed themselves with this weapon.

Source:
See:

Events

chat

Fired when a chat message is received.

Type:
  • object
Properties:
Name Type Description
message string

The chat message. Make sure to escape this properly before displaying it.

sender string

The username that sent this message. Make sure to escape this properly before displaying it.

chatType string

The type of message that was received. Can be "GLOBAL", "TEAM", "WHISPER", or "SERVER".

teamIndex number

The team index of the player. Not included when chatType is "SERVER".

UID string

The UID of the player. Not included when chatType is "SERVER".

color string

The hex color of the player's primary armor color. Not included when chatType is "SERVER".

Source:

console

Fired when a line is written to the in-game console.

Type:
  • object
Properties:
Name Type Description
line string

The line that was written. Make sure to escape this properly before displaying it.

Source:

hide

Fired after the current screen is hidden.

Type:
  • object
Source:

loadprogress

Fired when the loading screen is active and the loading progress changes.

This event is only sent to visible screens.

Type:
  • object
Properties:
Name Type Description
currentBytes number

The current number of bytes that have been decompressed.

totalBytes number

The total number of bytes that need to be decompressed.

Source:

mpevent

Fired when a multiplayer event occurs that affects the local player.

Type:
  • object
Properties:
Name Type Description
name string

The internal name of the event.

category MPEventCategory

The event's category.

audience MPEventAudience

The audience that the event is intended for.

Source:

pong

Fired when a server replies to a ping. This can only be received while the screen is active.

Type:
  • object
Properties:
Name Type Description
address string

The IP address of the server.

latency number

The round-trip time of the ping in milliseconds.

timestamp number

A timestamp value representing when the ping was sent.

Source:

scoreboard

Fires when the scoreboard is updated

Type:
Source:

serverconnect

Fired when attempting to connect to a server and when the connection succeeds or fails.

Type:
  • object
Properties:
Name Type Description
connecting boolean

True if the client is currently trying to connect to the server.

success boolean

True if the client successfully connected to the server. Will always be false if connecting is true.

Source:

show

Fired after the current screen is shown. The data passed to this event is the data that was passed to dew.show.

Type:
  • object
Source:

signal-ready

Fired when the game client receives the websocket connection information packet.

Type:
  • object
Properties:
Name Type Description
server string

The ip + port of the signal server in the format ip:port

password string

The password assigned for the client to connect with

Source: