To help counter the damage that is done by the monsters in Action RPG (ARPG) the player can purchase and consume potions. Currently, there are two potions in ARPG that a player can use, a Health Potion that restores the player's health and a Mana Potion that restores the player's mana. In the following How-To, we will take a look at creating a new potion that will restore the players health and mana.
Steps
- First, locate the Potions folder in the ARPG project.
Click for full image
Since ARPG uses the Asset Manager, all potions that the player will use must be placed in the potions folder or they will not show up in the store or players inventory.
-
Next, right-click in the Content Browser and from the displayed list, select the Blueprint Class option.
- From the Pick Parent Class window, locate the All Classes section and input GA_PotionBase into the search box and click on GA_PotionBase. Then click Select to create the new asset.
Click for full image.
- Name the new potion GA_DeathsDoor.
The GA in GA_DeathsDoor stand for Gameplay Ability.
-
Now that we have the Gameplay Ability part of the effect which controls the visuals next we need to create the Gameplay Effect. The Gameplay Effect controls the values that are applied to the player's health when the potion is consumed. To do this, right-click in the Content Browser and from the displayed list, select the Blueprint Class option.
- From the Pick Parent Class window, locate the All Classes section and input GE_HealBase into the search box and click on the GE_HealBase. Then click Select to create the new asset.
Click for full image.
- Give the newly created potion a name of GE_DeathsDoor.
The GE in GE_DeathsDoor stand for Gameplay Effect.
- Next, double-click on the GA_DeathsDoor potion to open it up in the Blueprint editor and in the Details panel input the following information:
- Montage to Play: AM_Item_Potion
- Target Gameplay Effect Classes: GE_DeathsDoor
Click for full image.
-
Once that has been completed, make sure to compile and save the GA_DeathsDoor Blueprint.
-
Then open up the GE_DeathsDoor Blueprint.
- In the Details panel of the GE_DeathsDoor Blueprint click the addition icon in the Modifiers section to add an additional modifier.
Click for full image.
- Expand the newly created Modifier and set the Attribute to RPGAttributeSet.Mana.
Click for full image.
- Next, set the Scalable Float Magnitude value to 2.0. This will make sure that we are restoring the maximum amount of mana.
Click for full image.
- Click on the table entry and from the displayed list, select the AttackDamage option, setting the None input to Heavy Attack. Once that has been completed, make sure to compile and save your Blueprint.
Click for full image.
- Next, go to the Items \> Potions folder and then right-click in the Content Browser. From the displayed list go to the Miscellaneous section and select Data Asset.
Click for full image.
-
In the Pick Data Asset Class dialogue box, under the All Classes section, look for and click on the RPGPotionItem and then click the Select button.
-
Name the newly created data asset Potion_DeathsDoor and open it up.
-
The information that is filled out in this Data Asset is what the player will see when this item is viewed in the User Interface (UI). The following table lists all of the items that you will need to fill out:
Property Name Value Item Type Potion Item Name Deaths Door Item Description Recovers 50% HP & 50% MP Item Icon T_UI_Potion_Mana Price 100 Max Count 0 Max Level 1 Granted Ability GA_DeathsDoor
End Results
Now, press the Play button to launch ARPG and navigate to the Potions menu. You should now be able to purchase the Death's Door Potion like in the video below.