In order to allow party members to gain experience points from battle, we need to add experience points (which we will call XP) variables to our code. Moreover, the XP variables need to accumulate to a given XP cap (which we will call MXP for maximum XP), and if this cap is hit, the player will gain a level. The best way to do this is to add these variables to our source code, which we will then apply to every party member and enemy that we have in the game. The first thing we will do is add XP and leveling data to our Data classes. Navigate to UnrealRPG | Source | Data and open FCharacterClassInfo.h
. In the FCharacterClassInfo : public FTableRowBase
struct, add UPROPERTY
to XP
that will hold cumulative experience, MXP
that will hold the experience cap to the next level, and Lvl
that will hold the party member's current level:
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "ClassInfo") int32 XP; UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =...