HowToAddMapsServerStendhal: Difference between revisions

Content deleted Content added
imported>Chad3f
imported>Kymara
Adding NPC: updated tyo make you always add to list. pls check xx
Line 113:
Usually we add NPC to make world more alive and to use them in Quests. It is because of that reason, that is so important that you add NPC on the zone they are.
 
First, you should decide if you're going to use your NPC later in a quest.
 
''npcs.add("name",new SpeakerNPC()...)'' simply creates a new NPC thatand hasadds dialogsit butto willa notglobal participatelist laterso onnext anytime particularyou need to get the NPC for participating in a quest, or if you want to teleportto it, you can call it by its ''name'' using ''npcs.get(name)''
<pre>
npc=new SpeakerNPC()
{
 
};
npc.setName("name");
</pre>
 
Notice that in this case, you have to specify the name later in ''npc.setName()''
 
''npcs.add("name",new SpeakerNPC()...)'' creates also a new NPC '''and besides''' adds it to a global list so next time you need to get the NPC for participating in a quest you can call it by its ''name'' using ''npcs.get(name)''
<pre>
NPC npc=npcs.add("name",new SpeakerNPC()
Line 137 ⟶ 125:
 
 
In other words, ''new SpeakerNPC()'' creates just a new NPC of the class SpeakerNPC but with ''npcs.add("name",new SpeakerNPC()...)'' you are in fact extending SpeakerNPC to add new functionality.