This AI is still in early stages of development.
Conversation Descriptor Object
- Aubergine
Properties
Parameter | Type | Notes | API Version |
---|---|---|---|
id | Number | The player ID this object is associated with. | 1.0 |
expires | Number | The real-world universal time, expressed in milliseconds since 1st Jan 1970, at which this conversation will expire. You can quickly determine if a conversation is active for a given player using the chat.isActive() function. | 1.0 |
fn | Conversation Handler Function | The function that will handle messages in a conversation. You can change this at any time if you want to use a different handler for conversations with that player. | 1.0 |
message | String | The most recent message from the player, even if it was not processed by Chat API. In your handler functions, this will always be the message that the handler receives (but as a single string instead of an array of words). | 1.0 |
<other> | Variant | You can store any number of other properties on the object, for example to track previous conversations or commands, etc. The properties only last for the current session and will not be persisted in savegames. | 1.0 |
Example
var p4conv = chat.get(4); // get player 4's conversation object if (now < p4conv.timeout) { // conversation still active } if chat.isActive(4) { // conversation still active } // set a different function to handle this conversation p4conv.fn = someNewHandlerFn; // add custom "foo" property with value "bar". p4conv.foo = "bar";
Contents
Jump to:
Chat API
Topics:
- Chat API Diagnostics — The Chat API provides the following diagnostic routines...
- Conversation Descriptor Object — Each player is assigned a Conversation Descriptor Object that defines the current state of their chat conversation...
- Conversation Mode — Quick start guide for making and using conversations...
- chat.isActive() — Determine conversation state for a specific player.
- chat.get() — Get the object associated with a multi-message conversation with a specific player.
- chat.stop() — Stop a conversation with a specific player.
- chat.extend() — Extend the "Time to Live" of the most recent conversation with a player.
- Conversation Handler Functions — How to define a conversation handler function....
- chat.start() — Start a multi-message conversation with a player.
- Command Mode — Quick start guide for creating and using commands...
- Command Handler Functions — How to define a command handler function....
- chat.on() — Define a chat command and it's handler function.