Stendhal Quest Coding - Part 2: Difference between revisions
Content deleted Content added
imported>Kymara |
imported>Kymara |
||
Line 113:
== Teaching the NPC to remember the player ==
Okay, lets get back to the topic: Hayunn needs a long term memory in order to only accept one
The long term memory is called "quest slot". It is basically a hash table
<source lang="java">
public static final String QUEST_SLOT = "beer_hayunn";
</source>
That's the name of the slot we are using. It has to be unique, but other than that, we can write anything we want in there. There are, however, two conventions that make things a lot easier: Multiple values are separated by an ";" without space. And the terms "done" and "rejected" are used to denote a complete or rejected quest. There
Having said that, let us make Hayunn check the quest state and reply accordingly:
Line 152:
</source>
Note that
The next step is to save that the quest was completed. We take a simple approach for the moment and only check that the player owns a beer:
| |||