• 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 How to remove "your questlog has been updated"?

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,454
Solutions
1
Reaction score
627
Location
Estonia
I added task's to questlog, so there would be 1 more way to keep track of your progress.
But each time i kill something, i get message: "your questlog has been updated"
where could i remove this default message?
 
You can use |STATE| instead of using multiple missionstate id's too avoid that.

e.g, this
Code:
        <mission name="Test" storageid="1000" startvalue="0" endvalue="5">
            <missionstate id="0" description="0/5."/>
            <missionstate id="1" description="1/5."/>
            <missionstate id="2" description="2/5."/>
            <missionstate id="3" description="3/5."/>
            <missionstate id="4" description="4/5."/>
            <missionstate id="5" description="5/5."/>
        </mission>
can be changed to this
Code:
<mission name="Test" storageid="1000" startvalue="0" endvalue="5" description="|STATE|/5." />
 
i have storageid out of sync, don't rly want to change entire functions.
Can i somehow do this?
Code:
description="|STATE-1|/5
"
 
The function that sends the player this message receives a bool parameter called isLogin.

You could change it to something like omitMessage and get a wider use of it.

This is what I mean:

Change the function LuaScriptInterface::luaPlayerSetStorageValue

from:

C++:
int LuaScriptInterface::luaPlayerSetStorageValue(lua_State* L)
{
    // player:setStorageValue(key, value)
    int32_t value = getNumber<int32_t>(L, 3);
    uint32_t key = getNumber<uint32_t>(L, 2);
    Player* player = getUserdata<Player>(L, 1);
    if (IS_IN_KEYRANGE(key, RESERVED_RANGE)) {
        std::ostringstream ss;
        ss << "Accessing reserved range: " << key;
        reportErrorFunc(ss.str());
        pushBoolean(L, false);
        return 1;
    }

    if (player) {
        player->addStorageValue(key, value);
        pushBoolean(L, true);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

to:
C++:
int LuaScriptInterface::luaPlayerSetStorageValue(lua_State* L)
{
    // player:setStorageValue(key, value)
    int32_t value = getNumber<int32_t>(L, 3);
    uint32_t key = getNumber<uint32_t>(L, 2);
    Player* player = getUserdata<Player>(L, 1);
    bool sendMessage = getBoolean(L, 4, false)
    if (IS_IN_KEYRANGE(key, RESERVED_RANGE)) {
        std::ostringstream ss;
        ss << "Accessing reserved range: " << key;
        reportErrorFunc(ss.str());
        pushBoolean(L, false);
        return 1;
    }

    if (player) {
        player->addStorageValue(key, value, sendMessage);
        pushBoolean(L, true);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

I would recommend you changing the isLogin parameter name to something like omitMessage on lines.

otland/forgottenserver
and
otland/forgottenserver

Just for your code to make a little bit more sense, since we changed the main usage of that bool parameter.

Now, when you want to use player:setStorageValue and not show the player the "Your questlog has been updated" message, you have to pass a last parameter as true.

Example:
LUA:
player:setStorageValue(5555, 1, true)

Other calls to this function will remain the same, you don't need to change them since we assumed if nothing is passed it is false.

Edit --
This is how I would do it if I had the problem as you said of a lot of quests.xml lines (it would have to be a lot of lines that needed to be changed for me to not do it), but the best option would be to do it as Ninja showed.
 
Last edited:

Similar threads

Back
Top