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

TFS 1.X+ script error in console tfs 1.4

johnsamir

Advanced OT User
Joined
Oct 13, 2009
Messages
965
Solutions
6
Reaction score
164
Location
Nowhere
Hello i use tfs 1.4 version 8.6


i have the following error


Code:
Lua Script Error: [Scripts Interface]
C:\Users\felip\Documents\GitHub\pro-ot\data\scripts\quests\load_quests_xml.lua:callback
...ts\GitHub\pro-ot\data\scripts\quests\load_quests_xml.lua:13: attempt to call method 'children' (a nil value)
stack traceback:
        ...ts\GitHub\pro-ot\data\scripts\quests\load_quests_xml.lua:13: in function <...ts\GitHub\pro-ot\data\scripts\quests\load_quests_xml.lua:4>
>> Loaded all modules, server starting up...
this is the script:
Lua:
-- If you don't intend to use quests.xml, you can delete this file.
local xmlQuest = GlobalEvent("Load XML Quests")

function xmlQuest.onStartup()  Line 4
    local questDoc = XMLDocument("data/XML/quests.xml")
    if not questDoc then
        io.write(
            "[Warning - GlobalEvent::onStartup] Could not load quests.xml.\n")
        return true
    end

    local quests = questDoc:child("quests")
    for questNode in quests:children() do   LINE 13
        local missions = {}
        for missionNode in questNode:children() do
            local mission = {
                name = missionNode:attribute("name") or "",
                storageId = tonumber(missionNode:attribute("storageid")),
                startValue = tonumber(missionNode:attribute("startvalue")),
                endValue = tonumber(missionNode:attribute("endvalue")),
                ignoreEndValue = tobool(missionNode:attribute("ignoreendvalue")),
                description = missionNode:attribute("description")
            }

            if not mission.description then
                local description = {}
                for missionState in missionNode:children() do
                    description[tonumber(missionState:attribute("id"))] =
                        missionState:attribute("description") or ""
                end

                mission.description = description
            end

            missions[#missions + 1] = mission
        end

        Game.createQuest(questNode:attribute("name"), {
            storageId = tonumber(questNode:attribute("startstorageid")),
            storageValue = tonumber(questNode:attribute("startstoragevalue")),
            missions = missions
        }):register()
    end
    return true
end

xmlQuest:register()
I've updated my server from 1.3 and maybe i have missing code in c++ or something else, can somebody point me out the solucion please?
Post automatically merged:

solved simply excluded that files by commenting it out with this sign # or symbol
 
Last edited:
Back
Top