• 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++ Migration from TFS 0.3.6 to TFS 1.2

PRLOts

Member
Joined
Jun 24, 2017
Messages
116
Solutions
4
Reaction score
15
Hello Otland!

I was fighting with compilation few days ago in here and here , thanks WibbenZ for support <3.

Now its time to migrate with my data pack, I've fixed npc errors, few bugs with monsters it was quite easy (simple errors). But today I find out few errors with my actions.

Code:
[Warning - Action::loadFunction] Function "" does not exist.
migracja.png




Question: Is there any way to migrate with action functions and with whole action stuff from TFS 0.3.6 to TFS 1.2? Or any way to fix that scripts?

I tried to add into \forgottenserver-8.6\data\lib\compat.lua this codes but still doesn't work :/

Code:
oldFunction = compatFunctionName
or
Code:
function oldFunction = compatFunctionName end
 
you have to remove event="somethinghere"
if the event is event="script", then you replace it with script="scriptpathhere" and remove the value="xx"
if the event is event="function", you replace it with function="functionhere" and remove the value="xx"
script example:
XML:
<action itemid="1740" event="script" value="quests/quests.lua" />
to
XML:
<action itemid="1740" script="quests/quests.lua" />

function example:
XML:
<action itemid="1873" event="function" value="increaseItemId" />
to
XML:
<action itemid="1873" function="increaseItemId" />
 
you have to remove event="somethinghere"
if the event is event="script", then you replace it with script="scriptpathhere" and remove the value="xx"
if the event is event="function", you replace it with function="functionhere" and remove the value="xx"
script example:
XML:
<action itemid="1740" event="script" value="quests/quests.lua" />
to
XML:
<action itemid="1740" script="quests/quests.lua" />

function example:
XML:
<action itemid="1873" event="function" value="increaseItemId" />
to
XML:
<action itemid="1873" function="increaseItemId" />


Thanks for reply mate, but there is still little problem with scripts.

Code:
Lua Script Error: [Test Interface]
data/actions/scripts/shop/wgr.lua
data/actions/scripts/shop/wgr.lua:8: attempt to call global 'getItemNameById (a nil value)
stack traceback:
[C]: in function 'getItemNameById
data/actions/scripts/shop/wgr.lua:8: in main chunk
[Warning - Event:: checkScript] Can not load script: scripts/shop/wgr.lua


erroprr.png
 
in compat.lua add
LUA:
function getItemNameById(id) local it = ItemType(id) if it then return it:getName() end end
 
Solution
in compat.lua add
LUA:
function getItemNameById(id) local it = ItemType(id) if it then return it:getName() end end

Wow, you're really pro mate, there left few errors with liquids and enchanting

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
 
Last edited:
Back
Top