Quote Originally Posted by Tabulazero View Post
The problem I encounter is that when I test with only one pool in any configuration it works like a charm but as soon as I try to do all three pools it breaks down. What I guess is happening is because of the time it takes to read/write in the DB I get a conflict with multiple function trying to read the same DB field and decrement it.
The issue you may have with database fields is that only the GM and one other player (if assigned as the owner) can change a database field. This carries into FG scripts running on a player instance - they have the same rights access rights. So, it's possible if you're running code on the GM and player side, that it's not updating the DB field because of ownership. If you have the FG console open on each instance, you'll see warnings about not being able to update fields because they aren't owned - it's not reported as an error, so the console won't pop up.

The usual way to address this is to use OOB messaging - to send the request to the GM instance to update the database.

The issue you'll have with global packages is that they are just "global" to each instance of FG - i.e. any variables stored in them are only within that instance. You could use OOB messaging to run the code on the GM side and access a global package there (so the GM global package stores the data), but if you're doing that you may as well use OOB messaging to read/write to the database and keep the database as the master data store.