• 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!

[NPC] Problem with folders for NPCs

SunMage

New Member
Joined
Jun 1, 2013
Messages
58
Reaction score
4
Hello.

I have another problem I can't get rid of.
Me and my friend are makeing a real map OTserver, and it's going to be ready for launch very soon.

Our goal is to make it like the real tibia as close as possible (but with slightly higher exp/skill/etc).
Now, nothing is really wrong with the server or so, there is just this problem with NPCs.

I have been searching for awhile, for NPCs working exactly like real tibia, but seems like no one have it.
So the only thing I can do is create my own NPCs working just like real tibia.

I'm fine with that and willing to do it, that's not the problem either.
The problem is that I can't make folders for the NPCs.
In real tibia there is a huge amount of NPCs, so to be able to keep track of them as good as possible I would need folders, like "Thais", "Carlin" or "Venore".

I have all my Thais NPCs working 100% correctly and i've tested them in-game, all done by me.
They are currently located in data/npc. They are working.
I tried to make a folder for them (data/npc/Thais). Now they have dissappeared from the map (doesn't spawn basically).

Anyone know what I could do? How do I make folders for the NPCs so that they spawn even when I put them in X folder.

Thanks.
 
You need to create the folder in data/npc/scripts and in NPCNAME.xml change
Code:
script="data/npc/scripts/NPCNAME.lua"
to
Code:
script="data/npc/scripts/Thais/NPCNAME.lua"
 
Create a file inside the npc folder with name npcs.xml and add the following:

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npcs>
<npc name="Teste" file="Thais/Teste.xml"/>
</npcs>
 
You need to create the folder in data/npc/scripts and in NPCNAME.xml change
Code:
script="data/npc/scripts/NPCNAME.lua"
to
Code:
script="data/npc/scripts/Thais/NPCNAME.lua"


I think you sir, misunderstood me, no problems though.
What I want is folders for the NPCs (the .xml files) not for the .lua script files.

- - - Updated - - -

Create a file inside the npc folder with name npcs.xml and add the following:

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npcs>
<npc name="Teste" file="Thais/Teste.xml"/>
</npcs>

I'm testing this right now.

In data/npc I created a file named "npcs.xml" (yes it is a .xml file and the name is just npcs i'm not that dumb :p).
Anyway.
In this .xml file i've typed the following
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npcs>
<npc name="Benjamin" file="Thais/Benjamin.xml" />
<npc name="Naji" file="Thais/Naji.xml" />
</npcs>

To try with just two npcs, don't want to add the whole city if it doesn't work.
My Thais folder is located in data/npc so the correct direction is data/npc/Thais/[NPC].xml.

I've tried changing the code to
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npcs>
<npc name="Benjamin" file="data/npc/Thais/Benjamin.xml" />
<npc name="Naji" file="data/npc/Thais/Naji.xml" />
</npcs>

But that doesn't seem to work either.
None of your two examples works, no offense but they just don't work. Thank you for your help.
Anyone else?
 
That´s why :)
The way that i told to you only works in 0.3 version´s (maybe 0,4 too).

Im reading the 0.2 version code (npc.cpp) and in the constructor he uses:
PHP:
m_filename = "data/npc/" + _name + ".xml";

So for this version the only way as i see is to change the source code.

Maybe others guys may know something for this 0.2 version.

Regards,
 
Well if that's the case then I will check it out, need to do a lot of backups though.


Still looking for help, using Latest TFS version for [9.80-9.86] (v0.2.15).

- - - Updated - - -

I guess no one knows how to fix the problem.
 
Last edited:
Well you could change the sources, look at source from 0.3.6 and re compile the ability in 0.2

Or create an info base, make text file named for each city and list the NPC names
 
Re compile with the ability to do it with code from 0.3.6

Or

Just make a text document for each town, and add the NPc names to it so that you can easily find which ones
 
Back
Top