The addBotChat native AI script function adds an entry to the botchat (contextual interaction) menu of every bot in the group. The entry format follows the same syntax as the bot_chat_parameters property in World Editor primitives.
After adding entries, the updated chat profile is automatically sent to EGS to sync with connected clients.
()addBotChat(entry: s)
The entry string is parsed by the same system that handles bot_chat_parameters in World Editor. Common formats:
| Format | Description |
|---|---|
shop:CATEGORY_NAME |
Add a shop with the specified category (defined in shop_category.cfg) |
item:sheet_id quality [price] |
Add a specific item for sale |
mission:MISSION_NAME |
Add a mission offering |
web:MENU_TEXT url |
Add a web page link |
menu:MENU_ID RESPONSE_ID |
Add an informational menu entry with a text response |
The menu and web text identifiers reference translation phrase IDs defined in the leveldesign translation files.
// Add a shop to the NPC
()addBotChat("shop:FYROS_WEAPON");
// Add a web link
()addBotChat("web:MENU_RING_ENTRY ring_access_point=1");
// Add an informational menu entry
()addBotChat("menu:MENU_WHOAMI WHOAMI_GUARD");
web: entries)Source: ryzom/server/src/ai_service/nf_grp_npc.cpp (addBotChat_s_)