🤼 Player: Party Member

In this tutorial, I'll show you how to create a party member with very basic behaviors:
  • Follow you
  • Attack nearby enemies
  • Return to you when no enemies are nearby
  • Die when HP drop to 0
You can create a more complex version, but today we'll start with the basics.

Step 1: Spawn Actor

Firstly, I'll spawn an actor when a map starts if he's in the party. My actor is Baby.


Step 2: Creator Actor



Next, I'll create an event named the same as what we wrote in Spawn Event command: Party Member: Baby. Then I setup his HP using actor id 2 from database by putting <hp: actor, 2> in notetag. After that you'll have this.



Step 3: Behavior: Follow Player

To make the baby follow the player, we only need these commands.

Wait command helps reduce the amount of time the event checking. Help optimize performance.

Explain: checkRange will check if the baby is within 3 tiles from the player, but !checkRange will check if the baby isn't within 3 tiles from the player. If so, keep moving him to the player till it's within 3 tiles from the player. You can adjust 3 to a lower number to make the baby come nearer to you before it stops.


Step 4: Behavior: Detect and Attack nearby enemies



Create a new conditional branch checkRange with notetag <enemy> and put what we made in step 3 to else section of this conditional branch. This means if within 7 tiles, if there's an event notetag <enemy>, we'll do x, if not, we'll do step 3, which is for the baby to follow player.

Now, if there is an <enemy> within 7 tiles, we'll do a loop: We make the baby chase the <enemy> until it reaches 2 tiles near the enemy, then we make it jump onto the enemy and create a damage hitbox. Here I use <dmg: actor, 2, atk> to use attack value from database of actor id 2: The baby.

After the attack, I made the baby wait for 80 frames before breaking that loop so it could restart the cycle. Here's the result.



Step 5: Defeat Status

Now let's create the defeat status for the baby. We create a new self-switch page.


Since this is a baby, in defeat state I'll just let it spin non-stop and recover all HP, then return to normal state by turning off Self-Switch of this page.

Step 6: Collision with Enemy

Let's make this baby able to receive damage from enemies.


Firstly I'll create a common event called Ally Collision and create a conditional branch:
If this event (baby) collides with any events with notetag <enemyHitbox>, it'll decrease HP of the baby based on <dmg: x> notetag of the event hitbox.

Then, if actor Baby is 0 HP (in RPG maker when you reach 0 HP you get affected by Dead status), it'll turn on Self Switch A, which is Defeat page from step 5.

Next, we let the baby call this common event passively by adding <passive: Ally Collision> to the page that needs it.



Result





5 RPG Maker Action Combat Manual: 🤼 Player: Party Member In this tutorial, I'll show you how to create a party member with very basic behaviors: Follow you Attack nearby enemies Return to you w...