HowToAddMapsServerStendhal: Difference between revisions
Content deleted Content added
imported>Kymara add navigation for developers |
imported>Kymara add how to set configurator class and dont use ilisa as example. shes mixed java xml now. make it fictitious |
||
Line 155:
<pre>
SpeakerNPC npc = new SpeakerNPC("
protected void createPath() {
List<Node> nodes=new LinkedList<Node>();
Line 164:
protected void createDialog() {
// Lets the NPC reply with "Hallo" when a player greets
addGreeting();
// Lets the NPC reply when a player says "job"
Line 202:
And then create a dialog. Dialogs and such are explained in Quest sections, but you should find the exmaple above covers most options and the options like addHelp are quite self-explanatory.
* setting its class to a PNG image that exists at ''data/sprites/npc''
* setting its outfit with setOutfit method.
Line 210:
Once that is done add the NPC to zone using ''zone.add()'' method.
We need to tell the zone to load this configuration class file. The NPC in the example lives in the ados area, so the information is stored in data/conf/zones/ados.xml. The map she's on is called int_ados_magician_house, so the information is inside the <zone name="int_ados_magician_house" file="interiors/ados/magician_house.tmx"> </zone> section.
To load the java class file you created just add the line
<configurator class-name="games.stendhal.server.maps.ados.magician_house.WizardNPC" />
right after the <zone ... tmx">
Check the location of the file matches the path set in the class name!
=== The mixed xml-java way ===
| |||