Simple Bombs: How to make Explodable Objects

Vassim74

It's a Secret!
Veteran
Joined
Jan 7, 2014
Messages
115
Reaction score
85
First Language
English
Primarily Uses
RMMV

Hello everyone, today I'll be showing you how to make a simple bomb system that can blow up objects using only event commands, just like in the gif above! This is my very first tutorial for any RPG Maker so I'll try my best to make it as easy to understand as possible. Because I'm using a lot of images for this step by step guide, I decided to put everything in a spoiler tag.

What you need:

- A legitimate copy of RPG Maker MV

- Some understanding of switches and variables

- Comfort using script commands

- Sprite graphic for the bomb and an explosion animation effect (latter is optional, but it'll look weird without it)

- Patience to get through this guide

Known limitations/drawbacks:

- You can only place one bomb down at a time. Can probably be reworked to include more, but for the sake of this tutorial we will only be using one bomb to keep it simple.

- The bomb sprite and the event to control the bomb's coordinates must be included on every map where the player is allowed to use bombs (ideally somewhere the player normally can't walk to). This is because the event controller is kind of complicated to do as a common event.

Setup Guide:
First, let's launch RPG Maker MV and open the Database editor. Navigate to the Items tab and create a new item entry. Call it whatever you'd like, but for this tutorial we will call it Bomb. Give it an icon and configure the item as shown in the blue circle below:



Next, we will create an event to be used as a sprite for the bomb when the player places it down. Go ahead and create the event anywhere you like on the map and give it whatever sprite you want. In the example below, I'm pretending that the Iron Ball from the RTP charaset is a bomb, and I'll be placing it at coordinates x: 0 and y: 0 . The options in the red circle are optional, but I configured it that way so that players can move through their bomb.

Configure the event with a self switch and note the switch letter, as we want the bomb to be invisible at all times until it's been placed down by the player. Also note the Event ID I circled in blue at the top, as we will be needing it for a script command later.



After you're done making the bomb sprite event, let's make another event next to it. We will make it a parallel event and add a wait timer with 1 frame. This part is probably optional, but I like to add it just in case because parallel events in previous RPG Makers caused in-game lag for me when I didn't add it.



Once you're done with the above step, we will be adding a conditional branch in this event. This condition will do a check to see if the player's party is carrying the Bomb key item we made in the Database earlier. Follow the example below:



Next, we'll be adding another conditional branch inside the one we just made. The purpose of this conditional branch is to place the bomb down when a certain button is pressed. In the example below, I'm using Pagedown as my bomb placement button, as it doesn't really do anything as far as I know when you're moving around on the map. Again, make sure you place it inside the previous conditional branch as indicated by the red arrow on the left.



Next, we'll be making two variable controls: one for the player's X coordinate and another for the player's Y coordinate. This will calculate where the player's position on the map is when they press the Pagedown button.

Follow the example below and make sure you place the variables inside the conditional branch we just made for the button press, as indicated by the first red arrow. This is important because later when we make a breakable obstacle, the obstacle will know that it's supposed to blow up if the player was right next to it when they pressed the Pagedown button.



Configure the two variables as shown in the numbered order below:





Below the two variable controls we just added, we'll be using the Set Event Location to place the bomb sprite where the player is currently standing. Make sure you select the bomb sprite as shown in step 1 below, and use the variable coordinates as shown in step 2:



We will now use script commands to control the bomb sprite's self switch. Before we can do that, you will need to know the bomb sprite's Event ID and self switch letter as I had pointed out earlier, as well as the Map ID that the bomb sprite is located in (circled in blue in the screenshot below for those who don't know). Once you have these info, we will need to type it in the exact order as shown in the screenshot. Here are the parameters that the letters in the screenshot represent:

A = Map ID
B = Event ID
C = Self Switch Letter
D = True/False, with true = ON and false = OFF​

In my example, the bomb sprite is inside a map with an ID of 1 and also has an Event ID of 1. It is using Self Switch A as well, and we want to turn it on so that it becomes visible.



Once you've added the script command, we will add a wait timer until the bomb's detonation. I'm using 120 frames so that the bomb will explode in 2 seconds after the player has placed it down.



Next, we will add another script command to control the bomb sprite's self switch. Copy the first one you made and paste it after the wait timer we just made. We will change it from true to false as shown in the blue circle below in order to make the bomb invisible again after it explodes.



As I've mentioned before, this part is optional, but let's add this anyway for the sake of the tutorial. We'll make it show an animation once the wait timer reaches 120 frames. That way the player will know that the bomb exploded. In this example, I'm using Fire One 2 from the default list of animations because it fits best.



Now we add another Set Event Location command in order to move the bomb sprite back to its original location. This part is also optional, but I consider it good practice because I have plugins in my project where certain features might be interfered with if the bomb isn't moved back to its original spot.



If you've configured everything exactly the way I showed so far, the event should come out looking similar to this:



Now that we're done with making the bomb placement event, we'll go ahead and make a breakable object. In this example, I'm using a rock from the RTP tileset. Configure it as shown below. Again, the 1 frame wait timer is probably optional, but add it just in case.



Click on New Event Page at the top and configure it with a Self Switch as shown below. The graphic image is optional, but I like to use the rubble tile from the RTP tileset to show the boulder's remains.



Once you're done, exit out of the event and back to your map editor. In this step, we want to find out what the coordinates next to the breakable rock are. The numbers in the blue circle in each of the screenshots below are coordinates for the location pointed out by the red arrow. You can check all 8 of the surrounding coordinates if you want diagonal explosions to blow up the rock too, but I will only be using 4 in this tutorial.






Now that we know the surrounding coordinates of the rock, we can open the breakable rock event again and add variable conditions in order to check if the player is standing next to it when they press the Pagedown button to place a bomb.

First, we will add conditional checks to see if the player is standing on an adjacent tile to the north and south of the rock. To accomplish this, we will make the first conditional branch do a check to see if the player is on the same X coordinate as the rock (make sure to check the Create Else Branch as we will need it later).

From looking at the screenshots of the coordinates earlier, we can safely assume that the rock is on x:11 and y:4 . You can also just click on your rock and grab the exact coordinates from there as well.




Next, we'll make another conditional branch to check if the player is standing on the tile north of the rock. Be sure to place it inside the If branch of the previous condition as indicated by the red arrow in the screenshot below, and check the Create Else Branch:



Next, we'll make another one to check if the player is standing on the tile south of the rock. This time we place it in the Else branch of the previous condition as indicated by the red arrow, and make sure not to check the Else branch on this one:



Now that we've gotten the Y coordinate checks out of the way, we will have to do X coordinate checks next to see if the player is standing on the adjacent tile to the left and right of the rock.

Inside the Else branch of the first conditional branch we made (indicated by the red arrow below), we will do a check to see if the player is on the same Y coordinate as the rock. Configure as shown below and make sure the Create Else Branch isn't checked:



Next, we'll make another conditional branch inside the Y branch to check if the player is to the left of the rock. Configure as shown and make sure you place it where the red arrow is pointing:



Now we make another check to see if the player is standing to the right of the rock. Place this conditional branch inside the Else branch of the previous as indicated by the red arrow, and make sure not to create an else branch:



Bear with me here, we're almost done! We will now create a wait timer and a self switch trigger inside the If branch of the first Player Y conditional branch we made earlier.

The wait timer should be the same as the one you made for the bomb detonation because we want the rock to blow up right when the bomb goes off. In my earlier example we used 120 frames, so this one should also be 120 frames. As for the self switch trigger, we want to set it to A so that the rock will turn to rubble after the wait timer is up.

Configure as shown below and copy/paste it to each of the empty If branches as indicated by the blue arrows:


Again, if everything has been configured exactly as I've shown so far, the breakable rock event should look something like this:



Now for the last part, we will create an auto event that will add the bomb to our inventory for testing purposes. Follow the image examples below if you're not sure how to do this:







And that's it! Hope the guide wasn't too difficult or too boring to follow. Be sure to test and make sure it's working for you. If you've enjoyed this or feel that there is something I've left out/need to add, feel free to leave a feedback and/or ask me any questions and I'll try my best to answer.

Thanks for reading!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

rux
Just 80% of my motivation on game making lmao, anyone got tips on how to not be unmotivated?
I've signed up for a job training program for people with Asperger's Syndrome. I went to a "test run" today so they could see how well I did with simple jobs, and I amazed them. Most new people do it in 30+ minutes, while I finished in a mere 15 minutes. Gives me time to work on a screenplay for Studio MDHR...
People,I have seen that Someone from China/Chile and London is doing a Vaccine Against COVID-19.
Doing anything that yield good result in the long run is like sowing seeds. With proper care, they will grow and bear fruits. I'm excited for tomorrow. :D

Forum statistics

Threads
105,454
Messages
1,013,831
Members
137,104
Latest member
sasakureman
Top