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

Solved Npc will not talk

SoloQ

Hard With Style
Joined
Mar 12, 2009
Messages
557
Reaction score
21
Location
Netherlands ;3
Hello,

I am running a 0.3.7 crying damson server and am trying to get my npc zalamon to work regarding the wrath of the emperor.
When I ask him for a mission this is his response:
Code:
19:20 Zalamon: Welcome, Snoeihard! I have been expecting you.
19:20 Snoeihard [128]: mission
19:20 Zalamon:
19:20 Snoeihard [128]: yes
19:20 Snoeihard [128]: yes
19:20 Snoeihard [128]: crate
19:20 Snoeihard [128]: bye
19:20 Zalamon: Good bye, Snoeihard!
19:20 Snoeihard [128]: hi
19:20 Zalamon: Welcome, Snoeihard! I have been expecting you.
19:20 Snoeihard [128]: mission
19:21 Zalamon: Good bye, Snoeihard!
I get no error in my console and other npcs seem to function with this one being an exception.

This is the code I am using (Zalamon.lua):
http://pastebin.com/wKQzQM2Z

Since my other npcs are functioning fine i do not understand why this one is not working.
Any help would be appreciated.

-SoloQ
 
I don't know how the quest is meant to go, but I can tell you that josef doesn't know what he's doing. :p
There is many many storage checks, and inconsistencies in the code that don't make sense.
For instance, why is it skipping storages and not giving the player feedback when they are inside of a quest state?
Why is storage only used once? Nevermind that. Why is it used at all? and with ~=?
Why not just use storagee's value to check everything?
It just doesn't make sense. Dx
Why does the lizard tell him he'll need to earn their trust, but never tell him how to do so?
Expanding on the above, why does it give a storage value at all when the lizard says he doesn't trust you?
It would make sense if the lizard just keeps saying that same statement until you do X mission to gain his trust.

Ask Josef to fix it. He knows what's supposed to be going on.
I can't definitively tell you how it's supposed to be scripted, because I don't understand the entire mission.
You'll either need to start posting every single script involved with this quest, or you'll need to explain how the entire quest is meant to work, so someone can script it for you.

As far as I can tell, the npc is working as it's supposed to, or rather, how it's currently scripted.
There is no error with the npc not responding to you, since it simply can't find words to tell you because it can't get past the storage checks.

To understand what I mean add this.. starting at lines 42-46 (original npc paste)
Code:
        doPlayerAddItem(cid, 11112, 1)
        doPlayerAddExperience(cid, 10000)
        setPlayerStorageValue(cid, 8823, 2)
    end
else
    npcHandler:say('Hmm? I don't understand what you want.', cid)
 
Last edited:
The local storage and storagee are coming from the script itself.

Code:
if msgcontains(msg, 'mission') then
            print(storage)
            if (storage ~= 1) then
                npcHandler:say({'Zzo you are offering your help to a lizzard? Hmm, unuzzual. I don\'t know if I can fully truzzt you yet. ...', 'You\'ll have to work to earn my truzzt.'}, cid)
                setPlayerStorageValue(cid, 93800, 1)
                print(2)
and later near the elseif storagee==5 they set the 93802 to 7 and later to 5.
I did not myself create this script so I do not fully understand what is going on truthfully

I am just trying to get Children of the Revolution and Wrath of the Emperor working xD
We know...
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 creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local storages = {8823, 42324, 93800, 93802}

    if msgcontains(msg, 'mission') then
        for i = 1, #storages do
            npcHandler:say("You're storage value " .. storages[i] .. " is set to " .. tostring(getPlayerStorageValue(cid, storages[i])))
        end
        npcHandler:say("Hey dopey.. learn how to test things..")
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
I don't know how the quest is meant to go, but I can tell you that josef doesn't know what he's doing. :p
There is many many storage checks, and inconsistencies in the code that don't make sense.
For instance, why is it skipping storages and not giving the player feedback when they are inside of a quest state?
Why is storage only used once? Nevermind that. Why is it used at all? and with ~=?
Why not just use storagee's value to check everything?
It just doesn't make sense. Dx
Why does the lizard tell him he'll need to earn their trust, but never tell him how to do so?
Expanding on the above, why does it give a storage value at all when the lizard says he doesn't trust you?
It would make sense if the lizard just keeps saying that same statement until you do X mission to gain his trust.

Ask Josef to fix it. He knows what's supposed to be going on.
I can't definitively tell you how it's supposed to be scripted, because I don't understand the entire mission.
You'll either need to start posting every single script involved with this quest, or you'll need to explain how the entire quest is meant to work, so someone can script it for you.

As far as I can tell, the npc is working as it's supposed to, or rather, how it's currently scripted.
There is no error with the npc not responding to you, since it simply can't find words to tell you because it can't get past the storage checks.

To understand what I mean add this.. starting at lines 42-46 (original npc paste)
Code:
        doPlayerAddItem(cid, 11112, 1)
        doPlayerAddExperience(cid, 10000)
        setPlayerStorageValue(cid, 8823, 2)
    end
else
    npcHandler:say('Hmm? I don't understand what you want.', cid)
I go no clue who josef is to be honest xD, this was already in my datapack. I have been doing some digging and it seems the npc isnt complete though. It is missing the Children of the Revolution Quest aswell so I will try to add them both.
Thanks for the help guys, I am just going to rewrite the whole script as it just sucks monkeyballs.
 
We know...
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 creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local storages = {8823, 42324, 93800, 93802}

    if msgcontains(msg, 'mission') then
        for i = 1, #storages do
            npcHandler:say("You're storage value " .. storages[i] .. " is set to " .. tostring(getPlayerStorageValue(cid, storages[i])))
        end
        npcHandler:say("Hey dopey.. learn how to test things..")
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
i are storage value is set to :eek::D:cool::p:oops:o_O:confused:
 
Sorry, yeah.
I missed this completely the first time.
Add
Code:
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
under
Code:
if(not npcHandler:isFocused(cid)) then
    return false
end
@SoloQ You have to change your
Code:
talkState[cid] = 0
to
Code:
 talkState[talkUser] = 0

at least try it, it might fix your issue(s) ^^
 
Back
Top