• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

problem with npc system

zerghel

Tsuni
Joined
Jul 1, 2008
Messages
299
Reaction score
9
i got a this kind of error when i talk to an NPC and then logout

[03/01/2011 18:47:26] Lua Script Error: [Npc interface]
[03/01/2011 18:47:26] data/npc/scripts/bless.lua:onThink
[03/01/2011 18:47:26] luagetDistanceTo(). Thing not found
[03/01/2011 18:47:26] stack traceback:
[03/01/2011 18:47:26] [C]: in function 'getDistanceTo'
[03/01/2011 18:47:26] data/npc/lib/npcsystem/npchandler.lua:539: in function 'isInRange'
[03/01/2011 18:47:26] data/npc/lib/npcsystem/npchandler.lua:473: in function 'onThink'
[03/01/2011 18:47:26] data/npc/scripts/bless.lua:9: in function <data/npc/scripts/bless.lua:9>

[03/01/2011 18:47:26] Lua Script Error: [Npc interface]
[03/01/2011 18:47:26] data/npc/scripts/bless.lua:onThink
[03/01/2011 18:47:26] data/npc/lib/npcsystem/npchandler.lua:293: bad argument #3 to 'gsub' (string/function/table expected)
[03/01/2011 18:47:26] stack traceback:
[03/01/2011 18:47:26] [C]: ?
[03/01/2011 18:47:26] [C]: in function 'gsub'
[03/01/2011 18:47:26] data/npc/lib/npcsystem/npchandler.lua:293: in function 'parseMessage'
[03/01/2011 18:47:26] data/npc/lib/npcsystem/npchandler.lua:528: in function 'onWalkAway'
[03/01/2011 18:47:26] data/npc/lib/npcsystem/npchandler.lua:474: in function 'onThink'
[03/01/2011 18:47:26] data/npc/scripts/bless.lua:9: in function <data/npc/scripts/bless.lua:9>



this happens to us since Mistic spirit 0.2.8

sounds familiar to anyone ?
 
Last edited:
ty Cykotitan
i used search but i couldn't find that thread
i copied ur npchandler edition, and now my npc's release the focus on player logout =)
but i'm still seeing this:

[03/01/2011 23:33:02] Lua Script Error: [Npc interface]
[03/01/2011 23:33:02] data/npc/scripts/food.lua:onThink
[03/01/2011 23:33:02] luaCloseShopWindow(). Player not found
[03/01/2011 23:33:02] stack traceback:
[03/01/2011 23:33:02] [C]: in function 'closeShopWindow'
[03/01/2011 23:33:02] data/npc/lib/npcsystem/npchandler.lua:206: in function 'releaseFocus'
[03/01/2011 23:33:02] data/npc/lib/npcsystem/npchandler.lua:534: in function 'onWalkAway'
[03/01/2011 23:33:02] data/npc/lib/npcsystem/npchandler.lua:476: in function 'onThink'
[03/01/2011 23:33:02] data/npc/scripts/food.lua:9: in function <data/npc/scripts/food.lua:9>
 
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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'meat'}, 2666, 5, 'meat')
shopModule:addBuyableItem({'fish'}, 2667, 5, 'fish')
shopModule:addBuyableItem({'salmon'}, 2668, 5, 'salmon')
shopModule:addBuyableItem({'ham'}, 2671, 8, 'ham')
shopModule:addBuyableItem({'dragon ham'}, 2672, 20, 'dragon ham')
shopModule:addBuyableItem({'pear'}, 2673, 4, 'pear')
shopModule:addBuyableItem({'red apple'}, 2674, 3, 'red apple')
shopModule:addBuyableItem({'orange'}, 2675, 10, 'orange')
shopModule:addBuyableItem({'banana'}, 2676, 3, 'banana')
shopModule:addBuyableItem({'blueberry'}, 2677, 1, 'blueberry')
shopModule:addBuyableItem({'cherry'}, 2679, 1, 'cherry')
shopModule:addBuyableItem({'strawberry'}, 2680, 1, 'strawberry')
shopModule:addBuyableItem({'grape'}, 2680, 3, 'grape')
shopModule:addBuyableItem({'melon'}, 2682, 8, 'melon')
shopModule:addBuyableItem({'pumpkin'}, 2683, 10, 'pumpkin')
shopModule:addBuyableItem({'carrot'}, 2684, 3, 'carrot')
shopModule:addBuyableItem({'tomato'}, 2685, 5, 'tomato')
shopModule:addBuyableItem({'corncob'}, 2686, 3, 'corncob')
shopModule:addBuyableItem({'cookie'}, 2687, 2, 'cookie')
shopModule:addBuyableItem({'bread'}, 2689, 4, 'bread')
shopModule:addBuyableItem({'roll'}, 2690, 2, 'roll')
shopModule:addBuyableItem({'brown bread'}, 2691, 3, 'brown bread')
shopModule:addBuyableItem({'egg'}, 2695, 2, 'egg')
shopModule:addBuyableItem({'white mushroom'}, 2787, 6, 'white mushroom')
shopModule:addBuyableItem({'red mushroom'}, 2788, 12, 'red mushroom')
shopModule:addBuyableItem({'brown mushroom'}, 2789, 10, 'brown mushroom')
shopModule:addBuyableItem({'valentine cake'}, 6393, 6, 'valentine cake')
shopModule:addBuyableItem({'cookbook'}, 2347, 150, 'cookbook')

npcHandler:addModule(FocusModule:new())
 
Back
Top