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

Windows TFS 0.3.6, T 8.6. Best and fastest way to produce 100 NPCs?

Sinth

Argardh.com
Joined
Jan 14, 2015
Messages
721
Reaction score
133
Location
Cambodia
I have most or all NPC-packs but I'm not so familiar with how it all works. There's the old style aka everything is written in the .xml right? The talks and the eventual trade-items.

These "older" NPCs doesn't seem to work on my TFS, but only the ones using 'Npc handler'.

What is 'NPC handler'? It is a default/standard/mall for all NPC's, yes? But more?

What is the best way to create long dialogues and stuff, can one use NPC handler for 1 thing in 1 NPC and the dialogues the old way? Or is it either/or?

And, does anyone have a fresh link to Elimes NPC Editor? Found 3-4 yesterday but none were still up..

Thanks in advance
PEACE!
 
Last edited:
offtopic i guess, but would be fucking epic if someone rewrote it so you can use json :)
 
You could always create them from scratch within a lua file.. instead of using the xml file.
Here's a base npc, that you can start every npc off with, and work from there.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Npc Name" script="data/npc/scripts/NPCscript.lua" walkinterval="500" floorchange="0">
  <health now="100" max="100"/>
  <look type="130" head="2" body="37" legs="35" feet="47" addons="3"/>
</npc>
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid)  end
function onCreatureDisappear(cid)  npcHandler:onCreatureDisappear(cid)  end
function onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg)  end
function onThink()  npcHandler:onThink()  end
function greet(cid)   talkState[cid] = 0   return true end
  
function getNpcName()
     return getCreatureName(getNpcId())
end
  
function creatureSayCallback(cid, type, msg)
     if(not npcHandler:isFocused(cid)) then
         return false
     end
    
     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    
     if msgcontains(msg, "job") then
         selfSay("My job is to show the world how fashionable they can be!", cid)
      
     elseif msgcontains(msg, "name") then
         selfSay("My name is " .. getNpcName() .. ".", cid)
    
     end
     return true  
end

npcHandler:setCallback(CALLBACK_GREET, greet)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
Xml is so much easier :p

Elimes NPC editor, anyone who has it that wants to upload it? All links i've found are dead(Even though the app itself is just 2 years old.. strange?)

You could always create them from scratch within a lua file.. instead of using the xml file.
Here's a base npc, that you can start every npc off with, and work from there.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Npc Name" script="data/npc/scripts/NPCscript.lua" walkinterval="500" floorchange="0">
  <health now="100" max="100"/>
  <look type="130" head="2" body="37" legs="35" feet="47" addons="3"/>
</npc>
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid)  end
function onCreatureDisappear(cid)  npcHandler:onCreatureDisappear(cid)  end
function onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg)  end
function onThink()  npcHandler:onThink()  end
function greet(cid)   talkState[cid] = 0   return true end
  
function getNpcName()
     return getCreatureName(getNpcId())
end
  
function creatureSayCallback(cid, type, msg)
     if(not npcHandler:isFocused(cid)) then
         return false
     end
    
     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    
     if msgcontains(msg, "job") then
         selfSay("My job is to show the world how fashionable they can be!", cid)
      
     elseif msgcontains(msg, "name") then
         selfSay("My name is " .. getNpcName() .. ".", cid)
    
     end
     return true  
end

npcHandler:setCallback(CALLBACK_GREET, greet)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Alright.. so:

NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT

is what links it to the default NPChandler thing TFS has? I'll make an attempt with this tonight, just so hard to test due to my ISP breaking me off constantly(my server is VPS-hosted).

And again, really, NOBODY has Elimes Map Editor? Was released just 2 years ago.. bunch of dead links around. No other NPC-editor-tool lying around somewhere? I've got the speed up on copying basic NPCs but an editor like Elimes where you can directly input dialogues would save me sooooo much time it's unbelievable :/

WCcQItG.png



Thanks mate :) So, what I want to do now is to give this guy a unique "Welcome, Playername! I have been expecting you.". And I need it to blue in the blue text that some NPCs use to tell you what are they triggering keywords. But where does all this go in?

Is it possible to make NPC's say stuff randomly like monsters do? Without a player approaching them that is
 
Last edited by a moderator:
And again, really, NOBODY has Elimes Map Editor? Was released just 2 years ago.. bunch of dead links around. No other NPC-editor-tool lying around somewhere? I've got the speed up on copying basic NPCs but an editor like Elimes where you can directly input dialogues would save me sooooo much time it's unbelievable :/
I have it somewhere on my PC o_O Dunno where. Lemme find it.
------------------------------------

It's just on Otland Cloud btw.

http://***************/?dir=uploads/Tools

You need to sign up if you haven't done it already.
And I need it to blue in the blue text that some NPCs use to tell you what are they triggering keywords. But where does all this go in?

You can do this by using { and } like this: {monsters}
Is it possible to make NPC's say stuff randomly like monsters do? Without a player approaching them that is

Yes, that is possible.

This is a small part for a Cityguard script:
Code:
  <interaction range="3" idletime="60">

    <interact keywords="hi" focus="1">
      <keywords>hello</keywords>

      <response text="Nothing to see here, move along.">
        <action name="idle" value="1"/>
      </response>
    </interact>

    <interact keywords="bye" focus="0">
      <keywords>farewell</keywords>

      <response text="Good bye."/>
    </interact>
  </interaction>

It's not random but maybe you can do something with it. It also contains something else tho. Never made it myself :)
 
Last edited by a moderator:
Use {curly brackets} to highlight words in-game.
-------------------------------
instead of
Code:
function onThink() npcHandler:onThink() end
Use something like..
Code:
function onThink()
     npcHandler:onThink()
     local yellFrequency = 2500
     local thinkMsg = {
         "I can yell!",
         "Yelling! Because reasons!"
     }
     local rand = math.random(yellFrequency)
     if thinkMsg[rand] then
         doCreatureSay(getNpcCid(), thinkMsg[rand], TALKTYPE_YELL)
     end
     return true
end
-------------------------------
http://***************/?dl=bb7fee8ccbf8a14ce1d18d6b767cd768
 
I have it somewhere on my PC o_O Dunno where. Lemme find it.
------------------------------------

It's just on Otland Cloud btw.

http://***************/?dir=uploads/Tools

You need to sign up if you haven't done it already.


You can do this by using { and } like this: {monsters}


Yes, that is possible.

This is a small part for a Cityguard script:
Code:
  <interaction range="3" idletime="60">

    <interact keywords="hi" focus="1">
      <keywords>hello</keywords>

      <response text="Nothing to see here, move along.">
        <action name="idle" value="1"/>
      </response>
    </interact>

    <interact keywords="bye" focus="0">
      <keywords>farewell</keywords>

      <response text="Good bye."/>
    </interact>
  </interaction>

It's not random but maybe you can do something with it. It also contains something else tho. Never made it myself :)

Wow I'm stupid. Been browsing Outcloud earlier but thought it was a bit short on the good stuff. Guess I just didn't look good enough :) Thank s alot mate!

Yeah I use cityguard as basis at the moment, but when I try to edit him slightly he fails to work.. :/
 
Use {curly brackets} to highlight words in-game.
-------------------------------
instead of
Code:
function onThink() npcHandler:onThink() end
Use something like..
Code:
function onThink()
     npcHandler:onThink()
     local yellFrequency = 2500
     local thinkMsg = {
         "I can yell!",
         "Yelling! Because reasons!"
     }
     local rand = math.random(yellFrequency)
     if thinkMsg[rand] then
         doCreatureSay(getNpcCid(), thinkMsg[rand], TALKTYPE_YELL)
     end
     return true
end
-------------------------------
http://***************/?dl=bb7fee8ccbf8a14ce1d18d6b767cd768

I'll try some of that, thanks a lot! And yeah.. shit I feel dumb, it was on OTCloud all the time :p
 
My problem with cityguard(my standard to copy) is his .lua file. What the heck is all that? When does he do all that stuff? Does he attack players if they get a certain value or attack/say something that triggers it?

And what of it can I take away and replace with something that makes it easy for a dialogue-NPC?
I also want him to randomly say stuff.. :p


Does the curly brackets work in .xml aswell? The text becomes blue?
 
When does he do all that stuff? Does he attack players if they get a certain value or attack/say something that triggers it?
He attacks players who are skulled. I never used Cityguard before but I assume he talks and attacks player who are skulled and monsters maybe.

Typing from my phone ;p
 
Back
Top