- summary: Answers an NPC by picking one of the replies it offered.
- area: Game.Npc
Answers an NPC by picking one of the replies it offered.
Kind request · Area Game.Npc
ANSWERS THE QUESTION THE NPC JUST ASKED. One id: the reply you picked.
WHEN TO SEND IT
ONLY WHILE A DIALOGUE QUESTION IS OPEN, and only with a reply id that question
actually offered (NpcDialogQuestionEvent.visible_replies). The reply ids are not global constants you can hardcode - each
question arrives carrying its own list, and the client never invents one. Sending
an id the current question did not offer is not a different answer, it is an
invalid one.
THREE WAYS IN, ONE MESSAGE. The real client sends this from a reply button, from confirming the highlighted reply, and from taking the first reply when the dialogue validates itself. All three raise the same intent with the same single value, so a script only needs one path: decide which reply, send its id.
ONE ANSWER PER QUESTION. The dialogue is a turn-taking exchange - answer, wait for what comes back, answer again. Do not queue several replies ahead; the ids of the next question do not exist yet when you send this one.
WHAT COMES BACK
EITHER THE NEXT QUESTION (NpcDialogQuestionEvent) OR THE DIALOG CLOSING - and
which one you get is the NPC's decision, not yours. A reply that ends the conversation produces a dialog
close rather than another question, so treat "no new question" as a normal
outcome and watch for DialogLeaveEvent with the dialogue type, which is how
the client learns the exchange is over.
Nothing here is correlated: the envelope uid goes out as -1 and there is no response to match against.
THE SECOND DECLARED MEMBER IS PADDING. No dumped client has ever written it.
When you may send it
- Requires
context_readyobserved - Requires
npc_dialog_openinferred - Raised by: a client-side state change: the player choosing one of the replies the NPC dialogue is showing - by clicking a reply button, by confirming the highlighted one, or by taking the first reply when the UI validates itself. All three raise one intent carrying the reply id inferred
Related messages
- You will then receive
NpcDialogQuestionEventinferred — the next line of the conversation, when the reply leads somewhere; a reply that ends the conversation closes the dialog instead (DialogLeaveEventof type DIALOG_DIALOG)
Fields
| # | Field | Type | Meaning | You set it |
|---|---|---|---|---|
| 1 | reply_id | int32 | The reply you picked, by the id the question offered. | required |