Lua API
On this page

Game

Inherits from

Game interface exposed to scripting environments as global game. A new game instance is created for each script to make event / hud cleanup easier in the case that a script doesn't clean up after itself.

Fields:

AccountName string

read only

The name of the account this client is connected as

ActionQueue ActionQueue

read only

Action Queue

Actions ClientActions

read only

Client actions

Capabilities Capabilities

read only

The capabilities of this game client

Character Character

read only

Information about the currently logged in character. Only valid while logged in, specifically when game.State == ClientState.Entering_Game

CharacterId number

read only

The weenie id of the currently logged in character. 0 if not logged in.

Characters CharacterIdentity[]

read only

A list of characters available on the character select screen. This includes characters pending deletion.

LastTick DateTime

read only

The datetime (UTC) of when the last tick event was fired.

MaxAllowedCharacters number

read only

Maximum number of characters allowed to be created per account on this server.

Messages MessageHandler

read only

Access to ac network message events

ServerName string

read only

The name of the server this client is connected to

State ClientState

read only

The current state of the client. Use this to check if you are logged in, at character select screen, etc.

World World

read only

Information about the world around you. Only valid while logged in, specifically when game.State == ClientState.Entering_Game

Events:

OnRender2D EventArgs

Fired every frame, during 2D rendering

OnRender3D EventArgs

Fired every frame, during 3D rendering

OnScriptEnd EventArgs

Fired when the script tied to this game instance is stopped.

OnStateChanged StateChangedEventArgs

Fired when client state changes. See ClientState for a list of valid states.

OnTick EventArgs

Fired when the gamestate ticks. This is roughly once per second

OnWindowMessage WindowMessageEventArgs

Fired for every window message. You can optionally eat them to prevent them from hitting imgui / game client.

Methods:

GetPropertyKeys() : string[]

Returns a list of strings of all public property / field names. Useful for reflection on UserData in lua scripts

Returns:string[]

ToString() : string

Returns a string that represents the current object.

Returns:string