- summary: Ask an NPC on the current map to run one of its actions.
- area: Game.Npc
- confidence: 0.88
Ask an NPC on the current map to run one of its actions.
- Kind request
- Area Game.Npc
- Named by gamemapping, beta
WHEN TO SEND IT
Send it when the player picks one of the actions an NPC offers - talk, open its shop, and so on. You need three things, and all three must agree:
the NPC's id the contextual id of the NPC ON THIS MAP, not a data id. It is the id the map sent you for that actor, and it is routinely NEGATIVE. Do not invent it and do not carry it across maps. the action id which of that NPC's actions you want. Small integer. the map id the map you are on RIGHT NOW.
Sending it before the map is loaded, with an NPC that is not on that map, or with an action that NPC does not offer, is refused.
WHAT COMES BACK
Nothing, when it works - the action itself answers. Opening a dialogue answers with the dialogue's own messages; opening a shop answers with the shop's. On refusal the server sends a failure event that carries no payload, so it tells you THAT it failed and never why.
SO DO NOT WAIT ON A REPLY TO THIS MESSAGE. Wait on the action you asked for, and treat the empty failure as your only negative.
WHY THE MAP ID IS IN HERE
It is the server's guard against a stale click: the NPC id alone is ambiguous once you have changed map, and this pins the request to the map the player was actually looking at.
When you may send it
- Requires
context_readyobserved - Requires
character_loadedinferred
Related messages
- You will then receive
NpcGenericActionFailureEventinferred — the ONLY answer this request gets, and only on refusal; success is answered by the action itself
Fields
| # | Field | Type | Meaning | You set it |
|---|---|---|---|---|
| 1 | npc_map_id | int64 | The map the player is on. Guards against a stale click. | required |
| 2 | npc_action_id | int32 | Which of that NPC's actions to run. Small integer. | required |
| 3 | npc_id | int32 | The NPC's contextual id on the current map. Usually negative. | required |
Recovered with score 310, confidence 0.88, margin 240 over the runner-up. A margin close to the score means nothing else came near; a thin margin means a decoy nearly won. Members recovered: 3 of 3.
Aucun avis à afficher.