Storing Permanent Variables In GameMode For Multiplayer?
I currently have an item structure array (which includes an item ID) stored in Player Controller which makes up my players inventory, all works fine with it. When I log in I get my array of item IDS from my backend (GameSparks for now) and this is the part I'm struggling with. Currently I have all of my actual item structure variables stored in my GameMode (since this is server only and clients cannot modify the variables).
So when I get my item ID array from my backend, I cast to GameMode through an RPC and have my GameMode return the item structures based on the item ID and then I set my item structure array in my Player Controller to this return value. Is this a valid way to perform this? Or is there a better way to achieve this data storage? It feels weird to create hundreds of variables for each item structure and keep them all in my GameMode class...
I've looked into storing the item structures in Data Tables but from what I can tell it seems like they could be modifiable by a client which would compromise the stats on an item and ruin gameplay. I could use any advice on where to keep a list of never-changing item data that players could retrieve with a list of item IDS (integer array).
asked Jul 03 '18 at 06:45 PM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here