Adding a New Potion

Going over how to add a new potion type to Action RPG.

Choose your operating system:

Windows

macOS

Linux

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

  1. 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.

  2. Next, right-click in the Content Browser and from the displayed list, select the Blueprint Class option.

    image12-1.png

  3. 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.

  4. Name the new potion GA_DeathsDoor .

    The GA in GA_DeathsDoor stand for Gameplay Ability.

  5. 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.

    image12-1.png

  6. 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.

  7. Give the newly created potion a name of GE_DeathsDoor .

    The GE in GE_DeathsDoor stand for Gameplay Effect.

  8. 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.

  9. Once that has been completed, make sure to compile and save the GA_DeathsDoor Blueprint.

  10. Then open up the GE_DeathsDoor Blueprint.

  11. 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.

  12. Expand the newly created Modifier and set the Attribute to RPGAttributeSet.Mana .

    Click for full image.

  13. 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.

  14. 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.

  15. 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.

  16. 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.

    image9.png

  17. Name the newly created data asset Potion_DeathsDoor and open it up.

    image1.png

  18. 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:

    image8.png

    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.

언리얼 엔진 문서의 미래를 함께 만들어주세요! 더 나은 서비스를 제공할 수 있도록 문서 사용에 대한 피드백을 주세요.
설문조사에 참여해 주세요
건너뛰기