Stendhal Quest Coding - Part 2: Difference between revisions
Content deleted Content added
imported>Hendrik Brummermann No edit summary |
imported>Kymara |
||
Line 28:
[[Image:npc simple.png]]
Currently our NPC knows two states: IDLE for walking around and ATTENDING for talking to a player. You can change between states by talking to the NPC. So if the NPC is IDLE, it will accept "hi" and move on to the
So, lets return to our example. We want the NPC to reply to "yes" and "no" but only after the quest question was asked. So we add a third state called QUEST_OFFERED. When the player says "quest", the NPC goes to that state. On "yes" or "no" it returns to ATTENDING.
Line 74:
</source>
As you can see, we now have to use "add()" instead of "addReply()" and that
We have predefined a number of states in the class [http://arianne.cvs.sf.net/viewvc/arianne/stendhal/src/games/stendhal/server/entity/npc/ConversationStates.java?view=markup ConverstationStates] that you can and should use.
| |||