Forum BigDB Loading player data from templates.

Discussion and help relating to the PlayerIO database solution, BigDB.

Loading player data from templates.

Postby MrBiscuits » October 13th, 2011, 11:17 am

I want the player's data to just be a list of templates that are loaded in from separate tables of data. This is because I want to be able to change the templates without having to update each and every player object as well.

I'm not really sure about how to do this with callbacks when using the PlayerIO.BigDB.Load function. I want all the templates to be loaded into the game before the program continues, however each individual template that is loaded has a different callback function. How can you tell when everything is loaded correctly?

I could have a global counter variable that the callback uses to determine all templates are loaded and then calls another function, but if there is a problem with loading one of the templates then the program would then be stuck.
MrBiscuits
 
Posts: 26
Joined: May 15th, 2011, 8:09 pm

Re: Loading player data from templates.

Postby Henrik » October 21st, 2011, 9:16 am

Put all templates in the same table and use LoadKeys to load them all at once.

http://playerio.com/documentation/refer ... b#LoadKeys

Remember that BigDB is not column-based, objects in the same table don't need to have the same properties, so you can safely put all your templates in one table no matter what the individual template objects look like.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to BigDB