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

Lua Loading Lib - TFS 1.1 - 10.77

xuvurex

New Member
Joined
Mar 23, 2008
Messages
10
Reaction score
0
Hi All,

Recently back from the dead and messing around with a server concept. I have been pretty successful thus far, but have been having issues with a particular script by @zbizu . I have been attempting to install his Ultimate item stat system on multiple TFS 1.1 stable distros (10.77), but cannot for the life of me get the script to load.

Prior, I tried installing it on the latest 1.2, but received to many errors so i resorted back to a clean stable version of TFS 1.1.

I have tried adding the following (Which worked with errors on 1.2, but wont load on 1.1) in multiple locations and starts the server without any errors. I even try "/reload global" in-game, and still nothing. I have installed the system exactly as specified in the thread:

https://otland.net/threads/tfs-1-1-...tem-elements-skills-exp-loot-and-more.229771/

Global.lua
Code:
dofile('data/lib/lib.lua')
dofile('data/stats.lua')

for dir in io.popen([[dir "data\lib\" /b /aa]]):lines() do
  dofile('data/lib/'..dir..'')
end

Lib.lua
Code:
-- Core API functions implemented in Lua
dofile('data/lib/core/core.lua')
dofile('data/lib/core/stats.lua')
dofile('data/lib/stats.lua')

-- Compatibility library for our old Lua API
dofile('data/lib/compat/compat.lua')

Again, any help is greatly appreciated!
 
Server structure keeps getting changed. That's the reason of incompability between certain revs.
Post console errors here so we will be able to help you.
 
Server structure keeps getting changed. That's the reason of incompability between certain revs.
Post console errors here so we will be able to help you.

Thank you for your reply. There were actually no errors in console and server started fine without executing the lib for some reason.

I have decided to use the latest distro, 1.2 and try and convert the script over.
 
found this on my hdd, hope it helps:
Code:
------------------------------
-- Loader config
------------------------------
local modDir = "data/lib/items_mod/"
local modOutput = true
local folders = {'files'} -- folders to include

------------------------------
-- loader
------------------------------
local dirCommand = {'find ', ' -maxdepth 1 -type f'}

-- Windows compability
if io.popen("ver"):read("*all"):find("Windows") then
	dirCommand = {'dir "', '" /b /aa'}
end

-- lua files loader
local filesCount = 0
for i = 1, #folders do
	if modOutput then
		io.write('>> Loading ' .. folders[i] .. '... ')
	end

	for dir in io.popen(dirCommand[1] .. modDir .. folders[i] .. '/' .. dirCommand[2]):lines() do
		filesCount = filesCount + 1
		dofile(modDir .. folders[i] .. '/' .. dir)
	end

	if modOutput then
		print(filesCount .. ' file(s) loaded')
	end
	
	filesCount = 0
end
 
Thank you Zbizu, i greatly appreciate your help. I am currently at work right now, but will give the code a shot when I get home.

Do you have any idea why the traditional code wasn't executing the script with a stable distro? Just for my own knowledge for the future.

Code:
dofile('data/stats.lua')

for dir in io.popen([[dir "data\lib\" /b /aa]]):lines() do
  dofile('data/lib/'..dir..'')
end
 
Probably something wrong in stats.lua itself.
Check console during startup.

I upgraded to the latest 1.2 distro, and have now got the script to work by using a lot of searching around the forums! Thank you for the help @zbizu, and creating this script. I couldn't imagine how much time it took to put this together. Your hard work is greatly appreciated.
 
Back
Top