Log in

View Full Version : Is there a way to refresh values from inventory coins?



alloowishus
November 17th, 2024, 19:34
Because I am having difficulty with adding a number field, I am using the coins node and adding a custom box called "PERC" for the selling percentage of items so they can be bought automatically. However, I notice that when I change the value, it doesn't seem to write it to db.xml until I close the character sheet. Is there a way to have the coin values auto write when a value has changed? Or is there another way around this?

Trenloe
November 17th, 2024, 22:15
db.xml doesn't contain the values of the FG database at any exact moment in time, that is all stored in FG's memory. db.xml is just the copy used to load into memory when the FG campaign starts, it's auto saved every 5 minutes as a backup. You can force FG to write its current memory to db.xml with the /save chat command - but this will only be a copy of the memory at that one point in time. If you're not using the /save chat command then I imagine the exiting of the character sheet is just coincidence and it was the same time as the FG 5 minute auto save.

alloowishus
November 18th, 2024, 16:44
db.xml doesn't contain the values of the FG database at any exact moment in time, that is all stored in FG's memory. db.xml is just the copy used to load into memory when the FG campaign starts, it's auto saved every 5 minutes as a backup. You can force FG to write its current memory to db.xml with the /save chat command - but this will only be a copy of the memory at that one point in time. If you're not using the /save chat command then I imagine the exiting of the character sheet is just coincidence and it was the same time as the FG 5 minute auto save.

Ok thanks but I don't think that is correct, every time I close and reopen the CT it sets the correct value, so I think that triggers a write. I will try the /save command though, thanks.

Trenloe
November 18th, 2024, 17:11
Ok thanks but I don't think that is correct, every time I close and reopen the CT it sets the correct value, so I think that triggers a write.
I'm not aware of any FG ruleset code that specifically triggers a write to the database, unless the code is using an undocumented API call. What ruleset are you using? Anyway, it doesn't really matter for this discussion, what I said is correct - the db.xml file is only an accurate representation of what is in FGs memory when the db.xml file is last saved,

LordEntrails
November 18th, 2024, 21:58
I believe the proper way to check an attribute value is to use a debug statement and write the value to chat.

damned
November 18th, 2024, 22:28
Ok thanks but I don't think that is correct, every time I close and reopen the CT it sets the correct value, so I think that triggers a write. I will try the /save command though, thanks.

Trenloe is correct (he always is).