Class engine.Chat

Handle chats between the player and NPCs

Methods

engine.Chat:init (name, npc, player, data)

Init

engine.Chat:getChatFile (file)

Get chat file Also has support for chat files in addons

engine.Chat:switchNPC (npc)

Switch the NPC talking

engine.Chat:addChat (c)

Adds a chat to the list of possible chats

engine.Chat:invoke ([id=self.default_id])

Invokes a chat

engine.Chat:get (id)

Gets the chat with the given id

engine.Chat:replace (text)

Replace some keywords in the given text



Methods

engine.Chat:init (name, npc, player, data)
Init

Parameters:

  • name string used to load a chat file
  • npc Actor the NPC that the player is talking to
  • player Actor the player
  • data table
engine.Chat:getChatFile (file)
Get chat file Also has support for chat files in addons

Parameters:

  • file string /data*/chats/{file}.lua
engine.Chat:switchNPC (npc)
Switch the NPC talking

Parameters:

Returns:

    NPC we switched from
engine.Chat:addChat (c)
Adds a chat to the list of possible chats

Parameters:

engine.Chat:invoke ([id=self.default_id])
Invokes a chat

Parameters:

  • id string the id of the first chat to run (default self.default_id)

Returns:

    engine.dialog.Chat
engine.Chat:get (id)
Gets the chat with the given id

Parameters:

  • id string the id of the chat

Returns:

    Chat
engine.Chat:replace (text)
Replace some keywords in the given text

Parameters:

  • text string @playername@, @npcname@, @playerdescriptor.(.-)@
generated by LDoc 1.4.3