Gw Temp

Menu

Tutorial - 'Blitz Tutorial' by AzureFenrir

An item about RPGMaker 2000 posted on

Blurb

A tutorial that shows how to make a Final Fantasy 6-esque Blitz command, where you press certain key combinations to unleash special attacks.

Body

Blitz Tutorial


TEACHER: Yosuke, you are a clever student. You have learned all of my techniques without trouble, and now, I shall

teach you my ultimate attack. Are you prepared?
STUDENT: Yes, sensei!
TEACHER: Good! The attack is Roll Left Trigger Counterclockwise, Left, X, X, Y, X+Y, A+B, Up, Up, R1, R1, Up, Down,

Start, Y! Now, you try it!
STUDENT: But sensei, there is no left trigger!
TEACHER: What, you're not using an X-BOX controller?! Stupid student, you are not worthy of my ultimate techinque!

Get out of my tutorial!

* Azure is stabbed *


Unfortunately, turn-based RPGs frequently lack in the action department. Even with an active ATB system where the user

should be frantically trying to select his or her spell before the final boss beats them into oblivion, they frequently do

not have the action that games like fighting and action games have.

Final Fantasy 6 tried to remedy this by adding unique skills that work somewhat differently from the regular system. One of

these systems is the blitz command, which makes the user press a certain key combination - similar to fighting games' combos

- to execute his special moves. Although even this lacks the thrill of pressing the correct keys in rushed and active

situations that many fighting games exhibit, it is still an interesting feature to add to an RPG.

THINGS THAT

YOU NEED TO KNOW:


Experience With RM2K3 Commands
Some Experience With Battle Commands and Events
Understanding of Switches
Understanding of Variables
Key Input
Loops and Labels
The Trigger Happy System


In this tutorial, I will assume that you have already read the Trigger Happy Tutorial that I have read earlier, since this is

pretty much a continuation to that tutorial. Many of the concepts that are used in that tutorial are used here, so it might

be beneficial to read the other tutorial first if you do not understand the concepts discussed in this.

Before we start, though, make a chart of every blitz move that you want your character to be able to perform, and write down

their key combinations. Then, allocate a bunch of variables equal to the number of blitz commands that your character can

perform. For example, let's say that your character possesses the following moves:

Pummel: Up Right Left
Blitzace: Left Left Right Left
Hellfire: Left Right Action Cancel Down
Banning of a thousand: Left Right Up Action Down
Eat Eyes: Left Up Right Down

Since we have five moves here, we will use five different variables in this phase. Then, make a new battle action. Call

it...say...Blitz, and set it to "Attack." Assign it to the classes that should have access to this skill, and we'll start

writing the code for this command.

Now, we need a new common event that will run whenever we select Blitz. As we have seen in the Trigger Happy tutorial,

common events are necessary to execute some things that are impossible to execute using battle events alone, such as

detecting key input and looping. Since blitz requires constant key input processing, let us start off with a key loop,

similar to the one in the Trigger Happy tutorial (adding variables as necessary):

RPG Maker 2003

Code: Common Event Blitz (Code Fragment)


<>Timer 1 Operation: Set, 0M 03S
<>Variable Operations: [####:TempPrevKey] Set, 0
<>Timer 1 Operation: Start
<>Label: 1
<>Comment: Do Not Wait Until Key Press; Detect All Keys (5))
<>Key Input Processing: [####:TempKeyVar]
<>Branch if: V[####:TempKeyVar] does not equal V[####:TempPrevKey]
    <>Branch if: V[####:TempPrevKey] equals 0
        <>Comment: Our code will go here.
    : End
: End
<>Branch if Timer1 is less than 0M 01S
    <>Goto label: 2
: End
<>Variable Operations: [####:TempPrevKey] Set, V[####:TempKeyVar]
<>Goto Label: 1
<>Label: 2
<>Timer 1 Operation: Stop


This code pretty much continuously gets the keys that the user presses for about three seconds. The reason that the

TempPrevKey variable is there is to prevent us from counting a key twice if a user holds it down (since key input will read a

key even if it's held down), so we won't have to guess how long the user will hold the key, etc.

What do we need for the code portion? Well, we'll use our sample attack list as an example. Let's look at the first attack

in the list, pummel:

Pummel: Up Right Left

The code for this command will be:

RPG Maker 2003

Code: Common Event Blitz (Code Fragment)


<>Branch if: V[####:PummelVar] equals 0
    <>Branch if: V[####:TempKeyVar] equals 2
        <>Variable Operations: V[####:PummelVar] Set, 1
    <>: Else
        <>Variable Operations: V[####:PummelVar] Set, 0
    : End
: End
<>Branch if: V[####:PummelVar] equals 1
    <>Branch if: V[####:TempKeyVar] equals 3
        <>Variable Operations: V[####:PummelVar] Set, 2
    <>: Else
        <>Variable Operations: V[####:PummelVar] Set, 0
    : End
: End
<>Branch if: V[####:PummelVar] equals 2
    <>Branch if: V[####:TempKeyVar] equals 2
        <>Variable Operations: V[####:BlitzCommand] Set, 1
        <>Goto Label: 2
    <>: Else
        <>Variable Operations: V[####:PummelVar] Set, 0
    : End
: End


How did this work? Well, the variable PummelVar (which is one of the five variables that I named in the beginning) holds

how many keys the player has already matched in that command sequence. For example, if the variable contains 1 (1 key has

already been pressed), then the code will know that the next key that he/she needs to press is a 3, or right. If the user

then presses down, PummelVar will increase by one, and the code will now expects a two (left key input). If the user does

not press the right arrow key, then the variable is reset to zero, and the code will expect a 4 (up key) again.

What if all three keys are successfully pressed? Well, in this case, PummelVar will initially contain a two, and the

TempKeyVar will contain a two, signifying that the user has pressed the left key. Now, the code will set a new variable

called BlitzCommand (don't forget to add this) to one, and goes to label two, which stops the timer and leaves the loop, thus

ending the common event.

Now, repeat this for every blitz command that you want to add, and...

Hey, wait! Don't leave the common event behind yet! What if the user uses the blitz command, enters part of, say, two keys

for Pummel, fails, and uses blitz again? Well, in this case, PummelVar will contain what the last blitz command left off on,

and if the player presses left, then pummel will execute anyway...oops!

This, however, is easily remedied by addind a simple bit of code to reset all the counter variables to zero at the beginning

of our common event:

RPG Maker 2003

Code: Common Event Blitz (Code Fragment)


<>Variable Operations: V[####:PummelVar] Set, 0
<>Variable Operations: V[####:BlitzAceVar] Set, 0
<>Variable Operations: V[####:HellFireVar] Set, 0


Now, add a battle event to every monster group. Have it trigger whenever the character uses the Blitz command, and put the

following code in it (changing the actual code depending on your actual blitz commands):

RPG Maker 2003

Code: Battle Event "Hero [Blackbelt] uses the "Blitz" command"


<>Call Event: Blitz
<>Branch if V[####:BlitzCommand] Equals 1
    <>Branch if Monster1 is the current target
        <>Comment: Place code to calculate damage here
        <>Show Battle Animation: Pummel, Monster1
        <>Change HP: Monster1, Decrease V[####:BlitzDamage]
    : End
    <>Branch if Monster2 is the current target
        <>Comment: Place code to calculate damage here
        <>Show Battle Animation: Pummel, Monster2
        <>Change HP: Monster2, Decrease V[####:BlitzDamage]
    : End
    <>Comment: Repeat for additional monsters
<>: End
<>Branch if V[####:BlitzCommand] Equals 2
    <>Branch if Monster1 is the current target
        <>Comment: Place code to calculate damage here
        <>Show Battle Animation: BlitzAce, Monster1
        <>Change HP: Monster1, Decrease V[####:BlitzDamage]
    : End
    <>Branch if Monster2 is the current target
        <>Comment: Place code to calculate damage here
        <>Show Battle Animation: BlitzAce, Monster2
        <>Change HP: Monster2, Decrease V[####:BlitzDamage]
    : End
    <>Comment: Repeat for additional monsters
<>: End
<>Comment: Repeat for additional blitz commands
<>Change Condition: Blackbelt, Inflict Normal Condition


This battle command simply calls our battle command, Blitz, and checks what the "BlitzCommand" variable is equal to. Then,

it does the appropriate attack, calculating using different damage algorithms and battle animations. Since you may have

different algorithms for damage depending on your actual blitz commands, I can't really put a set damage algorithm to replace

the comments. Although, for the more needy readers, here's a sample algorithm that does damage equal to 2x the character's

Attack. You can modify this to make your own damage algorithms:

RPG Maker 2003

Code: Battle Event "Hero [Blackbelt] uses the "Blitz" command"


<>Variable Operations: V[####:BlitzDamage] Set, BlackBelt Attack
<>Variable Operations: V[####:BlitzDamage] *, 2


And that's it for the Blitz Tutorial! I am AzureFenrir, and this is a Gaming World 9 O'Clock Tutorial. Good night.