• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Configuration Configurating NPC.xml Files

frankfarmer

who'r ninja now
Premium User
Joined
Aug 5, 2008
Messages
1,581
Reaction score
80
1. When you open a NPC.xml file it will look like this [in most cases]

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Avar Tar" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
</npc>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|."/>
        <parameter key="message_farewell" value="Goodbye."/>
        <parameter key="message_walkaway" value="Goodbye." />
    </parameters>
This is boring, because when a NPC looks like this, it will only greet the player and will say goodbye to the player. So it have no use actually.

-----------------

2. Too make the NPC more fun to interact with you need to edit it.

How about changing the greet & farewell messages and also adding some keywords

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Avar Tar" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
</npc>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Why are you here?"/>
        <parameter key="message_farewell" value="Farewell |PLAYERNAME|..."/>
        <parameter key="message_walkaway" value="Hmph, you keep walking..." />
[COLOR="Red"]
        <parameter key="module_keywords" value="1" />[/COLOR]
        <parameter key="keywords" value="[COLOR="Blue"]job[/COLOR];[COLOR="Blue"]name[/COLOR];[COLOR="Blue"]quest[/COLOR];" />
        <parameter key="[COLOR="Blue"]keyword_reply1[/COLOR]" value="Im an Avar Tar, you know.. a picture on a forum." />
        <parameter key="[COLOR="Blue"]keyword_reply2[/COLOR]" value="I'd got the name from my master. Nobody understands it." />
        <parameter key="[COLOR="Blue"]keyword_reply3[/COLOR]" value="I know some quests but.. i don't think you will finish them, you low level noob.." />
    </parameters>
Let me explain the keywords functionality

This is very important, you need it to activate the keyword function
Code:
[COLOR="Red"]<parameter key="module_keywords" value="1" />[/COLOR]

This is how the keyword works, you can make 1-100 keywords if you like but remember to change the number 1-2-3-4-5-6 etc.
Code:
<parameter key="keywords" value="job[COLOR="Blue"](keyword1)[/COLOR];name[COLOR="Blue"](keyword2)[/COLOR];quest[COLOR="Blue"](keyword3)[/COLOR];" />
---------------------------------------------
3. If you want to add a function like a hint on what to ask next you do this

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Avar Tar" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
</npc>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|."/>
        <parameter key="message_farewell" value="Farewell |PLAYERNAME|..."/>
        <parameter key="message_walkaway" value="Hmph, you keep walking..." />

        <parameter key="module_keywords" value="1" />
        <parameter key="keywords" value="job;name;quest;" />
        <parameter key="keyword_reply1" value="Im an Avar Tar, you know.. a picture on a forum." />
        <parameter key="keyword_reply2" value="When I was young I did a [COLOR="Red"]{quest}[/COLOR] and i had to find a forum and then I got the name from the administrator. " />
        <parameter key="keyword_reply3" value="I know some quests but.. i don't think you will finish them, you low level noob.." />
    </parameters>
When you put {around} the word it will be highlighted.

Example:

namnlsh.png


--------------

That should do the trick, these are the basics needed to create NPC's.

Good luck!
 
Last edited:
Ty :) I used this today!:p ++rep

btw isnt the script supose to look at this?


Code:
<npc name="Avar Tar" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|."/>
        <parameter key="message_farewell" value="Goodbye."/>
        <parameter key="message_walkaway" value="Goodbye." />
    </parameters>
</npc>
 
Ty :) I used this today!:p ++rep

btw isnt the script supose to look at this?


Code:
<npc name="Avar Tar" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|."/>
        <parameter key="message_farewell" value="Goodbye."/>
        <parameter key="message_walkaway" value="Goodbye." />
    </parameters>
</npc>

Well, that's a good start. Normally, npcs looks like this

Code:
<npc name="Avar Tar" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
</npc>

Then they suck :d
 
You can drop walkinterval/floorchange/health now\max in all of your scripts.
 
You can drop walkinterval/floorchange/health now\max in all of your scripts.

Code:
<npc name="Avar Tar" script="default.lua"
<look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
</npc>

Like that?
 
Code:
<npc name="Avar Tar" script="default.lua"[B][COLOR="Red"][SIZE="4"]>[/SIZE][/COLOR][/B]
<look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
</npc>
keep in mind that walkinterval defaults to 1500, not 2000.
not sure if that changed in 0.3
 
Code:
<npc name="Avar Tar" script="default.lua"[B][COLOR="Red"][SIZE="4"]>[/SIZE][/COLOR][/B]
<look type="73" head="20" body="30" legs="40" feet="50" addons="0"/>
</npc>
keep in mind that walkinterval defaults to 1500, not 2000.
not sure if that changed in 0.3

Great.
 
Great tutorial, finnaly i can create npcs for my ot!
 
Back
Top