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

Solved Questlog not updating?

Jfrye

Mapper, trying to learn scripting
Joined
Jan 8, 2009
Messages
366
Solutions
5
Reaction score
86
Location
Mexico Missouri
I cant seem to get the quest log to update. I have been able to get the quest to show up in the log, but once you click on the quest, it is just empty inside. See the image below.

questlog%20issue_zpsaiknjov0.png


Here is the part from quests.xml
Code:
    <quest name="The Lost Ring" startstorageid="20001" startstoragevalue="1">
        <mission name="Finding the Ring" storageid="20002" startvalue="0" endvalue="1">
            <missionstate id="1" description="You are trying to help find a lost ring." />
        </mission>
        <mission name="Returning the Ring" storageid="20003" startvalue="0" endvalue="1">
            <missionstate id="1" description="You have found the ring. You should return it to the NPC." />
        </mission>
    </quest>

I have the NPC storage value set to 20001.

Npc File
Code:
local storage = 20001

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, "mission") then
         if getPlayerStorageValue(cid, storage) == -1 then
             selfSay("My wife lost her ring while swimming in the town swimming area. Do you think you can help me find it?", cid)
             talkState[talkUser] = 1
         elseif getPlayerStorageValue(cid, storage) == 1 then
             selfSay("Did you find the ring?", cid)
             talkState[talkUser] = 1
         else
             selfSay("Thanks again for finding the ring.", cid)
         end
     elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
         if getPlayerStorageValue(cid, storage) == -1 then
             selfSay("Great! I saw a water vortex. Maybe you should check near that first.", cid)
             setPlayerStorageValue(cid, storage, 1)
         else
             if(doPlayerRemoveItem(cid, 24333, 1)) then
                 selfSay("That's great, my wife will be really happy, thanks.", cid)
                 doPlayerAddItem(cid, 2148, 300)
                 setPlayerStorageValue(cid, storage, 2)
             else
                 selfSay("You don't have it.", cid)
             end
         end
         talkState[talkUser] = 0
     elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
         selfSay("Ok then.", cid)
         talkState[talkUser] = 0
     end
     return true
end
 
It won't show anything inside "The Lost Ring" because the first mission checks for storage 20002 and the NPC only gives a 20001 storage.

<mission name="Finding the Ring" storageid="20002" startvalue="0" endvalue="1">
startvalue="0" then the quest is just started.
endvalue="1" then the quest is completed.

You can use same storage just diffrent start/end values to make it easier, or make sure the NPC gives the player the storage 20002.
 
@HalfAway thanks for the fast response. But when it says setPlayerStorageValue(cid, storage, 1) and setPlayerStorageValue(cid, storage, 2), isnt that adding 1 and 2 to the original storage value, or am I completely misunderstanding how those lines work?
 
@HalfAway thanks for the fast response. But when it says setPlayerStorageValue(cid, storage, 1) and setPlayerStorageValue(cid, storage, 2), isnt that adding 1 and 2 to the original storage value, or am I completely misunderstanding how those lines work?
No, nothing will happen because storage is only linked to the quest name, nothing else.

If you do something like this, then your idea will work:
Code:
<quest name="The Lost Ring" startstorageid="20001" startstoragevalue="1">
    <mission name="Finding the Ring" storageid="20001" startvalue="1" endvalue="2">
        <missionstate id="1" description="You are trying to help find a lost ring" />
        <missionstate id="2" description="You found the ring. You should return to the NPC." />
    </mission>
</quest>
 
@HalfAway Ok, I see that now, and that works great. Ty for that. I want to make them kill a creature for the lost ring, so Should I keep it like this?
Code:
<quest name="The Lost Ring" startstorageid="20001" startstoragevalue="1">
        <mission name="Finding the Ring" storageid="20001" startvalue="1" endvalue="2">
            <missionstate id="1" description="You are trying to help find a lost ring. The NPC told you to check near a water vortex in the swimming area in town." />
        </mission>
        <mission name="Returning the Ring" storageid="20003" startvalue="0" endvalue="1">
            <missionstate id="1" description="You have found the ring. You should return it to the NPC." />
        </mission>

When they kill the creature, it will give them a storage value to collect the ring. Or am I making the quest way more complicated than it needs to be?
 
@HalfAway Ok, I see that now, and that works great. Ty for that. I want to make them kill a creature for the lost ring, so Should I keep it like this?
Code:
<quest name="The Lost Ring" startstorageid="20001" startstoragevalue="1">
        <mission name="Finding the Ring" storageid="20001" startvalue="1" endvalue="2">
            <missionstate id="1" description="You are trying to help find a lost ring. The NPC told you to check near a water vortex in the swimming area in town." />
        </mission>
        <mission name="Returning the Ring" storageid="20003" startvalue="0" endvalue="1">
            <missionstate id="1" description="You have found the ring. You should return it to the NPC." />
        </mission>

When they kill the creature, it will give them a storage value to collect the ring. Or am I making the quest way more complicated than it needs to be?
When the player kill the creature do they get a certain storage and after that they can collect a ring from a chest or is it just a "invisible" ring?
 
@HalfAway Thanks for all the help. So just to be clear here. I still use it like this?
Code:
<quest name="The Lost Ring" startstorageid="20001" startstoragevalue="1">
        <mission name="Finding the Ring" storageid="20001" startvalue="1" endvalue="2">
            <missionstate id="1" description="You are trying to help find a lost ring. The NPC told you to check near a water vortex in the swimming area in town." />
        </mission>
        <mission name="Returning the Ring" storageid="20003" startvalue="0" endvalue="1">
            <missionstate id="1" description="You have found the ring. You should return it to the NPC." />
        </mission>
With separate missions, and just use the storage id for "returning the ring" in the onKill script? Is that correct?
 
Yes, but you've set the startvalue to 0 in the Returning the Ring mission, and the missionstate id to 1 which means the mission will be empty (like in the first post) until the player got the storagevalue 1 of 20003.

You can do it like this instead:
Code:
<mission name="Returning the Ring" storageid="20003" startvalue="1" endvalue="1">
    <missionstate id="1" description="You have found the ring. You should return it to the NPC." />
</mission>
 
Sorry to bump an old thread, but saw it recently come to light in another post, and thought I'd attempt to clarify how storage values work.

Codex NG gave a "lectured" approach here.
I gave a noobie tutorial of sorts here.

For the effort of this thread though..

Making the storage value 20001 have a value of 1, does not make the storage value 20002.

Imagine it like a Library Bookshelf.

Row 1, book 1
Row 2, book 1

These are two separate area's of the library.
Same as with storages.

Storage 20001, value 1
Storage 20002, value 1

The storage numbers hold one numerical value that can be used to compare quest states, among other things, and can be easily updated to a new number whenever someone does something within the game world.


Going a bit further.. you can make a storage be associated with a word.

XikiniQuestTutorial = 20001

If you place this in lib/constant (0.3.7... 1.x versions are likely different directories/file placements) (This is so you can use the words in ANY script, not just the one your working in)
Or place it at the top of of your script using a local

local XikiniQuestTutorial = 20001

You no longer need to remember what the storage is used for, since you've assigned (hopefully) a descriptive sentence or string of words together for that storage number.

Hopefully this helps someone, as I think this is main issue OP was having when trying to understand.
 
Back
Top