How can I set up a simple Skin Texture Shop?
So I created a widget to function as a Store for players to spend in-game points on stuff.
I am trying to find and figure out a way that I can allow them to spend points on New Character Skins which is basically just swapping out a Material/Texture after they unlock and enable it.
Can someone advise or point me in the right direction for how to do this? I have been looking around on google and youtube but I can't seem to find anything on this..
asked Oct 02 '18 at 11:42 PM in Blueprint Scripting
Create a struct with all your item details, in the struct you could have variables like price, name, material etc Create a second struct containing the struct you just made - make this an array type.
Create a widget to display the item, inside it make a variable with your 1st struct( the one with the name price etc) Set the variable to instance editable and expose on spawn.
When you want to display the items, reference the 2nd struct (the one with the arrays) and do a for loop with. On every loop create the item widget, you will see the variable you made when you select the widget to create, In the for loop you will see the structs within the array, plug that into the exposed variable you will see when you create the widget.
In the widgets "onConstruct" event, set the price and name from the struct variable inside it.
To see if the player has the item, you can add the second struct you created(the array one) to a savegame file and just add the item every time the player buys it, when the widget is created just do a find node on the widget struct and check to see if the player save struct contains the widget struct,
I use SQL for this stuff as the save game is easily hacked.
There is no wrong way, just use your imagination :)
Follow this question
Once you sign in you will be able to subscribe for any updates here