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

[Configuration] How to make a working Quest Log

What you do to have Blue Name, Mana and HP that too ?? c++ codes? or config, lua ?
 
I am currently stuck i've done everything I know to do so i'm going to post here for help hopefully I am not using your setup just looked over your tutorial for a little help im trying to put a quest log on my server for In Service of Yalahar after I get the quest the questlog pops up with the name of the mission of the quest I am on, however, I can not get the description to work it says "An error has occurred, please contact a gamemaster." this is my quest.xml"

Code:
<?xml version="1.0" encoding="UTF-8"?>
<quests>
   <quest name="In Service of Yalahar" startstorageid="30" startstoragevalue="5">
     <mission name="Something Rotten" storageid="30" startvalue="5" endvalue="6">
       <missionstate id="0" description="Something Rotten"/>
     </mission>
     <mission name="Example Mission 2" storageid="1001" startvalue="4" endvalue="5">
       <missionstate id="4" description="Example description 1"/>
       <missionstate id="5" description="Example description 2"/>
     </mission>
   </quest>
</quests>

also I will attach a screenshot thanks for any help.;)


how to capture screen
 
[26/01/2014 01:58:37] data/npc/scripts/doug.lua:21: attempt to call global 'doPlayerSetStorageValue' (a nil value)
[26/01/2014 01:58:37] stack traceback:
[26/01/2014 01:58:37] [C]: in function 'doPlayerSetStorageValue'
[26/01/2014 01:58:37] data/npc/scripts/doug.lua:21: in function 'callback'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/keywordhandler.lua:27: in function 'processMessage'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/keywordhandler.lua:135: in function 'processNodeMessage'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/keywordhandler.lua:103: in function 'processMessage'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/npchandler.lua:387: in function 'onCreatureSay'
[26/01/2014 01:58:37] data/npc/scripts/doug.lua:7: in function <data/npc/scripts/doug.lua:7>

This is the error I get, what's the problem,?
 
[26/01/2014 01:58:37] data/npc/scripts/doug.lua:21: attempt to call global 'doPlayerSetStorageValue' (a nil value)
[26/01/2014 01:58:37] stack traceback:
[26/01/2014 01:58:37] [C]: in function 'doPlayerSetStorageValue'
[26/01/2014 01:58:37] data/npc/scripts/doug.lua:21: in function 'callback'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/keywordhandler.lua:27: in function 'processMessage'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/keywordhandler.lua:135: in function 'processNodeMessage'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/keywordhandler.lua:103: in function 'processMessage'
[26/01/2014 01:58:37] data/npc/lib/npcsystem/npchandler.lua:387: in function 'onCreatureSay'
[26/01/2014 01:58:37] data/npc/scripts/doug.lua:7: in function <data/npc/scripts/doug.lua:7>

This is the error I get, what's the problem,?
Can you post that script here?
 
Ok, this fucking sucks.

I ended up with something like this:

<quest name="Tutorial Quest" startstorageid="9000" startstoragevalue="1">
<mission name="Rakakuks Equipment" storageid="2000" startvalue="-1" endvalue="1">
<missionstate id="0" description="Recover Rakakuks equipment."/>
<missionstate id="1" description="You recovered Rakakuks equipment from the rotworm cave."/>
</mission>
<mission name="Mining" storageid="2000" startvalue="1" endvalue="2">
<missionstate id="0" description="Receive a pickaxe from Rakakuk."/>
<missionstate id="1" description="Strike the earth!"/>
</mission>
<mission name="Bulbas Trouble" storageid="2000" startvalue="2" endvalue="3">
<missionstate id="0" description="Help Bulba."/>
<missionstate id="1" description="You helped Bulba feeding the villagers."/>
</mission>
</quest>

And it shows NOTHING in the quest log - where a moment ago it did work. I have set the storage of 9000 to 1 with a script, just to make the quest show, the start value of 2000 has to be at -1 [because the player has to go and open a chest, I'm just using the generic quest system for that], nothing shows up.

I don't get what exactly are startstoragevalue and missionstate id's - do they refer exactly to the storage value? Or do they have to start from 0 every time? Or?

EDIT:
Lol, the exact same code that has worked previously now doesn't show a shit, the quest log is empty - am I doing something terribly wrong here, or is just the quest log system fucked up ? [TFS 8.6]
 
Last edited:
If I were you, I'd avoid using "-1" as start value, always start with 0. All storages are -1 by default, so if you start with 0, whenever player obtains storagevalue 0, the quest will show up.

Let's start with this:

<quest name="Tutorial Quest" startstorageid="9000" startstoragevalue="1">
--quests
</quest>

When player's storagevalue 9000 is at value 1, this questline will show up in the log.
(Of course, it will be empty unless you fill it up with some quests)

Now to move on to quests:
(i copied your mission, but changed startvalue from -1 to 0)

<mission name="Rakakuks Equipment" storageid="2000" startvalue="0" endvalue="1">
<missionstate id="0" description="Recover Rakakuks equipment."/>
<missionstate id="1" description="You recovered Rakakuks equipment from the rotworm cave."/>
</mission>

Startvalue and endvalue represent values of storageid that you are using for this quest.
So this configuration:
storageid="2000" startvalue="0" endvalue="1"
essentially means that you will be using the storage 2000 on values 0 and 1, and that when it is on value 1, this quest is finished.

So if player has the main questline unlocked (this "Tutorial Quest"), and he has storageid 2000 on value 0, he should be able to see this Rakakuks Equipment.

You had to define a missionstate for every storage value that is in this range from 0 to 1, including those numbers. Since it's only 0 and 1, you need those two.

<missionstate id="0" description="Recover Rakakuks equipment."/>
<missionstate id="1" description="You recovered Rakakuks equipment from the rotworm cave."/>

Seeing as you have them, when the player's storage 2000 is on value 0, he should see this text "Recover Rakakuks equipment."

I hope that this gives you a better grasp on how the quest log works.
 
Thanks for your reply.

I have tried starting from 0 - I wanted this particular quest to be visible right from the beginning - so for the questline storage I used 9000, and put it's value to 1 with a script that runs when you first log in. It did not work, so: What is the relation between the main questline STORAGE, and each missions STORAGE. Do they have no relation? Like, they can all be different storages? Or can they be the SAME storage both for missions and for the main storyline?

As for missionstates: in this example its storageValue from 0 to 1, so the missionstates go from 0 to 1 - what if the storage values would be from let's say 3 to 5?
Would the missionstates go still from 0, to 2? Or would they go from 3 to 5?

My problem right now, is that the quests don't show up at all, even using the old script that worked previously - I even tried restarting the server, making new characters, checking at NPC's if the quests are still in the same state as they were - nothing helps, and the worst thing is I have no idea why [as it did work before, and nothing changed] :)
 
Thanks for your reply.
I have tried starting from 0 - I wanted this particular quest to be visible right from the beginning - so for the questline storage I used 9000, and put it's value to 1 with a script that runs when you first log in. It did not work, so: What is the relation between the main questline STORAGE, and each missions STORAGE. Do they have no relation? Like, they can all be different storages? Or can they be the SAME storage both for missions and for the main storyline?

As far as I know, they relate this way: When all missions inside a questline are done, questline displays as "(Finished)" in the log. All missions are done when all the missions inside a questline have reached their endvalue.

As for missionstates: in this example its storageValue from 0 to 1, so the missionstates go from 0 to 1 - what if the storage values would be from let's say 3 to 5?
Would the missionstates go still from 0, to 2? Or would they go from 3 to 5?

The quest log will expect missionstates to be defined for all values between (and including) the 2 numbers used in endvalue and startvalue.
This means the following:

If your storageid 2005 is a used for the mission, and startvalue - endvalue are set from 3 to 5,
When player's storage 2005 is on any value other than 3,4, and 5, quest log will not expect nor show any information.
If his storage 2005 is 3, the quest log will show the missionstate #3.

I would recommend you to make a small test script that will output you the values of all storages you used. That way you can check what's going on. Check what values your storages are - if everything is defined correctly in quests.xml for those storages, and if you have the questline unlocked.
Also check your console about it, there might be an error (when it's loading quests.xml) if there's something wrong in that file.
 
I have editted the chest quest system and divided "normal" quest chests from ones that are chained to a longer questline, and make the chest open at storage=0, then change to storage=1. It did work, it seems the -1 caused problems [no idea why would it?], thank you! :)

As for the mission id's - I think you are a bit wrong here [If I did not misunderstand you]. It seems they go from 0 upwards, whatever the starting and ending storage values are - if I set them to something "out of bounds" [iteratively] the mission does not display, meaning: Say I have Starting and ending values of 2 and 3 - If I set them to mission ID 0 and 1, they work perfectly. But if I try using a mission ID of 3 [to link it to storage value of 3], the mission does not show

Here is my edited quest piece, it works now :)

<quest name="The Tutorial" startstorageid="2000" startstoragevalue="0">
<mission name="Facing the Rotworms" storageid="2000" startvalue="0" endvalue="1">
<missionstate id="0" description="Find the equipment chest, and fight the enemies guarding it."/>
<missionstate id="1" description="Mission complete!"/>
</mission>
<mission name="Strike the earth!" storageid="2000" startvalue="1" endvalue="2">
<missionstate id="0" description="Get a pick and strike the earth!"/>
<missionstate id="1" description="Mission complete!"/>
</mission>
<mission name="Helping the strange baker" storageid="2000" startvalue="2" endvalue="3">
<missionstate id="0" description="Help Bulba feeding his skel.. the villagers."/>
<missionstate id="1" description="Mission complete!"/>
</mission>
</quest>

Sorry for letting the code float around like that, couldn't find a CODE tag in the edit bar :/

The console was the first thing I checked, it gave no errors, just loaded the quests like a good girl she is

I also checked the storage values - there was nothing wrong with them either.

If it's not the questlog/XML having a problem with -1, I have no damn idea what caused it not showing correctly
 
Last edited:
I have editted the chest quest system and divided "normal" quest chests from ones that are chained to a longer questline, and make the chest open at storage=0, then change to storage=1. It did work, it seems the -1 caused problems [no idea why would it?], thank you! :)

As for the mission id's - I think you are a bit wrong here [If I did not misunderstand you]. It seems they go from 0 upwards, whatever the starting and ending storage values are - if I set them to something "out of bounds" [iteratively] the mission does not display, meaning: Say I have Starting and ending values of 2 and 3 - If I set them to mission ID 0 and 1, they work perfectly. But if I try using a mission ID of 3 [to link it to storage value of 3], the mission does not show

Here is my edited quest piece, it works now :)

<quest name="The Tutorial" startstorageid="2000" startstoragevalue="0">
<mission name="Facing the Rotworms" storageid="2000" startvalue="0" endvalue="1">
<missionstate id="0" description="Find the equipment chest, and fight the enemies guarding it."/>
<missionstate id="1" description="Mission complete!"/>
</mission>
<mission name="Strike the earth!" storageid="2000" startvalue="1" endvalue="2">
<missionstate id="0" description="Get a pick and strike the earth!"/>
<missionstate id="1" description="Mission complete!"/>
</mission>
<mission name="Helping the strange baker" storageid="2000" startvalue="2" endvalue="3">
<missionstate id="0" description="Help Bulba feeding his skel.. the villagers."/>
<missionstate id="1" description="Mission complete!"/>
</mission>
</quest>

Sorry for letting the code float around like that, couldn't find a CODE tag in the edit bar :/

The console was the first thing I checked, it gave no errors, just loaded the quests like a good girl she is

I also checked the storage values - there was nothing wrong with them either.

If it's not the questlog/XML having a problem with -1, I have no damn idea what caused it not showing correctly

Perhaps you are right. To be fair, I haven't worked with this stuff in quite a long time. Anyway, I'm glad I helped you and with some experimentation, you are able to figure everything by yourself like you just did. I'll have to start adding stuff to the quest log soon so I guess that will refresh my memory. :D
 
Could anyone tell me, is there any possibility to format the text in quest log? Nothing fancy, just being able to put new lines, maybe colours?

Like, instead of having:
TextblahblahblahTextblah

To have it as:
Text
blahblah
Text
blah

I would like to use the log to display the crafting recipes the player has already acquired, as "Missions" under a certain "Questline" [Blacksmithy/Alchemy/Artificing and so on], and it would look a lot better if it had new lines [and maybe colours]
 
i hope it works for TFS 1.0 and tibia client 10.41
Going to try to make quest log.
 
this is bugged with multiple mission complete
when you have two mision its showing ok
but when you have 2 complete and 1 not
then you dont see 3 mission (2 complete)


anyone know how to fix?
where is problems
serverside or clientside?
 
this is bugged with multiple mission complete
when you have two mision its showing ok
but when you have 2 complete and 1 not
then you dont see 3 mission (2 complete)


anyone know how to fix?
where is problems
serverside or clientside?

The feature works fine, it has been built into TFS/Tibia client for ages, you didn't do something correctly. Post your scripts and pics of problem and maybe I can help.
Problem is most likely related to how you are setting the storages, or how you defined stuff related to the particular quest in the XML
 
I edited the thread a little to make it easier to read, keep in mind this was made 6 years ago when otland used different formatting and there was no new TFS (1.1+).
 
The feature works fine, it has been built into TFS/Tibia client for ages, you didn't do something correctly. Post your scripts and pics of problem and maybe I can help.
Problem is most likely related to how you are setting the storages, or how you defined stuff related to the particular quest in the XML
all is correct
here is my quest with mission
Code:
<quests>
<quest name="test quest" startstorageid="5001" startstoragevalue="1">
        <mission name="mision name some name Test!" storageid="5002" startvalue="0" endvalue="2">
            <missionstate id="0" description="descriptio 0"/>
            <missionstate id="1" description="description 1"/>
            <missionstate id="2" description="description quest completed"/>
        </mission>
        <mission name="mision 2" storageid="5002" startvalue="2" endvalue="3">
        <missionstate id="2" description="asdqwe"/>
        <missionstate id="3" description="Quest Completed"/>
        </mission>
        <mission name="mision 3" storageid="5002" startvalue="3" endvalue="4">
        <missionstate id="3" description="qweqwe"/>
        </mission>
        <mission name="mision 4" storageid="5002" startvalue="4" endvalue="6">
        <missionstate id="3" description="descriptipn"/>
        </mission>
    </quest>
</quests>

here is next problems bvecauyse
on <missionstate id="2" description="description quest completed"/>
i must put text if i dont put text mission then i got error please report to game master ......
 
all is correct
here is my quest with mission
Code:
<quests>
<quest name="test quest" startstorageid="5001" startstoragevalue="1">
        <mission name="mision name some name Test!" storageid="5002" startvalue="0" endvalue="2">
            <missionstate id="0" description="descriptio 0"/>
            <missionstate id="1" description="description 1"/>
            <missionstate id="2" description="description quest completed"/>
        </mission>
        <mission name="mision 2" storageid="5002" startvalue="2" endvalue="3">
        <missionstate id="2" description="asdqwe"/>
        <missionstate id="3" description="Quest Completed"/>
        </mission>
        <mission name="mision 3" storageid="5002" startvalue="3" endvalue="4">
        <missionstate id="3" description="qweqwe"/>
        </mission>
        <mission name="mision 4" storageid="5002" startvalue="4" endvalue="6">
        <missionstate id="3" description="descriptipn"/>
        </mission>
    </quest>
</quests>

here is next problems bvecauyse
on <missionstate id="2" description="description quest completed"/>
i must put text if i dont put text mission then i got error please report to game master ......

Your Mission 3 doesn't have a mission state for its endvalue, your mission 4 doesn't have a state for any of its values (4-6), furthermore, when you specify a start value and an end value, you must cover each and every mission state in between those two numbers with descriptions (unless you'll be skipping some storage values with other scripts).
 
Back
Top