Data Tables and Widget Menu

Hello I am creating a menu that will allow you to purchase items based on the quantity, price, and the total as seen in the picture below.

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?

Nah, the 2nd element is the entire struct. The same struct you use in the DT…

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?

I might have mis-read however I can not set the 2nd element to the structure I used for the DT.

Why not? You’re already using it in the data table.

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.

1 Like

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?