🦸🏻 Player: Create a player from scratch (the easy way)

After this tutorial, you'll be able to create a basic player character system that:
  1. Use your own graphic
  2. Dodge
  3. Melee Attack
  4. Death

1 - Setup Graphic Element



I'll use this spritesheet. The graphic has to be one character only and not 8. For one character spritesheet, RPG Maker requires them to be named as $something.png

2 - Dodge

Now let's turn on a switch, let's call this switch Player Control. Then create a common event runs in Parallel with Player Control ON. This means when this switch is ON, this common event will run.


In this common event, I'll add commands:
Conditional Branch: Input.isTriggered('space'). Under the TRUE section of the conditional branch, I'll add Set Movement Route command: Speed: 6 > script call: dash(4.5) > Speed: 4. This means when spacebar is triggered, change player speed to 6, then dash about 4.5 steps, then when dashing is finished, change back to speed 4.


3 - Melee Attack

Similar to what shown above, we create another conditional branch: TouchInput.isTriggered(). Under TRUE section, we call command Swing Weapon. I'll select a Pan file.



Now if you test the game, you'll see when you click on the screen, the player will swing the pan as the weapon, but that's just visual part. To damage other events, we need to create a hitbox.


Let's create 4 conditional branches, each check Player direction. Then let's say if player is facing down, we'll create a dynamic event that last for 3 frames. This event will have notetag: <dmg: 19 - 20> <playerAttack> <hitbox: 1, 2>

  • <dmg: 19 - 20> will deal 19 - 20 damage
  • <playerAttack> currently does nothing, it's just a name we assign to the event
  • <hitbox: 2, 1> if player facing down, the size of hitbox will be width 2 tiles, height 1 tile
We've successfully create a feature where if player click on screen, player will attack and each direction player attack will create different hitboxes. Now let's make events receive damage when our hitbox touch them. In your enemy, let's add a comment <passive: Enemy Collision> to its page. Don't forget to give this eveent some hp using <hp: x - y> or <hp: x> or <hp: enemy name from database>


Now let's create a new common event named Enemy Collision so it matches the <passive>. In here I'll create a conditional branch checkCollide(this._eventId, '<playerAttack>). Trigger will be None. Despite it being None, it's actually running in parallel because we basically just told the plugin to run it in parallel when the enemy exists (<passive> method).



Under TRUE section of checkCollide, create command Increase / Decrease Enemy HP. Event ID is this to target the event calling the common event. The event is the event using <passive>. In HP Change, we write - damage. This means it'll use the value <dmg: 19 - 20> of the hitbox earlier. We're basically done already but I'll add one more command Pop Text Value. In Value I'll write damage. What this does is display the damage value on screen.

To make it easier to understand:
1. We name Pan hitbox as <playerAttack> with damage of 19 - 20
2. We let the enemy to call common event Enemy Collision in parallel
3. The enemy then check for collision with events that have notetag <playerAttack>

4 - Death


Death is quite easy. Just add a conditional branch to check the State of an actor and we choose Death.



That's pretty much how you create a player from scratch. Practice and feel free to share your result to the Discord group. :)
5 RPG Maker Action Combat Manual: 🦸🏻 Player: Create a player from scratch (the easy way) After this tutorial, you'll be able to create a basic player character system that: Use your own graphic Dodge Melee Attack Death 1 - Se...
< >