While we move on to making a shopping interface, via the Shop button, we must first be able to pull the currency in order to pay for items in the shop. In a previous chapter, we discussed and made placeholders for gold, but we did not actually create gold values. In this game, we would like gold to be dropped by enemies at the end of battle. In this case, enemies will need some sort of gold data that we can add to the player's gold data (eventually, items will need this gold data that is tied to them as well). In Chapter 4, Pause Menu Framework, we created a pause menu that has a gold placeholder, and we will now add gold to this pause menu.
First, let's add a Gold
property to FEnemyInfo.h
. Navigate to Source | RPG | Data, open FEnemyInfo.h
, and add a Gold
property of an integer data type to your EnemyInfo
table, as follows:
UPROPERTY( BlueprintReadOnly, EditAnywhere, Category = "EnemyInfo" ) int32 Gold;
We now need to tie the Gold
property with our standard...