I have created a data table that holds the items name, price, quantity, and total, and was going to bind the name, quantity and total to the respective spots in the menu which I believe I can do. However, I am trying to code the parts for when you hit the + and - buttons which will affect the quantity but I am unable to set the value in the data so that the bind will change the value shown. Is there a way to change a value in a data table during gameplay?
I am unable to set the value in the
data so that the bind will change the
value shown. Is there a way to change
a value in a data table during
gameplay?
No. Data Table is static, it’s not a Data Base.
Read the content of the Data Table and place it in a Map container variable. You can then access / modify that variable. Its overall structure will be identical to that of a DT minus the snazzy interface.
You will need to do it anyway as you will, surely, want to Save / Load the Game at some point.
Aw that sucks. I looked into the map and it is almost what I am looking for however, when you create the map, each element can only hold 2 values. However, for my game I need there to be 4: Product name, price, quantity, and total. Is there another way that I could do this?
Ah ok, so I set the 2nd variable type for the variable map to data table, then set the data table I made as the entry. So I guess, how do I use it? Is there some forum explaining how this would work?
Use the same struct you used in DT in the Map. The DT is really a Map but with a funky interface you can click. If in doubt, post a screenshot of what does not work.
Ah ok. So I have now done it both ways, so would it be more beneficial to make a structure variable food each product, or use the map variable with all the products as all the elements on the menu I showed need to be bound to each element in the map variable which would be a lot more time consuming?
As of right now if I use a structure variable for each item creating the bind for each element in the menu is much quicker.
Would the having multiple structure variables be better than 1 data table map variable? Does it come down to preference? Does one take more space than the other?