New forum theme up and running!
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 CommandsSome Experience With Battle Commands and EventsUnderstanding of SwitchesUnderstanding of VariablesKey InputLoops and LabelsThe Trigger Happy SystemIn 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 LeftBlitzace: Left Left Right LeftHellfire: Left Right Action Cancel DownBanning of a thousand: Left Right Up Action DownEat Eyes: Left Up Right DownSince 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: StopThis 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 LeftThe 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: EndHow 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, 0Now, 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 ConditionThis 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] *, 2And that's it for the Blitz Tutorial! I am AzureFenrir, and this is a Gaming World 9 O'Clock Tutorial. Good night. ::::::::::::::::::::::::::::Michael,TheEmeraldWindOk... Here I go.Number 1: My recent problem is because simply enough because when the timer reaches zero, the battle ends. This is fixed by making the timer1 branch being less than or equal to 1 second not 0 seconds.Then I ran into another very iritating problem...Whenever I inputed a button combo the combo would keep on being reset to zero this is what was happening:<>Bran ch 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{{{{Now what would happen is now is simply this: Now pummelvar = 1, RPG MAker would instantly goto the second key...}}}}<>Branch if: V[####:PummelVar] equals 1{{{{RPGMaker thinks this is true, but still has the last key stored thus going to the next key, without allowing you to input the new key}}}}<>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: EndThus ending in failure...This is how you fix it:under the branch condition for each CORRECT key press(the part that makes it increase the varible) put a goto label command. Then at the end the commands for pummel(your first blitz move) but before the second attack, you put in that lable. Do this with every blitz move, BUT use DIFFERENT numbered labels for each blitz move.Now you're wondering, "Why not just skip to the end?" Well, this is because if two commands start with the same key, one would be skipped.Now if you understand what I was talking about, it will work. I used this method, and now I have a fully functional Blitz system.