• 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 Compiled latest TFS but can't load config.lua

dumia

New Member
Joined
Sep 18, 2024
Messages
10
Reaction score
1
GitHub
dumia
Hello folks, I've build the lates TFS version and was build my server with UniServer zero as per recommendation on the OTS guide tutorial.

After importing my database with the schema.sql provided I ran the server through CMD and got this:

1727118580864.webp

So I looked around and found that I needed to setup my .env file AND my lua config, so i set my .env and made a new copy of the config.lua.dist as config.lua but the error still persists.
 
If it shows cannot open config.lua is means there is no config.lua file in directory in which is theforgottenserver-x64.exe or that .exe has no access rights to that file.

It looks like you missed some step in TFS config, because TFS should be in some directory ex. C:\forgottenserver and vcpkg should be in ex. C:\vcpkg.
Probably you have to move .exe from C:\vcpkg\forgottenserver to other folder. Folder that has data folder and config.lua file (TFS folder).
 
Ok I did some housecleaning (took TFS out of the VCPKG folder), and made sure the launcher was at the root with all .dlls now im getting this error:

1727120836754.webp

My .env is as follows:

1727120920984.webp

The UniSever Zero is up, with apache and mysql services running, I can access phpmyadmim fine and I even imported the schema.sql to mainbase.sql sucessfuly

My config.lua and config.lua.dist are as follows:

LUA:
-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
-- NOTE: allowWalkthrough is only applicable to players
-- NOTE: two-factor auth requires token and timestamp in session key
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
httpPort = 3306
httpWorkers = 1
maxPlayers = 0
onePlayerOnlinePerAccount = true
allowClones = false
allowWalkthrough = true
serverName = "Forgotten"
statusTimeout = 5000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
enableTwoFactorAuth = true
Post automatically merged:

Wait now re-read your message and got worried, is the .exe for the server in the right folder?

1727121960249.webp

sorry for maybe a dumb question, but you nerver know
 
Last edited:
Ok I did some housecleaning (took TFS out of the VCPKG folder), and made sure the launcher was at the root with all .dlls now im getting this error:

View attachment 87259

My .env is as follows:

View attachment 87260

The UniSever Zero is up, with apache and mysql services running, I can access phpmyadmim fine and I even imported the schema.sql to mainbase.sql sucessfuly

My config.lua and config.lua.dist are as follows:

LUA:
-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
-- NOTE: allowWalkthrough is only applicable to players
-- NOTE: two-factor auth requires token and timestamp in session key
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
httpPort = 3306
httpWorkers = 1
maxPlayers = 0
onePlayerOnlinePerAccount = true
allowClones = false
allowWalkthrough = true
serverName = "Forgotten"
statusTimeout = 5000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
enableTwoFactorAuth = true
Post automatically merged:

Wait now re-read your message and got worried, is the .exe for the server in the right folder?

View attachment 87262

sorry for maybe a dumb question, but you nerver know
I'm pretty sure your password and database need to be "strings" instead of plaintext, otherwise the server can't use the values you input into config.lua

So just add "" around them?
 
Friend, the connection to the database is made through the source... if you want to do it through the config.lua, you need to add these lines to your config.lua. Test it and report back here.





-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "forgottenserver"
mysqlPass = ""
mysqlDatabase = "forgottenserver"
mysqlPort = 3306
mysqlSock = ""
 
Ok! not getting those errors anymore BUT, now when I open the server it just closes with no errors. It's, getting closer... Just not quite there yet


1727143159370.webp

Im running the server with myaac and wampserver now, since they are more compatible with newer code (ditched zaac and uniserver), my 127.0.0.1 client returns:
1727143287114.webp

my .env is as follows:
Code:
mysqlHost = "127.0.0.1"
mysqlUser = "root" 
mysqlPass = "" 
mysqlDatabase = "forgottenserver"
mysqlPort = 3306
mysqlSock = ""


my whole config.lua
LUA:
-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 24 * 60 * 60
whiteSkullTime = 15 * 60
stairJumpExhaustion = 2000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75

-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
-- NOTE: allowWalkthrough is only applicable to players
-- NOTE: two-factor auth requires token and timestamp in session key
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
httpPort = "3306"
httpWorkers = 12
maxPlayers = 0
onePlayerOnlinePerAccount = true
allowClones = false
allowWalkthrough = true
serverName = "forgottenserver"
statusTimeout = 5000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
enableTwoFactorAuth = false

-- MySQL
 sqltype= "mysql"
 mysqlHost = "127.0.0.1"
 mysqlUser = "root"
 mysqlPass = ""
 mysqlDatabase = "forgottenserver"
 mysqlPort = "3306"
 mysqlSock = ""



-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = -1

-- Houses
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality
-- NOTE: valid values for houseRentPeriod are: "daily", "weekly", "monthly", "yearly"
-- use any other value to disable the rent system
housePriceEachSQM = 1000
houseRentPeriod = "never"
houseOwnedByAccount = false
houseDoorShowPrice = true
onlyInvitedCanMoveHouseItems = true

-- Item Usage
timeBetweenActions = 200
timeBetweenExActions = 1000

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
mapName = "forgotten"
mapAuthor = "Komic"

-- Market
marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100

-- Misc.
-- NOTE: classicAttackSpeed set to true makes players constantly attack at regular
-- intervals regardless of other actions such as item (potion) use. This setting
-- may cause high CPU usage with many players and potentially affect performance!
-- NOTE: forceMonsterTypesOnLoad loads all monster types on startup to validate them.
-- You can disable it to save some memory if you don't see any errors at startup.
-- checkDuplicateStorageKeys checks the values stored in the variables for duplicates.
allowChangeOutfit = true
freePremium = false
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = false
classicAttackSpeed = false
showScriptsLogInConsole = false
showOnlineStatusInCharlist = false
yellMinimumLevel = 2
yellAlwaysAllowPremium = false
minimumLevelToSendPrivate = 1
premiumToSendPrivate = false
forceMonsterTypesOnLoad = true
cleanProtectionZones = false
checkDuplicateStorageKeys = false

-- VIP and Depot limits
-- NOTE: you can set custom limits per group in data/XML/groups.xml
vipFreeLimit = 20
vipPremiumLimit = 100
depotFreeLimit = 2000
depotPremiumLimit = 15000

-- Quest Tracker limits
questTrackerFreeLimit = 10
questTrackerPremiumLimit = 15

-- World Light
-- NOTE: if defaultWorldLight is set to true the world light algorithm will
-- be handled in the sources. set it to false to avoid conflicts if you wish
-- to make use of the function setWorldLight(level, color)
defaultWorldLight = true

-- Server Save
-- NOTE: serverSaveNotifyDuration in minutes
serverSaveNotifyMessage = true
serverSaveNotifyDuration = 5
serverSaveCleanMap = false
serverSaveClose = false
serverSaveShutdown = true

-- Experience stages
-- NOTE: to use a flat experience multiplier, set experienceStages to nil
-- minlevel and multiplier are MANDATORY
-- maxlevel is OPTIONAL, but is considered infinite by default
-- to disable stages, create a stage with minlevel 1 and no maxlevel
experienceStages = {
    { minlevel = 1, maxlevel = 8, multiplier = 7 },
    { minlevel = 9, maxlevel = 20, multiplier = 6 },
    { minlevel = 21, maxlevel = 50, multiplier = 5 },
    { minlevel = 51, maxlevel = 100, multiplier = 4 },
    { minlevel = 101, multiplier = 3 }
}

-- Rates
-- NOTE: rateExp is not used if you have enabled stages above
rateExp = 5
rateSkill = 3
rateLoot = 2
rateMagic = 3
rateSpawn = 1

-- Breakable Mana Shield
useBreakableManaShield = true

-- Monster Despawn Config
-- despawnRange is the amount of floors a monster can be from its spawn position
-- despawnRadius is how many tiles away it can be from its spawn position
-- removeOnDespawn will remove the monster if true or teleport it back to its spawn position if false
-- walkToSpawnRadius is the allowed distance that the monster will stay away from spawn position when left with no targets, 0 to disable
-- monsterOverspawn can be used instead of removeOnDespawn option, this will start respawn process of the monster when it goes out of deSpawn* boundaries.
-- Setting both removeOnDespawn and monsterOverspawn to true prioritizes the latter.
deSpawnRange = 2
deSpawnRadius = 50
removeOnDespawn = true
walkToSpawnRadius = 15
monsterOverspawn = false

-- Stamina
staminaSystem = true
timeToRegenMinuteStamina = 3 * 60
timeToRegenMinutePremiumStamina = 6 * 60

-- Scripts
warnUnsafeScripts = true
convertUnsafeScripts = true

-- Startup
-- NOTE: defaultPriority only works on Windows and sets process
-- priority, valid values are: "normal", "above-normal", "high"
defaultPriority = "high"
startupDatabaseOptimization = false

-- Status Server Information
ownerName = ""
ownerEmail = ""
url = "https://otland.net/"
location = "Sweden"


Thanks for the help so far, any idea why it closes with no errors?
 

Attachments

Its pretty new, r9 7900, but Ill test and report back in a few
Post automatically merged:

Ok so sse2 is a very old instruction set, Im not sure it pertains to my cpu being able to compile functional code as its brand new current/last gen zen cpu from amd BUT I did compile the whole thing again just to be sure (Im going slightly insane) on avx512 instead of avx and it seems to have yielded the same payload as last time.

Now with config.lua and myaac reconfigured (mostly same as last time but with no errors and less headache) I fire up wamp64 and this happens:
1727164590163.webp

the "executing raids event" stays there, still cant log in through 127.0.0.1 with the admin account or a regular user I just created on MyAAC


down here you can see a newly created character on a non admin user account also new.
1727164686162.webp




I really need some help in understanding whats going on, I'll post my phpmyadmim and the config and env files. Also this is TFS 1.7 and i'm aiming for 13.10 client version since its this version's target I read. I just plan on keeping it locally hosted and will give access to some friends through a private local network (I use zerotier which worked on a buggy canary build I ran before this TFS adventure)

My phpmyadmim overview 1727165330486.webp

My .env file changed to "tfs" for simplicity
Code:
MYSQL_HOST= 127.0.0.1
MYSQL_USER= "root"
MYSQL_PASSWORD= ""
MYSQL_DATABASE= "tfs"
MYSQL_SOCK=
MYSQL_PORT= 3306

my whole config file
Code:
-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 24 * 60 * 60
whiteSkullTime = 15 * 60
stairJumpExhaustion = 2000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75

-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
-- NOTE: allowWalkthrough is only applicable to players
-- NOTE: two-factor auth requires token and timestamp in session key
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
httpPort = 8080
httpWorkers = 1
maxPlayers = 0
onePlayerOnlinePerAccount = true
allowClones = false
allowWalkthrough = true
serverName = "tfs"
statusTimeout = 5000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
enableTwoFactorAuth = true

-- MySQL
 sqltype= "mysql"
 mysqlHost = "127.0.0.1"
 mysqlUser = "root"
 mysqlPass = ""
 mysqlDatabase = "tfs"
 mysqlPort = "3306"
 mysqlSock = ""



-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = -1

-- Houses
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality
-- NOTE: valid values for houseRentPeriod are: "daily", "weekly", "monthly", "yearly"
-- use any other value to disable the rent system
housePriceEachSQM = 1000
houseRentPeriod = "never"
houseOwnedByAccount = false
houseDoorShowPrice = true
onlyInvitedCanMoveHouseItems = true

-- Item Usage
timeBetweenActions = 200
timeBetweenExActions = 1000

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
mapName = "forgotten"
mapAuthor = "Komic"

-- Market
marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100

-- Misc.
-- NOTE: classicAttackSpeed set to true makes players constantly attack at regular
-- intervals regardless of other actions such as item (potion) use. This setting
-- may cause high CPU usage with many players and potentially affect performance!
-- NOTE: forceMonsterTypesOnLoad loads all monster types on startup to validate them.
-- You can disable it to save some memory if you don't see any errors at startup.
-- checkDuplicateStorageKeys checks the values stored in the variables for duplicates.
allowChangeOutfit = true
freePremium = false
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = false
classicAttackSpeed = false
showScriptsLogInConsole = false
showOnlineStatusInCharlist = false
yellMinimumLevel = 2
yellAlwaysAllowPremium = false
minimumLevelToSendPrivate = 1
premiumToSendPrivate = false
forceMonsterTypesOnLoad = true
cleanProtectionZones = false
checkDuplicateStorageKeys = false

-- VIP and Depot limits
-- NOTE: you can set custom limits per group in data/XML/groups.xml
vipFreeLimit = 20
vipPremiumLimit = 100
depotFreeLimit = 2000
depotPremiumLimit = 15000

-- Quest Tracker limits
questTrackerFreeLimit = 10
questTrackerPremiumLimit = 15

-- World Light
-- NOTE: if defaultWorldLight is set to true the world light algorithm will
-- be handled in the sources. set it to false to avoid conflicts if you wish
-- to make use of the function setWorldLight(level, color)
defaultWorldLight = true

-- Server Save
-- NOTE: serverSaveNotifyDuration in minutes
serverSaveNotifyMessage = true
serverSaveNotifyDuration = 5
serverSaveCleanMap = false
serverSaveClose = false
serverSaveShutdown = true

-- Experience stages
-- NOTE: to use a flat experience multiplier, set experienceStages to nil
-- minlevel and multiplier are MANDATORY
-- maxlevel is OPTIONAL, but is considered infinite by default
-- to disable stages, create a stage with minlevel 1 and no maxlevel
experienceStages = {
    { minlevel = 1, maxlevel = 8, multiplier = 7 },
    { minlevel = 9, maxlevel = 20, multiplier = 6 },
    { minlevel = 21, maxlevel = 50, multiplier = 5 },
    { minlevel = 51, maxlevel = 100, multiplier = 4 },
    { minlevel = 101, multiplier = 3 }
}

-- Rates
-- NOTE: rateExp is not used if you have enabled stages above
rateExp = 5
rateSkill = 3
rateLoot = 2
rateMagic = 3
rateSpawn = 1

-- Breakable Mana Shield
useBreakableManaShield = true

-- Monster Despawn Config
-- despawnRange is the amount of floors a monster can be from its spawn position
-- despawnRadius is how many tiles away it can be from its spawn position
-- removeOnDespawn will remove the monster if true or teleport it back to its spawn position if false
-- walkToSpawnRadius is the allowed distance that the monster will stay away from spawn position when left with no targets, 0 to disable
-- monsterOverspawn can be used instead of removeOnDespawn option, this will start respawn process of the monster when it goes out of deSpawn* boundaries.
-- Setting both removeOnDespawn and monsterOverspawn to true prioritizes the latter.
deSpawnRange = 2
deSpawnRadius = 50
removeOnDespawn = true
walkToSpawnRadius = 15
monsterOverspawn = false

-- Stamina
staminaSystem = true
timeToRegenMinuteStamina = 3 * 60
timeToRegenMinutePremiumStamina = 6 * 60

-- Scripts
warnUnsafeScripts = true
convertUnsafeScripts = true

-- Startup
-- NOTE: defaultPriority only works on Windows and sets process
-- priority, valid values are: "normal", "above-normal", "high"
defaultPriority = "high"
startupDatabaseOptimization = false

-- Status Server Information
ownerName = ""
ownerEmail = ""
url = "https://otland.net/"
location = "Sweden"

I read that the latest tfs should refer the .env as the mysql address and database reference, why is it that only after I add those to the config.lua that myaac accepts my database? Does this have anything to do with me not being able to log in?

trying to log in the 13.16 client (or any client) results in this error just like last time:
1727165799152.webp

Has anyone compiled the latest tfs? the guide is very barebones on OTSguide. Any of the devs can share some light? Im kinda of a noob at dev stuff, but maybe there's a log somewhere I could post for some troubleshooting?


this is the end of the build process:
1727166559283.webp


Thx for the help so far folks
Post automatically merged:

I compiled it on sse2 too, just to be sure still same behaviour:
1727166933013.webp


client still cant conect:
1727166957130.webp
 
Last edited:
fwiw, you were saying it was closing console immediately. That's what made me think of sse2.

Someone else needs to jump in, cuz I'm not the person for this job.
 
Back
Top