So one of the things I told myself I would work on, is improving my skill with battle eventing. I’ve never really used it much, even though I’ve been using RPG Maker for longer than some of our users have been alive.
Battle events handle much like normal events, most of it is just basic logic.
For this tutorial, I am going to make an event in which if Harold is still alive, and all his other party members are dead at the end of a turn, he powers up, because all his friends are dead.
You could use this same event for a transformation skill. Or maybe when everyone else is knocked out, it adds a skill that lets the character transform into a superhero now that no one will see them change (This was used by Red in SaGa Frontier). The basics of this event, though, can be used to learn how to do many other battle events. So let’s get started.
The first thing we need to do is make the State that will be applied to Harold. This is pretty simple. Just add a state, give it an icon, and add all the bonuses you want it to give. I’m going to have it increase all stats by 50% and give him 10% HP and MP regeneration.
I also set it to remove at the end of the battle. Don’t want him gaining permanent awesomeness from it happening one time.
The next thing we need, is a skill that Harold can use to put this state on himself.
A quick, very important note: DO NOT GIVE THIS SKILL TO HAROLD! This skill will instead be triggered by the battle event.
This skill is also pretty simple. Scope: the user, set an animation, Add State: All My Friends Are Dead. No costs. Certain Hit, and then write a use message.
After this, we just need our Battle Event. Battle Events are created in the Troops section. Each Troop has their own set of battle events. If you want something to happen in EVERY battle, you will either have to copy it across to every Battle Event, or use a Plugin like this one from Yanfly. I highly suggest the use of Yanfly’s scripts, though I will not be using it for this demo.
The first thing we need to do is change the trigger for the Battle event to “Turn End” this will have it run the event at the end of every single turn of combat.
The next thing I need to do, is start thinking: What all does this event need to check?
This event should have him use the skill if ALL of these conditions are true:
- Harold is in the Party
- Harold is NOT dead.
- Harold is NOT already under the effect of All My Friends Are Dead.
- There are other people in Harold’s Party.
- All of the other Party Members are Dead.
So, the first thing we need to do is make some Conditional Branches. We’ll need to use the else branch for some of these, to indicate that it only happens if it is NOT. Let’s set up for the first three conditions.
We’ll be working the rest of the event inside that Else Branch. With the nesting branches, all of this will only happen if Harold is not already under the effect, he is in the party, and he is alive.
The next thing to check is, how many people are in the party, and how many of them are KOed. We can do this very quickly. The first thing to do is to set a Party Size variable to the number of characters in the party. You can find this under “Other: Party Members’ in Variable Controls. The second is to create a variable that when it is equal to this number, the skill will go off.
Since we won’t be counting Harold (he needs to be alive), we’ll set the trigger variable to 1. Now, we can reference each party member and ask “Is he/she in the party, if so, is she dead, if so, Add 1 to the Trigger variable.”
Do this for all party members you have.
Now we just have to check and make sure that Harold isn’t alone, and if all the other party members are dead, by checking if Party Size > 1, and if Party Size == Dead Friends Trigger.
And for a final touch, add in a message and have it force Harold to use the skill (Random target is fine, as it chooses from only one valid target, the user)!
And that is everything. Now our Hero powers up when all his friends are dead. Want to learn more? Check out the demo for a closer look.
How have you used battle eventing? What tricks have you learned? Have any questions about the tutorial? Join us in the comments below.