Stendhal NPC Coding: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
imported>Kymara
No edit summary
Line 134: Line 134:


We set its outfit either by:
We set its outfit either by:
* setting its class to a PNG image that exists at ''data/sprites/npc'', e.g. <code>npc.setEntityClass("welcomernpc");</code>
* setting its class to a [[StendhalRefactoringGraphics#NPCs|PNG image]] that exists at ''data/sprites/npc'', e.g. <code>npc.setEntityClass("welcomernpc");</code>
* setting its outfit with setOutfit method e.g. <code>npc.setOutfit(new Outfit(0, 05, 01, 06, 01));</code>. See [http://stendhalgame.org/hudson/job/stendhal_HEAD/javadoc/games/stendhal/server/entity/Outfit.html Outfit javadoc]
* setting its outfit with setOutfit method e.g. <code>npc.setOutfit(new Outfit(0, 05, 01, 06, 01));</code> - see [http://stendhalgame.org/hudson/job/stendhal_HEAD/javadoc/games/stendhal/server/entity/Outfit.html Outfit javadoc]


It is nice to set a description for when the player does ''Look''. If you don't set one, it will just say: ''You see [NPC Name].''
It is nice to set a description for when the player does ''Look''. If you don't set one, it will just say: ''You see [NPC Name].''