SP8_PlayerShopComponent
Option | Description |
Max Allowed Shops | How many Shops one Player is allowed to open at the same time. |
Max Storage Size | How many Items can fit into the Storage. If the Player tries to open a new Shop and the count of the Items inside the Shop and inside the current Storage are higher then the Max Storage Size, the Player can not open the Shop. |
Minutes Till Shop Closes | How long will the Shop be open? Set -1 if the Shop will not close without calling removeShop. |
Player Shop Logging | Customize Logs Example: Key: Select LogType Type: Can be left empty if not needed SubType: Can be left empty if not needed (Sometimes it will be overwritten with different Values) Message: What should be printed to the Chat Box. OnlyOnDebug: If true, the Message will be only shown, if the “Player Shop Logging Debug” is set to true. |
Player Shop Logging Debug | If set to true, every Log of the Player Shop Component will be shown in the Chat. |
Function | Callable | Description | Default Use-Case |
createShop | Server & Client | Spawns the Player Shop Actor with Shop Name and Selling Items to the World. Also the Items will be removed from the Inventory. | Call if the User finished editing the new Player Shop with Name, Items and Prices. |
removeShop | Server & Client | Remove a Shop. Player needs to be the Owner of the Shop. | Call inside the Player Shop Widget. |
TryToClearStorage | Server | Add Currency and Items to the Inventory. All Items which could not be added to the Inventory, will be put back to the Storage. | Button inside the Storage Widget, so the Player can get all his Items from it. |
PurchaseItem | Server & Client | Buy an Item from a Player Shop. | Inside the Player Shop Widget, if the Player clicks on an Item. |
isItemPurchasable | Server & Client | Check if the Player can buy an Item. | Inside the Player Shop Widget, to show the Price as red, if the Player can not buy it. |
getItemFromActorShop | Server & Client | Get the Item inside a Player Shop Actor. | |
AddToStorage | Server | Add an Item to the Storage. | |
getStorage | Server & Client | Get all Items and Currencies inside the Storage. | To generate the Storage Widget. |
Initialize | Server | If you are using your own Save System, you can use this Function to set the Informations, which this Component needs. | Only if you do not call Load! |
Load | Server | Load all variables | Should be called on start. |
Save | Server | Save all variables |
Dispatcher | Called | Description | Default Use-Case |
Initialized | Client | Called if all Variables are set and the Component can be used. | Initialize all Widgets and stop loading Screen if all Components are initialized. |
StorageChanged | Server & Client | The Items or the Currency has changed inside the Storage. | Regenerate the Storage Widget and if not empty, make a hint to the Player. Not needed if you are using the PlayerTemplate! |
SP8_GameState_PlayerShopComponent
Option | Description |
Player Shop Actor | Actor which will be spawned to the World and can be interacted by other Players. |
Function | Callable | Description | Default Use-Case |
getCurOpenShopsCount | Server | Get current Shop Count of a Player. | |
createShop | Server | Create a new Shop. | |
removeShop | Server | Remove a Shop. | |
getCurOpenShops | Server | Get all open Shops. | |
getSaveData | Server | If you want to use your own Save System, you can get the Data, which needs to be saved. | Only if you do not call Save and Load! |
Initialize | Server | If you are using your own Save System, you can use this Function to set the Informations, which this Component needs. | Only if you do not call Load! |
Load | Server | Load all variables | Should be called on start. |
Save | Server | Save all variables |
SP8_BPI_PlayerShop (Only if you are not using SP8_PlayerTemplate)
Function | Callable | Description | When is it called? |
SP8_CanUsePlayerShop | Server & Client | Checks if the Player can use the Shop and buy something. | On Buy Item. |
SP8_CanCreatePlayerShop | Server & Client | Checks if the Player can create a new Player Shop | On Create Shop. |
Player Shop LogTypes
LogType | Description |
Error_UserKeyNotSet | The User Key will be set inside the Function Initialize. |
Info_ShopNameIsEmpty | Could not create Shop, because the Name is empty. |
Info_NoItemsInShop | Could not create Shop, because there are no selling Items. |
Error_MissingGameStateShopComponent | Game State does not contain SP8_GameState_ShopComponent |
Info_MaxAllowedShopsExceeded | Could not create Shop, because the Player exceeded the max Shops Count. |
Info_MaxStorageSizeExceeded | Could not create Shop, because the Player exceeded the max Storage Size. |
Info_BPI_CanCreateShopReturnsFalse | Interface Function CanCreateShop returned false. If using the PlayerTemplate: Sp8_Override_CanCreateShop. |
Info_CanUsePlayerShopReturnedFalse | Interface Function CanUsePlayerShop returned false. If using the PlayerTemplate: Sp8_Override_CanUsePlayerShop. |
Error_AmountNotBiggerThen0 | Item could not be added to new Shop, because the Amount is not enough. Shop will still be opened. |
Error_PriceNotSet | Item could not be added to new Shop, because the Price is empty. |
Error_ItemCouldNotBeRemovedFromInventory | Item could not been removed from the Inventory on CreateShop. Will not be added to Shop, but Shop will still be opened. |
Info_Initialized | Called on Initialize. |
Error_ShopActorNotValid | The Shop Actor is not valid. |
Error_ItemNotFoundInActor | Item could not be found inside the Shop Actor. |
Info_ItemAlreadySold | Item can not be purchased, because it’s already sold. |
Info_NotEnoughCurrency | Item can not be purchased, because the Player does not have enough Money. |
Info_NotEnoughSpaceInInventory | Item can not be purchased, because the Player does not have enough Space inside the Inventory to add an Item. |
Info_ItemAddedToStorage | Item/s was/were added to the Storage. |
Info_CurrencyAddedToStorage | Currency was added to the Storage |
Error_UserKeyNotEqual | The Player is not the owner of the Shop, so he can not edit it. |
Error_ShopActorNotFound | Shop Actor was not registered. |
Info_ShopClosed | Shop was closed, because the time reached 0 or the Player closed the Shop on his own. |
Info_ShopOpened | Shop was opened by the Player. Overwrite SubType with Shop Name. |
Info_ItemPurchased | Player bought an Item from a Shop. Overwrite SubType with Item Name and Amount. |