• 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 0.X Vocation changing after saveing

gader

New Member
Joined
Dec 20, 2017
Messages
22
Reaction score
1
Hi,

I have found pretty strange issue. After global saving some data of character are incorrect. Issue reproduces often.

I had 4 knights online (non-kick tile).
1. Occurance - one of them have stored vocation id = 0 in database (like GoD). I have seen text like "You are a ."
2. Occurance - all of knights was saved as paladin. I didn't check what will happened when characters online have different vocations.

Issue doesn't appears after cyclic saving called from global events or command of GoD. Only global saving triggers problem for characters kicked before saveing.

Someone have seen issue like that? I have no idea that can be caused by some engine bug or lua issue.
 
data/XML/vocations.xml

check your fromvoc. Knight, sorc, dudu and paly should have fromvoc same as voc id.

Promoted vocations like royal paladin should have fromvoc exual to paladin's voc id.

Ex. if pala is voc 4 then he should have fromvoc 4 too. If royal pala is voc 8 then he should have pala's voc which is 4.
 
data/XML/vocations.xml

check your fromvoc. Knight, sorc, dudu and paly should have fromvoc same as voc id.

Promoted vocations like royal paladin should have fromvoc exual to paladin's voc id.

Ex. if pala is voc 4 then he should have fromvoc 4 too. If royal pala is voc 8 then he should have pala's voc which is 4.

fromvoc is correct
in database, royalpaladin has voc 3 and promotion 1, so it works good. But sometimes, when i exit from putty vocations change
 
fromvoc is correct
in database, royalpaladin has voc 3 and promotion 1, so it works good. But sometimes, when i exit from putty vocations change

atleast one of these:
1. bug is in vocations.xml
2. bug is in creaturescripts, maybe custom thing in login.lua
3. bug is in globalevents
4. bug with database sheme
5. bug in sources, some old distros based on 0.4 had lots of bugs

hope it's 1, becouse fix will take few seconds
maybe your antikick tile doesn't allow to kick players upon global save. so bug may be with globalevents or sources.

post your globalsave.lua or whatever you named it and your vocations.xml
 
/data/globalevents/scripts/save.lua

Lua:
local config = {
    broadcast = {120, 30},
    shallow = "no",
    delay = 120,
    events = 30
}

config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)
    if(isInArray(config.broadcast, seconds)) then
        local text = ""
        if(not config.shallow) then
            text = "Full s"
        else
            text = "S"
        end

        text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
        doBroadcastMessage(text)
    end

    if(seconds > 0) then
        addEvent(executeSave, config.events * 1000, seconds - config.events)
    else
        doSaveServer(config.shallow)
    end
end

function onThink(interval)
    if(table.maxn(config.broadcast) == 0) then
        doSaveServer(config.shallow)
    else
        executeSave(config.delay)
    end

    return true
end





VOCATIONS.XML

XML:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="50" gainmana="50" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="100" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.5" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="8" gainmana="33" gainhpticks="6" gainhpamount="20" gainmanaticks="3" gainmanaamount="20" manamultiplier="1.1" attackspeed="1200" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="3.0" magDamage="1.6" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="8" gainmana="33" gainhpticks="6" gainhpamount="20" gainmanaticks="3" gainmanaamount="20" manamultiplier="1.1" attackspeed="1200" soulmax="100" gainsoulticks="120" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="3.0" magDamage="1.6" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="13" gainmana="18" gainhpticks="4" gainhpamount="20" gainmanaticks="4" gainmanaamount="20" manamultiplier="1.4" attackspeed="1200" soulmax="100" gainsoulticks="120" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.9" magHealingDamage="1.7" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="18" gainmana="8" gainhpticks="3" gainhpamount="20" gainmanaticks="6" gainmanaamount="20" manamultiplier="3.0" attackspeed="900" soulmax="100" gainsoulticks="120" fromvoc="4">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.4" magHealingDamage="2.3" defense="1.2" magDefense="1.1" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="13" gainhp="8" gainmana="30" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="40" manamultiplier="1.1" attackspeed="900" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30">
        <formula meleeDamage="2.0" distDamage="1.0" wandDamage="2.3" magDamage="3.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="8" gainmana="33" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="40" manamultiplier="1.1" attackspeed="900" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <formula meleeDamage="2.0" distDamage="1.0" wandDamage="2.3" magDamage="3.1" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="13" gainmana="18" gainhpticks="3" gainhpamount="40" gainmanaticks="3" gainmanaamount="40" manamultiplier="1.4" attackspeed="750" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <formula meleeDamage="2.0" distDamage="1.0" wandDamage="1.0" magDamage="5.2" magHealingDamage="1.7" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="18" gainmana="8" gainhpticks="2" gainhpamount="40" gainmanaticks="4" gainmanaamount="40" manamultiplier="3.0" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <formula meleeDamage="3.0" distDamage="2.0" wandDamage="1.0" magDamage="1.4" magHealingDamage="3.3" defense="0.9" magDefense="0.8" armor="0.8"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
</vocations>
 
Problem is in sources with one of the values what server should save properly, bugged chars have often insane manaspent value.
Problably noone will decide to fix this becouse it's 0.3.6 or 0.4

The easier solution is to disable bugged function.

config.lua -> globalSaveEnabled = false

This will disable globalsave.
Also moving the system to store voc id in storage and apply it on login will be not a working solution becouse source bug affecting more then only vocid.


Edit:
issue can be also with promotion script what allows to nonpremium players buy promotion and upon relogging on nonkick tile during globalsave doesn't saves properly all values.
 
Last edited:
Problem is in sources with one of the values what server should save properly, bugged chars have often insane manaspent value.
Problably noone will decide to fix this becouse it's 0.3.6 or 0.4

The easier solution is to disable bugged function.

config.lua -> globalSaveEnabled = false

This will disable globalsave.
Also moving the system to store voc id in storage and apply it on login will be not a working solution becouse source bug affecting more then only vocid.


Edit:
issue can be also with promotion script what allows to nonpremium players buy promotion and upon relogging on nonkick tile during globalsave doesn't saves properly all values.

i use auto-promotion, i mean after create character, that guy got auto promotion, so i don't think is promotion script

if globalsave is off, so how can i save a server (not manual /save)
 
Back
Top