How would I save this kind of data?
Hello, I'm quite stumped here,
I am currently making a car game. In this car game, the user can choose between a variety of cars BUT ONLY IF HE'S PURCHASED THIS. Assuming I already have an ingame-currency system setup, how would I store data about what cars a player has purchased or not?
In the past, I made a SaveGame blueprint. In this blueprint, I had a Map variable (dictionary) called VehicleLog. In this data structure, I have a string-key which represents the vehicles named, followed by a struct-value. This struct stores a boolean called "isPurchased?" and a CLASS reference to it's respective blueprint for spawning in.
Then, everytime I load the game, I have my gameinstance store whatever is in the SaveGame file.
Currently, this approach is tedious. What if I want to add more vehicles later on? I would have to go to the SaveGame and add to it's dictionary.
What I tried to do before is create a DataTable to model this. Unfortunately, UE4's DataTables are read-only, so that's unfortunate.
What's another way I can represent this data, such that this proposed method could easily be updated and modified. I'm thinking about using SQL, but doesn't that require an internet connection to a Web Service? This game should be offline available too.
asked Apr 01 '18 at 10:33 PM in C++ Programming
i think you just need a function "AddCar" this function will help you add another car into the Map,it will generate a string-key value and insert the value into map.
answered Apr 02 '18 at 02:41 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here