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

I want to know how to implement these functions that I am missing.

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
581
Reaction score
78
Hello otland community, I'm working on a tfs 1.5 7.4, when I got it it had a custom map, but it didn't convince me.. and I'm trying to implement a 7.4 global map.. I took the global map here from the forum.. from a server that was uploaded recently, I'm talking about this server:
EliteOts 7.72 RL Map 7.4 99.9% (https://otland.net/threads/eliteots-7-72-rl-map-7-4-99-9.290053/)
When I installed it, I copied the actions, libs, and movements from this server so that it would be compatible. The map worked perfectly, as did the resident teleports, doors, and so on. But I started to see errors in some quest chests, or in some levers, or in the chairs that go to the other room.
The errors that appear to me are all in the console, which says that some of the functions are missing.
1727652984924.webp
1727653002554.webp
So with several other things, I get these function errors... it seems that it doesn't recognize them...
1727653101623.webp
What I wanted to know, where can I fix this... because this is happening to me... are there functions that are missing or are they functions that are being intervened... where can I copy and paste these functions so that everything is more compatible... and I can't have these errors... in the quests I found a solution which is to create new chests using the script "littlechestquest".. with that I was able to solve the quests... but the issue would be everything else... doors, levers, etc..
 
Some global Functions like
"BridgeRelocate"
jus can be found inside 050-function.lua in data/lib/ folder
same for others like doAddQuestPoint can be foun in 110-quest-points.lua

its not just copy map and actions/movements, need adjust and add all the necessary functions to the base library you use.

and remember it will not be copy and paste files, since replacing many existing ones can on the contrary break TFS 1.5 functions, just open the files and copy the necessary functions, it can be in a new LUA that you then add and load in the libs.
 
Some global Functions like
"BridgeRelocate"
jus can be found inside 050-function.lua in data/lib/ folder
same for others like doAddQuestPoint can be foun in 110-quest-points.lua

its not just copy map and actions/movements, need adjust and add all the necessary functions to the base library you use.

and remember it will not be copy and paste files, since replacing many existing ones can on the contrary break TFS 1.5 functions, just open the files and copy the necessary functions, it can be in a new LUA that you then add and load in the libs.
These functions that I mentioned... where do they have to be pasted in TFS 1.5 in data/lib/compat.lua? I understand that by copying and pasting, everything gets mixed up and does not work properly. The only thing I don't understand or don't know is where to put these functions in TFS 1.5... that's the problem... I would like to know where these functions are put...
for example this function.. 110-quest_points.lua
LUA:
function doAddQuestPoint(cid)
if getConfigValue("WorldID") == 1 then
    getquestpoints = mysqlQuery("SELECT `quest_points` FROM `players` WHERE `players`.`name` = \"".. getPlayerName(cid) .."\"", "quest_points")
    NEW_QUEST_POINTS = (getNumberValue(getquestpoints.quest_points) +1)   
mysqlQuery("UPDATE `players` SET `players`.`quest_points`=\"".. NEW_QUEST_POINTS .."\" WHERE `players`.`name` = \"".. getPlayerName(cid) .."\"", 'SET')
return true
end
end

function getQuestPoints(cid)
    getquestpoints = mysqlQuery("SELECT `quest_points` FROM `players` WHERE `players`.`name` = \"".. getPlayerName(cid) .."\"", "quest_points")
 return getNumberValue(getquestpoints.quest_points)
end
where do I have to place it in tfs 1.5 for it to work, and not be copying and pasting this lua, which is not solved either.
 
You have two options: you can either add it directly to global.lua or create its own library in data/lib/core/110-quest_points.lua

And then you need to add this in data/lib/core/core.lua.
LUA:
dofile('data/lib/core/110-quest_points.lua')

I think it's better to use the lib.
 
You have two options: you can either add it directly to global.lua or create its own library in data/lib/core/110-quest_points.lua

And then you need to add this in data/lib/core/core.lua.
LUA:
dofile('data/lib/core/110-quest_points.lua')

I think it's better to use the lib.
I am doing as you say... in core.lua, I was putting the files that contain the functions that I am getting the error in the console
core.lua:
LUA:
-- Note: The library of storages must be loaded previously to the other libraries.
dofile('data/lib/core/storages.lua')

dofile('data/lib/core/achievements.lua')
dofile('data/lib/core/actionids.lua')
dofile('data/lib/core/combat.lua')
dofile('data/lib/core/constants.lua')
dofile('data/lib/core/container.lua')
dofile('data/lib/core/creature.lua')
dofile('data/lib/core/game.lua')
dofile('data/lib/core/item.lua')
dofile('data/lib/core/itemtype.lua')
dofile('data/lib/core/party.lua')
dofile('data/lib/core/player.lua')
dofile('data/lib/core/position.lua')
dofile('data/lib/core/teleport.lua')
dofile('data/lib/core/tile.lua')
dofile('data/lib/core/vocation.lua')
dofile('data/lib/core/050-function.lua')
dofile('data/lib/core/110-quest_points.lua')
dofile('data/lib/core/000-constant.lua')
dofile('data/lib/core/global.lua')
dofile('data/lib/core/100-shortcut.lua')

16:57 You have found a noble armor.
16:57 You have found a crown helmet.
17:01 it's empty.
17:02 it's empty.

XML:
Lua Script Error: [Action Interface]
data/actions/scripts/main/quest.lua:onUse
data/lib/core/110-quest_points.lua:2: attempt to call global 'getConfigValue' (a nil value)
stack traceback:
        [C]: in function 'getConfigValue'
        data/lib/core/110-quest_points.lua:2: in function 'doAddQuestPoint'
        data/actions/scripts/main/quest.lua:1504: in function <data/actions/scripts/main/quest.lua:46>

Lua Script Error: [Action Interface]
data/actions/scripts/main/quest.lua:onUse
LuaScriptInterface::luaDoPlayerAddItem(). Item not found
stack traceback:
        [C]: in function 'doPlayerAddItem'
        data/actions/scripts/main/quest.lua:1515: in function <data/actions/scripts/main/quest.lua:46>

quest.lua
LUA:
-- Noble Armor --
elseif item.uid == 8092 then
    if getPlayerStorageValue(cid,8092) <= 0 then
        if getPlayerFreeCap(cid) <= 120 then
        doPlayerSendTextMessage(cid,22,"You need 120 cap or more to loot this!")
        return TRUE
        end
        doPlayerSendTextMessage(cid,22,"You have found a noble armor.")
        doPlayerAddItem(cid, Cfnoblearmor, 1)
        setPlayerStorageValue(cid,8092,1)
        doAddQuestPoint(cid)
    else
    doPlayerSendTextMessage(cid,22,"it's empty.")
    end
elseif item.uid == 8093 then
    if getPlayerStorageValue(cid,8093) <= 0 then
        if getPlayerFreeCap(cid) <= 30 then
        doPlayerSendTextMessage(cid,22,"You need 30 cap or more to loot this!")
        return TRUE
        end
        doPlayerSendTextMessage(cid,22,"You have found a crown helmet.")
        doPlayerAddItem(cid, Cfcrownhelmet, 1)
        setPlayerStorageValue(cid,8093,1)
    else
    doPlayerSendTextMessage(cid,22,"it's empty.")
    end
-----
-----
 
Back
Top