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

C++ Console errors TFS 1.2 + Quest error

PRLOts

Member
Joined
Jun 24, 2017
Messages
116
Solutions
4
Reaction score
15
Hey Otland, I have few errors in my console after migration from TFS 0.3.6 to TFS 1.2

Code:
Lua Script Error: [Test Interface]
data/actions/scripts/other/enchanting.lua
data/actions/scripts/other/enchanting.lua:2: attemp to call global 'getConfigValue' (a nil value)
stack traceback:
[C]: in function 'getConfigValue'
data/actions/scripts/other/enchanting.lua:2: in main chunk
[Warning - Event::checkScript] Can not load script: scripts/other/enchanting

Enchanting error

enchant.png


Fishing error

fish.png

Potions error


potioins.png


And also I have quest error. When I try to get something from chest I can only take item, but it's not reward. After I click on chest I see this kind of error:

Code:
Lua Script Error: [Action InterFace]
data/actions/scripts/quests/system.lua:onUse
data/actions/scripts/quests/system.lua:10: attemp to call global 'getPlayerCustomFlagValue' (a nil value)
stack traceback:
[C]: in function 'getPlayerCustomFlagValue'
data/actions/scripts/quests/system.lua:10: in function <data/actions/scripts/quests/system.lua:9>

drut.png
questy.png


Anyone know how to solve this issue? I pay in virgins or bigos <3
 
Solution
Hey Otland, I have few errors in my console after migration from TFS 0.3.6 to TFS 1.2

Code:
Lua Script Error: [Test Interface]
data/actions/scripts/other/enchanting.lua
data/actions/scripts/other/enchanting.lua:2: attemp to call global 'getConfigValue' (a nil value)
stack traceback:
[C]: in function 'getConfigValue'
data/actions/scripts/other/enchanting.lua:2: in main chunk
[Warning - Event::checkScript] Can not load script: scripts/other/enchanting

Enchanting error

View attachment 30350


Fishing error

View attachment 30349

Potions error


View attachment 30353


And also I have quest error. When I try to get something from chest I can only take item, but it's not reward. After I click on chest I...
Hey Otland, I have few errors in my console after migration from TFS 0.3.6 to TFS 1.2

Code:
Lua Script Error: [Test Interface]
data/actions/scripts/other/enchanting.lua
data/actions/scripts/other/enchanting.lua:2: attemp to call global 'getConfigValue' (a nil value)
stack traceback:
[C]: in function 'getConfigValue'
data/actions/scripts/other/enchanting.lua:2: in main chunk
[Warning - Event::checkScript] Can not load script: scripts/other/enchanting

Enchanting error

View attachment 30350


Fishing error

View attachment 30349

Potions error


View attachment 30353


And also I have quest error. When I try to get something from chest I can only take item, but it's not reward. After I click on chest I see this kind of error:

Code:
Lua Script Error: [Action InterFace]
data/actions/scripts/quests/system.lua:onUse
data/actions/scripts/quests/system.lua:10: attemp to call global 'getPlayerCustomFlagValue' (a nil value)
stack traceback:
[C]: in function 'getPlayerCustomFlagValue'
data/actions/scripts/quests/system.lua:10: in function <data/actions/scripts/quests/system.lua:9>

View attachment 30351
View attachment 30352


Anyone know how to solve this issue? I pay in virgins or bigos <3

Add this to compat.lua
LUA:
string.boolean = function (input)
    local tmp = type(input)
    if(tmp == 'boolean') then
        return input
    end

    if(tmp == 'number') then
        return input > 0
    end

    local str = string.lower(tostring(input))
    return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0))
end
getBooleanFromString = string.boolean

Custom flags dosn't exist, upload the code.
 
Solution
Add this to compat.lua
LUA:
string.boolean = function (input)
    local tmp = type(input)
    if(tmp == 'boolean') then
        return input
    end

    if(tmp == 'number') then
        return input > 0
    end

    local str = string.lower(tostring(input))
    return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0))
end
getBooleanFromString = string.boolean

Custom flags dosn't exist, upload the code.

I add this code in compact.lua, but still

enchantyy.png

And I checked the quests they're still not working :/
 
Examples functions:
getPlayerFlagValue(cid, flag)
configManager.getNumber(configKeys.STAMINA_SYSTEM)
configManager.getBoolean(configKeys.STAMINA_SYSTEM)
configManager.getString(configKeys.STAMINA_SYSTEM)
 
Examples functions:
getPlayerFlagValue(cid, flag)
configManager.getNumber(configKeys.STAMINA_SYSTEM)
configManager.getBoolean(configKeys.STAMINA_SYSTEM)
configManager.getString(configKeys.STAMINA_SYSTEM)

Thx for reply, I changed system.lua in \data\actions\scripts\quests

from
Code:
if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
to
Code:
    if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then

But now I get this error:

still.png


@Edit, I add this in global.lua
  1. LUA:
    function doCopyItem(item, attributes)
        local attributes = attributes or false
        local ret = doCreateItemEx(item.itemid, item.type)
        if(attributes) then
            if(item.actionid > 0) then
                doSetItemActionId(ret, item.actionid)
            end
        end
    
        if(isContainer(item.uid) == TRUE) then
            for i = (getContainerSize(item.uid) - 1), 0, -1 do
                local tmp = getContainerItem(item.uid, i)
                if(tmp.itemid > 0) then
                    doAddContainerItemEx(ret, doCopyItem(tmp, true).uid)
                end
            end
        end
    
        return getThing(ret)
    end

But When i get reward it says

19:01 You have found .

But not
19:01 You have found a teddybear. (for example)


@Edit 2: I fixed this I add new system.lua in quest/systems

For future help I add system.lua in here.

Best regards!

Add this to compat.lua
LUA:
string.boolean = function (input)
    local tmp = type(input)
    if(tmp == 'boolean') then
        return input
    end

    if(tmp == 'number') then
        return input > 0
    end

    local str = string.lower(tostring(input))
    return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0))
end
getBooleanFromString = string.boolean

Custom flags dosn't exist, upload the code.

You was right, without flags it was not working!
 

Attachments

Last edited:
Thx for reply, I changed system.lua in \data\actions\scripts\quests

from
Code:
if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
to
Code:
    if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then

But now I get this error:

View attachment 30355


@Edit, I add this in global.lua
  1. LUA:
    function doCopyItem(item, attributes)
        local attributes = attributes or false
        local ret = doCreateItemEx(item.itemid, item.type)
        if(attributes) then
            if(item.actionid > 0) then
                doSetItemActionId(ret, item.actionid)
            end
        end
    
        if(isContainer(item.uid) == TRUE) then
            for i = (getContainerSize(item.uid) - 1), 0, -1 do
                local tmp = getContainerItem(item.uid, i)
                if(tmp.itemid > 0) then
                    doAddContainerItemEx(ret, doCopyItem(tmp, true).uid)
                end
            end
        end
    
        return getThing(ret)
    end

But When i get reward it says

19:01 You have found .

But not
19:01 You have found a teddybear. (for example)


@Edit 2: I fixed this I add new system.lua in quest/systems

For future help I add system.lua in here.

Best regards!


for example:
LUA:
function doCopyItem(item, attributes)
    local attributes = attributes or false
    local ret = Game.createItem(item:getId())
    if attributes then
        if item:getActionid() > 0 then
            item:setActionId(attributes)
        end
    end

    if ItemType(item):isContainer() then
        for i = 0, (getContainerSize(item) - 1) do
        local tmp = getContainerItem(item, i)
        if tmp and tmp:getId() > 0 then
        doAddContainerItemEx(ret, doCopyItem(tmp, true))
        end
    end
    end
    return getThing(ret)
end
 
Back
Top