Before you can continue with this Tutorial, you need to create your own Widget and add a Function to it, called openShop.
As Input should be a Data Table called Shop.
The Input should be saved to a new Variable and then you need to get the SP8_S_Shop Structure out of it and display the Shop Widget.
Look inside SP8_WBP_Shop inside the Directory RPG_Essentials / Example / Widgets, on how i did it.
What’s the difference between Global Shops and normal Shops?
It’s simple.
Global Shops do not call the Interface Function SP8_CanUseShop and SP8_Overwrite_CanUseShop (PlayerTemplate).
But the Component will check, if the GlobalShops Variable inside the Details Panel of the Component does contain the Shop which is used.
Example for both cases:
Global Shop:
Shop which can be opened everywhere by pressing a key.
Item Shop with a custom Currency (Currency can be bought on Website or somewhere else.
Normal Shop:
NPC, which can be interacted with to open the Shop.
Inside SP8_CanUseShop you need to check if the Shop NPC is in range.
Alternative you can create Shops, for example which need a Level or Stat which is high enough to open/buy in the Shop.
In this Tutorial we will create a Global Shop, which can be opened by clicking the Key N.
This will be our Shop (You can create a different one, if you want):
Important: I will use the Currency Diamond, which you would need to add inside your Tooltip to be displayed.
Look inside this Tutorial under 9!
1. Now we are ready to start.
Open your Player BP and add a new Item to Global Shops inside the Details Panel of the Shop Component.
Add your Shop Data Table to it.
2. Listen inside your Player BP to the Key N and call the openShop Function of your Shop Widget.
I’ve added the Shop Widget to my own HUD Widget!
Select as Input your Shop Data Table.
If you now press the Key N inside your Game, you can open a Shop and purchase Items whereever you are.