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

TFS 1.X+ Changes in xml / lua don't apply immediately

  • Thread starter Deleted member 210450
  • Start date
D

Deleted member 210450

Guest
Hi. I have discovered a very annoying "bug" in my TFS 1.3. Sometimes it doesn't update changes made in files immediately.
For example, i'm editing numbers in vocations.xml (mana regen etc.) or damage formulas in spell.lua and it is not changing after server restart (sometimes it updates after x restarts, but not forced, im just restarting server every few minutes for testing). It updates after x time (don't know if that depends on time, or amount of restarts).
I have no idea why is that.
 
Then either you have multiple instances of TFS processes running or you are editing wrong files. This "bug" is not a bug. There is no cache, there is nothing in TFS that would cause this.
 
None of those.

I discovered it might be somehow related to database. I've got 2 sorcerers on account. One of them has correct numbers from vocations.xml, the other one not. What is weird because that good one is copied from the first one, but with changed level and name.
 
None of those.

I discovered it might be somehow related to database. I've got 2 sorcerers on account. One of them has correct numbers from vocations.xml, the other one not. What is weird because that good one is copied from the first one, but with changed level and name.
If you are changing numbers like skill multipliers or starting values (cap, soul etc.) then ofc it won't apply to already created characters.
 
Well, but it haven't. That was the main reason i created that thread. Once i had 12 mana per 5s for sorcerer, then i changed it to 10 mana per 5s, and for one sorcerer it stayed at 12. I could say its fixed since i copied working one, but i imagine situation i will edit it once again with 500 players on the server, then what :v
 
Well, but it haven't. That was the main reason i created that thread. Once i had 12 mana per 5s for sorcerer, then i changed it to 10 mana per 5s, and for one sorcerer it stayed at 12. I could say its fixed since i copied working one, but i imagine situation i will edit it once again with 500 players on the server, then what :v
Regeneration is applied as Conditions when player logins, with values based on vocations.xml. There is no way that it didn't update.
 
Oh, so maybe it is connected to error i have since ever (any time, any TFS) during creating character via SQL.

1629039890073.png
 
Regeneration is applied as Conditions when player logins, with values based on vocations.xml. There is no way that it didn't update.

IIRC the regeneration condition is persisted with all the values, so changing them in vocations.xml won't have an effect until your current condition ends. Unless something has changed in TFS.
 
IIRC the regeneration condition is persisted with all the values, so changing them in vocations.xml won't have an effect until your current condition ends. Unless something has changed in TFS.
That works with food and such, not vocation regeneration, they don't have time limit. This function is executed every time player is loaded.
 
That works with food and such, not vocation regeneration, they don't have time limit. This function is executed every time player is loaded.

Indeed it is, but the conditions are persisted inside storedConditions of the Player class, so when the setVocation is called it does not find the regeneration condition, thus it does not update it. storedConditions are "moved" to regular conditions after placing the creature.
 
Indeed it is, but the conditions are persisted inside storedConditions of the Player class, so when the setVocation is called it does not find the regeneration condition, thus it does not update it. storedConditions are "moved" to regular conditions after placing the creature.
No. They are not persistent, all conditions with ticks == -1 (so without time limit) are not saved. Also there is no such thing as storedConditions.
Saving only the one that are persistent.
 
No. They are not persistent, all conditions with ticks == -1 (so without time limit) are not saved. Also there is no such thing as storedConditions.
Saving only the one that are persistent.

storedConditionList 🙄

+ forgottenserver/player.lua at a14ae3d1e2bf3d9793cdb8dbbaa877fede1b9264 · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/a14ae3d1e2bf3d9793cdb8dbbaa877fede1b9264/data/lib/core/player.lua#L3-L22)
 
Literally useless, also love that comment next to it TODO: This variable is only temporarily used when logging in, get rid of it somehow.

Could you just go eat banana, logout, change regen amoun / ticks of a vocation assigned to that player, restart/reload, log in and see that it is not updated and is still using the old values?
 
Regeneration condition from food is a completely different thing.

I don't have any idea what are you on about. That's what this issue is about, that's what "editing numbers in vocations.xml (mana regen etc.)" is. Regeneration condition. Food.
 
I don't have any idea what are you on about. That's what this issue is about, that's what "editing numbers in vocations.xml (mana regen etc.)" is. Regeneration condition. Food.
Oh my god, I just checked Player.feed function and food is changing default regeneration. How stupid is this? If you make vocation regenerate more than food and someone eats food then they regen less? Why the heck would this be a thing, food should have its own, separated condition.
 
Back
Top