COUNTER ATTACK IN RPG MAKER 2003?

Posts

Pages: 1
It just takes some eventing. If you just want a character to strike back at ANY enemy when damaged, that is a little easier than making them target the one who wounded them specifically.

The easy way -
Track the character's hp through variables in a battle event that triggers every 1x rounds. Make two variables for each character who can counter: Old HP & New HP. You might also need a transfer variable, we'll call it TempVar.

The first round, Old HP should be 0.
If Old Hp = 0, set Old Hp = Character's Hp

If Old HP =/= 0 then
>>set New HP = Character's HP
>>>>If New HP < Old Hp
>>>>Turn on switch CharacterCounter.
>>>>End if
>>Set Old Hp = Character's Hp
end if

Have a battle event triggered by the switch CharacterCounter.
Use variables to record the attack strength of the character.
Use a randomize variable to select a target from the enemy group. You need some redundancy here to keep track of which enemies are still alive and change the targeting accordingly.
Get the target's defense and subtract that from the attack value in the variable.
Inflict a status on the countering character to make them invisible while you play the attacking animation on the selected target.
Subtract the attack variable from the target's hp, remember to allow Hp reduction to kill the target.
Cancel the invisibility status
Turn off Character Counter switch.

NOTE:
Set up this way, a character that was poisoned would always counter attack. You could figure the HP reduction for poison manually, and check to see if the character's hp decreased by a greater amount. You'd have to track whether the character was poisoned or not through a common event.

Most game's don't let characters counter attack EVERY time, at least not without some upgrades. You could add in a randomize check so that the character only attacked when he rolled over a certain threshold.

If you wanted to attack the individual enemy that attacked the character, you would probably need to have your enemy attacks and skills set up as switches that find their target through battle events so you can keep track of who is getting hit with what.

Not difficult, just time consuming.
How about an enemy that counters a party member's attacks? I've been trying to do that recently and it's become a pain in the ass.

The biggest issue is that I have a battle event that's set to "If (Enemy) is targeted" & "If (Enemy) can act," turn on "attacking" switch (which then triggers a monster's action). The problem is, the "If (Enemy) is targeted" condition doesn't work right. "Targeted" means the enemy is either the current target or the target of the last action.

So you could either attack and be countered, or attack in a previous turn (where this action wasn't active) and be countered. There's no way of saying simply "If (Enemy) was just attacked, counter it with this attack"
@PepsiOtaku I think Ocean did something like that for the first battle of Paradise Blue. Why don't you try asking him?
Pages: 1