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

Problem with NPCs

hejd12345

New Member
Joined
Apr 11, 2012
Messages
255
Reaction score
1
Location
Sweden
Hello! ;D
My problem is that I can talk with NPCs but whenever i say like "trade" or "sail" they does not respond with open the "trade" menu or "I can take you to Thais, Carlin or Edron" for example.
So do anyone know whats up? :)
 
Does your NPC's channel open when you talk to them? If not have you tried to open it manually from channel list?

I actually got same problem with boat and banker npc's atleast. Tried different npc scripts for boat npc's but so far no luck. Perhaps typo errors, they don't respond.
Using theforgottenserver V 0.2.15 and techman's ot's map.
"
[21/03/2014 18:25:47] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/Captain Max.lua
[21/03/2014 18:25:47] data/npc/scripts/Captain Max.lua:26: ')' expected near 'then'

"
You get any errors, like this perhaps?
 
Does your NPC's channel open when you talk to them? If not have you tried to open it manually from channel list?

I actually got same problem with boat and banker npc's atleast. Tried different npc scripts for boat npc's but so far no luck. Perhaps typo errors, they don't respond.
Using theforgottenserver V 0.2.15 and techman's ot's map.
"
[21/03/2014 18:25:47] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/Captain Max.lua
[21/03/2014 18:25:47] data/npc/scripts/Captain Max.lua:26: ')' expected near 'then'

"
You get any errors, like this perhaps?
Nop, I do not get any errors at all. It is the same with all the NPCs so it will take a while to replace all the NPCs scripts manully since it is alot of them in 10.36.
 
Have you seen if there is similar errors in that first link with 43 pages? I checked few random pages, no solution :(

Anyway, thanks Limos! Had to change "autowalk" to walkinterval="2000". But now I got working boat NPC, just adding destination's and I'm good to go! :)
 
Have you seen if there is similar errors in that first link with 43 pages? I checked few random pages, no solution :(

Anyway, thanks Limos! Had to change "autowalk" to walkinterval="2000". But now I got working boat NPC, just adding destination's and I'm good to go! :)
What first link?
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="xxx" script="xxxx.lua" walkinterval="0" floorchange="0">
<health now="1" max="1"/>
<look type="129" head="114" body="0" legs="0" feet="0" addons="3"/>
<voices>
<voice text="Passages to {XXX} and {XXX}." interval2="100" margin="1" yell="no"/>
</voices>
<parameters>
<parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service."/>
<parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service."/>
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="name;XXXX;" />
<parameter key="keyword_reply1" value="My name is Captain White Hunter from the Royal Tibia Line."/>
<parameter key="keyword_reply2" value="This is XXX. Where do you want to go?"/>
<parameter key="message_greet" value="Welcome on board, {|PLAYERNAME|}. Where may I {sail} you today?"/>
</parameters>
</npc>

Code:
local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
     
     
     
        -- OTServ event handling functions start
        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
        -- OTServ event handling functions end
     
     
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        local travelNode = keywordHandler:addKeyword({'cityname!'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to {cityname} for free?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=xxx, y=xxx, z=xxx} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
     
        keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To xx.'})
        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
        keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
   

        npcHandler:addModule(FocusModule:new())

only edit the lines XXX

and use small letters
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="xxx" script="xxxx.lua" walkinterval="0" floorchange="0">
<health now="1" max="1"/>
<look type="129" head="114" body="0" legs="0" feet="0" addons="3"/>
<voices>
<voice text="Passages to {XXX} and {XXX}." interval2="100" margin="1" yell="no"/>
</voices>
<parameters>
<parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service."/>
<parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service."/>
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="name;XXXX;" />
<parameter key="keyword_reply1" value="My name is Captain White Hunter from the Royal Tibia Line."/>
<parameter key="keyword_reply2" value="This is XXX. Where do you want to go?"/>
<parameter key="message_greet" value="Welcome on board, {|PLAYERNAME|}. Where may I {sail} you today?"/>
</parameters>
</npc>

Code:
local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
    
    
    
        -- OTServ event handling functions start
        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
        -- OTServ event handling functions end
    
    
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        local travelNode = keywordHandler:addKeyword({'cityname!'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to {cityname} for free?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=xxx, y=xxx, z=xxx} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
    
        keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To xx.'})
        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
        keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
  

        npcHandler:addModule(FocusModule:new())

only edit the lines XXX

and use small letters
I can not find this line, "<voices>
<voice text="Passages to {XXX} and {XXX}." interval2="100" margin="1" yell="no"/>
</voices>".
But the rest seems fine...
 
Back
Top