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

Lua Error - Npc interface

Seksy

Active Member
Joined
May 20, 2012
Messages
389
Reaction score
27
Location
Tennessee
Getting this problem in console with NPC script. Npc wont load

It looks to me (if I am right) I am missing table items.deposited in the mysql database (am I right?)
Im not sure what needs to be entered in order to get this table working. This is a taming system on 8.7 TFS 0.4

PHP:
local result = db.getResult("SELECT * FROM `items_deposited` WHERE `storage_id` = 20000;") -- WHERE `storage_id` = 20000;")

full NPC script attached (txt format)

Here is line 60 of 004-database.lua which is part of the error.. hope this helps
Code:
function Result:getDataInt(s)
    if(self:getID() == -1) then
        error("[Result:getDataInt] Result not set!")
    end

    return result.getDataInt(self:getID(), s)
end
 

Attachments

Last edited:
You are missing that table items_deposited indeed, I can't find it on otland (could be still posted as download link).
Where did you find that script or datapack? Maybe the table is added there.
 
You are missing that table items_deposited indeed, I can't find it on otland (could be still posted as download link).
Where did you find that script or datapack? Maybe the table is added there.

Its not in the data pack. Data pack came from a friend. Im going to experiment with it some here.
 
As Limos said, its a custom query that you will have to try and track yourself. Got anything else to go on except the column "storage"?
You could try to remove that system aswell and replace it with a new one / the default system.

Btw how's it going with the rlmap? :)
 
As Limos said, its a custom query that you will have to try and track yourself. Got anything else to go on except the column "storage"?
You could try to remove that system aswell and replace it with a new one / the default system.

Btw how's it going with the rlmap? :)

nothing else to go on. Well I am going to assume if its pulling a storage value, it will need PID and world ID at least right?
Im thinking, just do away with this taming system and go with a different one.
.. and RL is working good so far
 
nothing else to go on. Well I am going to assume if its pulling a storage value, it will need PID and world ID at least right?
Im thinking, just do away with this taming system and go with a different one.
.. and RL is working good so far

Well its imposible to say if there is no code to go on, could be that it needs some other value aswell. You could try to add the CID* value, world id (shoulden't be needed tho) and the storage column as you listed above.
 
Hello guys i have problem with my script, first look at script:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
local talkState = {}
NpcSystem.parseParameters(npcHandler)

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 creatureSayCallback(cid, type, msg)
   if(not npcHandler:isFocused(cid)) then
return false
end

npcHandler:addModule(FocusModule:new())
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

local first = {
useExpReward = true,
last = 1,
}

if(msgcontains(msg, 'notebook')) then
   if getPlayerStorageValue(cid,1003) <= 0 then
     selfSay("You found my notebook?", cid)
     talkState[talkUser] = 1
   else
     getPlayerStorageValue(cid,1003,1)
     selfSay("I don't need more notebooks.", cid)
     talkState[talkUser] = 0
   end
    
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
  if getCreatureStorageValue(cid,1003) <= 0 then
     if getPlayerItemCount(cid,1955) >= 1 then
       if(doPlayerRemoveItem(cid,1955,1)) then
         selfSay("Great, take reward.", cid)
         doPlayerAddItem(cid,2406,1)
         setPlayerStorageValue(cid,1003,1)
         talkState[talkUser] = 0
  elseif(useExpReward) then
  doPlayerAddExperience(cid,2000)
  end
     else
       getPlayerItemCount(cid,1955,0)
       selfSay("I'm still waiting for notebook.", cid)
       talkState[talkUser] = 0
     end
  end
elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
   selfSay("Back when you have it.", cid)
   talkState[talkUser] = 0
end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local citizenfirst = 20001

if (msgcontains(msg, 'backpack addon')) then
   if getPlayerStorageValue(cid,20001) <= 0 then
     selfSay("I can do for you backpack if you bring me 100 {minotaur} {leathers}. Are you interested?", cid)
     talkState[talkUser] = 2
   else
     getPlayerStorageValue(cid,20001,1)
     selfSay("Sorry, you already have backpack addon.", cid)
     talkState[talkUser] = 0
   end
end  
if(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
   if getPlayerStorageValue(cid,20001) <= 0 then
     if getPlayerItemCount(cid,5878) >= 100 then
       if doPlayerRemoveItem(cid,5878,100) then
         selfSay("Here you are, enjoy your backpack!", cid)
         doSendMagicEffect(getCreaturePosition(cid), 13)
         doPlayerAddOutfit(cid, 128, 1)
         doPlayerAddOutfit(cid, 136, 1)
         setPlayerStorageValue(cid,20001,1)
         talkState[talkUser] = 0
       end
     else
       getPlayerItemCount(cid,5878,0-99)
       selfSay("You do not have enough minotaur leathers.", cid)
       talkState[talkUser] = 0
     end
   end
elseif(msgcontains(msg, 'no') and talkState[talkUser] == 2) then
   selfSay("So do not lose my time!", cid)
   talkState[talkUser] = 0
end
return true
end

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

This script contains npc with normal quest and addon gain. It's working but i always have errors in my console like this:
[24/08/2014 21:37:25] [Error - Npc interface]
[24/08/2014 21:37:25] data/npc/scripts/Amber.lua:eek:nCreatureSay
[24/08/2014 21:37:25] Description:
[24/08/2014 21:37:25] (luaGetCreatureStorage) Creature not found

This error showing when i completed quest or gain addon, and say "notebook" or "backpack addon"

How can i fix that ?

I'm using TFS 0.3.6 V8.2
 
Last edited:
Back
Top