by popular demand here is a quick example of NPC usage
The example extension uses the AvatarChat client and adds a new room with an NPC that moves around and sends public messages to the people in that same room.
The extension is written in Java, it is very simple and fully commented.
How to test it:
Unzip the archive and copy the it.gotoandplay.extensions.examples.npc package to the javaExtensions/ folder.
Open your config.xml, locate the simpleChat Zone and add the extension like this:
Code: Select all
<Extensions>
<extension name="npcExt" className="it.gotoandplay.extensions.examples.npc.NpcAvatarExample" type="java" />
</Extensions>
Make sure you also add this tag in the general server configuration:
Code: Select all
<EnableNPC>true</EnableNPC>
Finally restart the SmartFoxServer and launch the provided client example (04_avatarChat folder). You will find a new room with a user already inside that interacts with the other real users.
-> Download here