Dude, i dont remember... but i think its 1.xWhich version of TFS or another distro are you using?
I've checked it... The field "save" are seted to '1' for all the characters!Check your character in the database. it should have a field called Save. If it's set to 1, it's a different problem. If it's set to 0, your AAC is likely to blame.
check config.lua for a line related to character saving.
Don't have this line...worldType = "pvp"
hotkeyAimbotEnabled = "yes"
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeAmmoWhenUsingDistanceWeapon = "yes"
removeChargesFromRunes = "yes"
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2000
experienceByKillingPlayers = "no"
expFromPlayersLevelRange = 75
noDamageToSameLookfeet = "no"
ip = "192.168.0.14"
bindOnlyGlobalAddress = "no"
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 0
motd = "Welcome to The Forgotten Server!"
onePlayerOnlinePerAccount = "yes"
allowClones = "no"
serverName = "Forgotten"
statusTimeout = 5000
replaceKickOnLogin = "yes"
maxPacketsPerSecond = 25
deathLosePercent = -1
housePriceEachSQM = 1000
houseRentPeriod = "never"
timeBetweenActions = 200
timeBetweenExActions = 1000
mapName = "forgotten"
mapAuthor = "Komic"
marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = "yes"
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100
mysqlHost = "localhost"
mysqlUser = "root"
mysqlPass = "7698740"
mysqlDatabase = "otserver"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
allowChangeOutfit = "yes"
freePremium = "no"
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = "no"
rateExp = 5
rateSkill = 3
rateLoot = 2
rateMagic = 3
rateSpawn = 1
deSpawnRange = 2
deSpawnRadius = 50
staminaSystem = "yes"
warnUnsafeScripts = "no"
convertUnsafeScripts = "no"
defaultPriority = "high"
startupDatabaseOptimization = "no"
ownerName = ""
ownerEmail = ""
url = "http://otland.net/"
location = "Sweden"
enableLiveCasting = "yes"
liveCastPort = 7173
function onLogout(player)
player:save()
return true
end
How exactly can i do it?sounds like an issue in the source possibly. did you get your distro from the official github or did you get a custom distro from a forum?
As a workaround, you could make a logout creaturescript and call player:save() upon logout but it should be handled by the source.
something like this:
If that doesn't work, there's definitely something wrong with the source and you should compile or download a new exe.Code:function onLogout(player) player:save() return true end
void Player:nRemovedCreature()
{
//
}
I would have to recommend either downloading a new exe or compiling one. https://github.com/otland/forgottenserver
otherwise, perhaps try seeking assistance from the person who released it. The saving of characters occurs in player.cpp in onRemoveCreature, which calls to save the player using the save function in iologindata.cpp
I don't think it's anything in the datapack that's causing the issue.
Okey, i will download a new one, if it dont works i come back here...
@RazorBlade
In my player.cpp, the function is like that:
I'm nearby sure that by default TFS only saves characters at server save. You can add a script to save everything every 10 minutes, or to save the character at logoff/death.
Okey, i will download a new one, if it dont works i come back here...
@RazorBlade
In my player.cpp, the function is like that:
void Player::onRemoveCreature(Creature* creature, bool isLogout)
{
Creature::onRemoveCreature(creature, isLogout);
if (creature == this) {
if (isLogout) {
loginPosition = getPosition();
}
lastLogout = time(nullptr);
if (eventWalk != 0) {
setFollowCreature(nullptr);
}
if (tradePartner) {
g_game.internalCloseTrade(this);
}
closeShopWindow();
clearPartyInvitations();
if (party) {
party->leaveParty(this);
}
g_chat->removeUserFromAllChannels(*this);
std::cout << getName() << " has logged out." << std::endl;
if (guild) {
guild->removeMember(this);
}
IOLoginData::updateOnlineStatus(guid, false);
bool saved = false;
for (uint32_t tries = 0; tries < 3; ++tries) {
if (IOLoginData::savePlayer(this)) {
saved = true;
break;
}
}
if (!saved) {
std::cout << "Error while saving player: " << getName() << std::endl;
}
}
}
https://github.com/otland/forgottenserver/blob/master/src/player.cppCode:void Player::onRemoveCreature(Creature* creature, bool isLogout) { Creature::onRemoveCreature(creature, isLogout); if (creature == this) { if (isLogout) { loginPosition = getPosition(); } lastLogout = time(nullptr); if (eventWalk != 0) { setFollowCreature(nullptr); } if (tradePartner) { g_game.internalCloseTrade(this); } closeShopWindow(); clearPartyInvitations(); if (party) { party->leaveParty(this); } g_chat->removeUserFromAllChannels(*this); std::cout << getName() << " has logged out." << std::endl; if (guild) { guild->removeMember(this); } IOLoginData::updateOnlineStatus(guid, false); bool saved = false; for (uint32_t tries = 0; tries < 3; ++tries) { if (IOLoginData::savePlayer(this)) { saved = true; break; } } if (!saved) { std::cout << "Error while saving player: " << getName() << std::endl; } } }
What's the difference?I tought he was talking about actually saving the character, but it's just about storing it for the next logging. Right?
At TFS, by default, if I create a new character, go grab some exp, items and log out and in back I will continue from where I stoped, but if the server crashes nothing will be saved. It's like it store the progress in the memory while it's up, but need a proper save, like a daily server save to really save it.What's the difference?