dao::dialogue::Conversation
class
A conversation that is playing. You never create one: Current() and the callbacks give you one.
Declared in dao/Dialogue.h.
Functions
Conversation()
Conversation()=delete
Conversation()
Conversation(const Conversation &)=delete
CurrentLine()
std::optional<std::uint32_t> CurrentLine() const
Returns the index of the most recently spoken line, whether the NPC’s or the player’s.
Returns the index, or nullopt before the first line
File()
std::span<const std::byte> File() const
Returns the raw bytes of the conversation’s file (GFF4, type “CONV”), as the engine loaded it.
The span is valid only while the conversation runs.
LineAt()
std::optional<Line> LineAt(std::uint32_t index) const
Returns a line of the conversation by its index in the file.
Returns the line, or nullopt if the index is past the last line
Listener()
std::optional<ObjectId> Listener(std::uint32_t line) const
Returns who a line is spoken to, worked out the same way as Speaker.
If the line names no listener, it is BeginConversation’s oInitiator, or the controlled character when a creature was told to talk to itself. Call it on the game thread.
| Parameter | |
|---|---|
line |
the line’s index in the file |
Returns the listener’s id, or nullopt if the index is past the last line
operator=()
Conversation & operator=(const Conversation &)=delete
Owner()
ObjectId Owner() const
Returns the conversation’s owner: the creature or placeable it was started with (BeginConversation’s oTarget).
Lines whose speaker is OWNER are spoken by it.
Speaker()
std::optional<ObjectId> Speaker(std::uint32_t line) const
Returns who speaks a line, worked out the same way the engine does for the camera and the lip sync:
- OWNER is the conversation’s owner and PLAYER is the player.
- HENCH:<tag> or HENCH<n> is a party member.
- Any other tag is the creature with that tag near the owner.
If none of these finds anyone, the speaker is the owner. Call it on the game thread.
| Parameter | |
|---|---|
line |
the line’s index in the file |
Returns the speaker’s id, or nullopt if the index is past the last line
~Conversation()
~Conversation()=delete