Client Mandatory Functions

Client mandatory functions are called by engine and therefore must be defined for server to start.

start
Syntax: bool start  Returns: If you return false, the game will not start. Description: Called when client starts or when the module client_main is reloaded.

loop
Syntax: uint loop  Returns: Time in milliseconds, after which the function will be called again. If 0 is returned, this function won't be called again. Description: Called periodically with frequency specified by returned value.

render_map
Syntax: void render_map  Description: Called by client to render map layer. DrawMap* functions can be used only here. This function is called before interface rendering.

render_iface
Syntax: void reder_iface  Description: Called by client to render interface layer. Draw* functions can be used only here.

get_elevator
Syntax: bool get_elevator ( uint type, uint[]& data ) Parameters: type</tt> - type of the elevator, see defined elevator types data</tt> - data required to create the elevator interface, see elevator data format Returns: True if the interface can be created, false otherwise. Description: Called when client needs to build the interface for an elevator.

out_message
<p style="margin-left: 40px">Syntax: bool out_message ( string& message, int& sayType )</tt> Parameters: message</tt> - text of the message sayType</tt> - type of the message (see defined say types)''' Returns: If you return false the message is not sent. Description:''' Callled when a message is sent by the client.

in_message
<p style="margin-left: 40px">Syntax: bool in_message ( string& message, int& sayType, uint& critterId, uint& delay )</tt> Parameters: message</tt> - text of the message sayType</tt> - type of the message (see defined say types) critterId</tt> - id of the critter which sent the message delay</tt> - how long the message is displayed. By default delay = [TextDelay (client preference) + message length * 100] ms. Description: Callled when client receives a message generated by a critter.

map_message
<p style="margin-left: 40px">Syntax: bool map_message ( string& message, uint16& hexX, uint16& hexY, uint& color</tt> , uint& delay </tt>  )</tt> Parameters: message</tt> - text of the message hexX, hexY</tt> - coordinates of the message color</tt> - color of the message delay</tt> - how long the message is displayed. By default delay = [TextDelay (client preference) + message length * 100] ms. Description: Callled when client receives a message generated by map.

item_description
<p style="margin-left: 40px">Syntax: <tt>string item_description ( ItemCl& item, int lookType )</tt> Parameters: <tt>item</tt> - item for which the decription is created <tt>lookType</tt> - type of item description (see defined item look types)''' Returns: A string describing the item. Description:''' Callled when it's necessary to create a description for an item.

critter_description
<p style="margin-left: 40px">Syntax: <tt>string critter_description ( CritterCl& cr, int lookType )</tt> Parameters: <tt>cr</tt> - item for which the decription is created <tt>lookType</tt> - type of item description (see defined critter look types)''' Returns: A string describing the critter. Description:''' Callled when it's necessary to create a description for a critter.

generic_description
<p style="margin-left: 40px">Syntax: <tt>string generic_description ( int descType, int& offsX</tt> <tt>, int& offsY</tt> <tt> )</tt> Parameters: <tt>descType</tt> - type of description (see defined generic description types) <tt>offsX, offsY</tt> - offsets of text, by default it's 0''' Returns: A string with description Description:''' Callled when it's necessary to create a generic description in game.