- A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z -
Other
| .:. IF SEMANTIC |
SEMANTIC Semantic matching lets an NPC react to what a player means, not to exact words. A language model compares what the player said or emoted with a short description you write. 1. Attach the program with the SEMANTIC trigger: mprogadd <mob vnum> <prog vnum> semantic 0 all It runs whenever a player says or emotes something in the room. 'all' runs on everything; any other phrase runs only when the text contains it. NPCs never set it off, and the trigger itself does not ask the model. 2. Ask the model with 'if semantic <description>': if semantic asks how much it costs to cross the river emote names his price. "Two silver marks, friend." elseif semantic asks where the ferry goes emote points across the river. "Tar Valon, of course." endif The program waits for the answer (at most 60 seconds), then carries on. 'if semantic' is true when the answer is match. Each 'semantic' line the program reaches asks the model once; an 'elseif semantic' is only asked when the lines before it did not match. 3. Check the other answers with 'semmatch': if semantic tries to slow their breathing; any honest attempt counts emote nods. "Good." elseif semmatch mismatch emote sighs. "No, child. Breathe slowly first." elseif semmatch unclear emote frowns. "Show me what you did." elseif semmatch busy emote raises a hand. "A moment, child." endif match - it fits your description mismatch - it clearly does not unclear - the model cannot tell busy - nothing was judged: the model is unavailable or too slow, or too many questions are already waiting Handle only the answers you need; an answer with no branch gets no reply. With an 'all' trigger, leave out mismatch unless the NPC should answer every unrelated remark made in the room. Writing descriptions: - Describe what the player says or does: "asks to be taught to channel". - Put your rules in the description, e.g. "any genuine attempt counts, even a failed one". The model sees only your description and the player's say or emote, nothing else about the game. - Never let the model decide rewards. Check skills and memories with normal if-checks, and give rewards with normal commands. Conversations with several steps: keep the player's step in a memory and check it first, so each step asks the model only once (see 'help mob memory'). Good to know: - 'if semantic' only works in programs started by the SEMANTIC trigger; anywhere else the answer is always busy. - While a player waits for an answer from an NPC, their further says and emotes do not set off that NPC. - If the player or the NPC leaves, the player disconnects, or the program is edited before the answer arrives, the program stops there. - If the MUD has no model configured, every answer is busy. See also: MOB TRIGGERS, MOB FUNCTIONS, MOB MEMORY, CANLEARN, MPROGADD |
| :: Beginning |

