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

Compiling TFS: When do u chose the version when compiling

vichoko

Member
Joined
Oct 9, 2008
Messages
128
Reaction score
6
Location
Santiago, Chile
Hello there.
This problem was the reason i stopped developing OTS in the past, and now i came back to try to solve it once again, with your help i hope xD.
All my life i have worked with Windows with my servers, but this time is different.

I'm trying to mount my 10.41 OTS in a computer with Ubuntu 14.04; so i followed this guide for compiling in Ubuntu:
https://github.com/otland/forgottenserver/wiki/Compiling-on-Ubuntu
(An oficial guide for compiling; TLDR: clone the sources and compile.)

And finally i get the server files ready to run, but my question is: Where do i chose the version of Tibia that the server will run?
Because all my data files i work are ready for 10.41 Tibia.

Please help me with this one, i couldn't find any information in Internet.

Another interesting thing i descovered.
There is differences between my 10.35 scripts and the source ones.
For example:
My Avalanche script:
Code:
local combat = createCombatObject()
setCombatParam(combat, ...)
...

The source's one:
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, ...)
...

I can see difference between both so i think even if i'm able to downgrade this TFS i'll need to change every script i own.
What should i do? I'm a little bit lost.
Maybe should i try with other sources?

Help please, i need guidance in this :C
 
Last edited by a moderator:
Another interesting thing i descovered.
There is differences between my 10.35 scripts and the source ones.
For example:
My Avalanche script:
Code:
local combat = createCombatObject()
setCombatParam(combat, ...)
...

The source's one:
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, ...)
...

I can see difference between both so i think even if i'm able to downgrade this TFS i'll need to change every script i own.
What should i do? I'm a little bit lost.
Maybe should i try with other sources?

Help please, i need guidance in this :C
Well there is a solution but you might not like it...
For backwards compatibility you can recreate these functions in data/lib/compat/compat.lua

So for instance, Combat
Code:
function createCombatObject()
    return Combat()
end

function setCombatParam(obj, param, formula)
    return obj:setParameter(param, formula)
end

function setAttackFormula(obj, formula, ...)
    return obj:setFormula(formula, ...)
end

function setCombatArea(obj, area)
    return obj:setArea(area)
end

function doCombat(creature, obj, var)
    obj:execute(Creature(creature), var)
end

Allowing you to still use your old scripts without having to mass update all of them
 
Well there is a solution but you might not like it...
For backwards compatibility you can recreate these functions in data/lib/compat/compat.lua

So for instance, Combat
Code:
function createCombatObject()
    return Combat()
end

function setCombatParam(obj, param, formula)
    return obj:setParameter(param, formula)
end

function setAttackFormula(obj, formula, ...)
    return obj:setFormula(formula, ...)
end

function setCombatArea(obj, area)
    return obj:setArea(area)
end

function doCombat(creature, obj, var)
    obj:execute(Creature(creature), var)
end

Allowing you to still use your old scripts without having to mass update all of them

Back already? Hahahahahaha
 
Well there is a solution but you might not like it...
For backwards compatibility you can recreate these functions in data/lib/compat/compat.lua

So for instance, Combat
Code:
function createCombatObject()
    return Combat()
end

function setCombatParam(obj, param, formula)
    return obj:setParameter(param, formula)
end

function setAttackFormula(obj, formula, ...)
    return obj:setFormula(formula, ...)
end

function setCombatArea(obj, area)
    return obj:setArea(area)
end

function doCombat(creature, obj, var)
    obj:execute(Creature(creature), var)
end

Allowing you to still use your old scripts without having to mass update all of them
Thanks for you answer. Thats an interesting way to fix it and thanks for the idea!!

Well i have another problem too: When i fix that problem, my items.otb version crashes tfs binary with an error that says that the version is too old.
With this i discovered that the version of tfs i was building was uncompatible with my data files.

Right now i discovered that in the TFS sorces there are 3 branches: 1.0, 1.1 and the master one.
I was cloning the master one that came with that combat:setParameter(COMBAT_PARAM_TYPE, ...) type of functions.

But the 1.1 branch have the same type of scripts i have (setCombatParam(combat, ...)) so right now i'm building this TFS 1.1 to try with this one if it works.
 
Back already? Hahahahahaha
You know you missed me :)

Thanks for you answer. Thats an interesting way to fix it and thanks for the idea!!

Well i have another problem too: When i fix that problem, my items.otb version crashes tfs binary with an error that says that the version is too old.
With this i discovered that the version of tfs i was building was uncompatible with my data files.

Right now i discovered that in the TFS sorces there are 3 branches: 1.0, 1.1 and the master one.
I was cloning the master one that came with that combat:setParameter(COMBAT_PARAM_TYPE, ...) type of functions.

But the 1.1 branch have the same type of scripts i have (setCombatParam(combat, ...)) so right now i'm building this TFS 1.1 to try with this one if it works.
The scripts are one thing, but the items directory needs to be up to date.

At some point you want to transition your scripts using the current functions that exist, not because its what all the cool kids are doing, its to prevent errors and/or crashes.
 
Last edited by a moderator:
The scripts are one thing, but the items directory needs to be up to date.

At some point you want to transition your scripts using the current functions that exist, not because its what all the cool kids are doing, its to prevent errors and/or crashes.
Hmm i understand that and i though about doing it.

But i still don't know how to define the version of Tibia my server will use.
For example, my map is for 10.35. My items otb is for 10.41.
And what if change the TFS version to the newest release? What version of Tibia will be accepting my server?

I had had this doubt for a long time and i think is kinda confusing me alot.
Right now i'm finishing building the 1.1 version, any news i'll post here.
 
You can't define or choose.
You have to make the changes in the source code yourself.
Currently TFS supports 10.76 and 10.77.

Aha, and what can i do if i want to compile a 10.41 server?
It does exist a way to get the sourcer for that version? Or it's easier to migrate the server to the existing version?
 
You can search for a 10.41 distribution or you can find out what changes do you need to do to downgrade the 10.76 server version to your 10.41.
The first one is easier in my opinion.
 
Back
Top