Creating an enemy which will counterattack with a specific skill when you use a specific skill?

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
I had another question about counterattacking in another thread (ended up using Fomar's script for it, since Tsukihime's caused the game to crash), but that only seems to be a script to change an enemy's default counterattack (determined by CNT) into another skill, and I think MAYBE this idea may be usable without scripts through Troop events...

Basically, what I want to do is create an enemy that will, through a Forced Action, counterattack with a given skill if you use a given skill.

For example, normally he might only use normal attacks... but if you cast Fire on him, he will cast Fire right back at you. Ideally, I'd also like this to apply to healing and buffing skills as well, which have not actually targetted the enemy, but simply been used, so it's less of a "counterattack" and more of a "reactionary command", which is why I think this may be workable through events.

But I also need to be able to determine which skill he reacts with, because as I said in a previous thread, all the skills used by my party members factor Level into the equation, so I have to use separate skills for enemies. Therefore, if I cast Fire on him, I have to have him react with the enemy-version of Fire, not a mirror of the same skill.

Is there any way I can do this?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Counter Skills is a terrible script. It does too much and does all of it pretty bad.


Anyways so you just want to specify which skill the enemy counters with? (offensive or healing, doesn't matter)
 
Last edited by a moderator:

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
Counter Skills is a terrible script. It does too much and does all of it pretty bad.

Anyways so you just want to specify which skill the enemy counters with? (offensive or healing, doesn't matter)
Not just which skills they counter with, but like a conditional counter based on what you do.

Like I said, I already tried yours and Fomar's scripts for a normal counterattack skill change, but this is something more complicated.

So for example, if Eric casts Fire, Monster will cast Fire back, or if you wanted, he could cast Ice back or even Cure on himself.

Or if Eric casts Cure on himself, Monster would "counter" that action with Thunder on Eric.

That's the kind of thing I need.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Well here's a start

http://himeworks.wordpress.com/2013/09/17/battle-reactions/

For now, reactions only occur when you're actually a target, so if you cast cure on yourself, enemies aren't going to react to that. Maybe in the future when I have thought about the consequence of checking if anyone can react to it.

This script supports multiple reactions, but does not give you the ability to control how many reactions will occur, so all reactions will occur.

Reactions can be added to basically any database object related to battlers.

It only supports skill-to-skill reactions. I have not thought about using items in response to skills or any other variations of the sort.

The skill does not need to be something you can actually use. So if you wanted to have a heal reaction, and you can't use heal...well it'll get used anyways. The only restriction is whether you have enough MP/TP, but that can be overridden if you set it as a "forced reaction"

You do not get to choose the target. The index is set to the attacker if the reaction skill is for enemies, and set to the target if the reaction skill is for allies. The scope is then used to determine the final target(s).

Note that in the future I'm going to be introducing an extended note-tag that looks like this

<reaction>type: skillid: 1react_type: skillreact_id: 51...</reaction>Which obviously provides more control over your reactions (I can add item reactions, or command reactions, etc), but will become very verbose.Anyways for now you get that limited skill reaction.
 
Last edited by a moderator:

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
Well here's a start

http://himeworks.wordpress.com/2013/09/17/battle-reactions/

For now, reactions only occur when you're actually a target, so if you cast cure on yourself, enemies aren't going to react to that. Maybe in the future when I have thought about the consequence of checking if anyone can react to it.

This script supports multiple reactions, but does not give you the ability to control how many reactions will occur, so all reactions will occur.

Reactions can be added to basically any database object related to battlers.

It only supports skill-to-skill reactions. I have not thought about using items in response to skills or any other variations of the sort.

The skill does not need to be something you can actually use. So if you wanted to have a heal reaction, and you can't use heal...well it'll get used anyways. The only restriction is whether you have enough MP/TP, but that can be overridden if you set it as a "forced reaction"

You do not get to choose the target. The index is set to the attacker if the reaction skill is for enemies, and set to the target if the reaction skill is for allies. The scope is then used to determine the final target(s).

Note that in the future I'm going to be introducing an extended note-tag that looks like this

<reaction>type: skillid: 1react_type: skillreact_id: 51...</reaction>Which obviously provides more control over your reactions (I can add item reactions, or command reactions, etc), but will become very verbose.Anyways for now you get that limited skill reaction.
It doesn't seem to be working...

It should look like this right?

<skill reaction: 166 535 100 forced>

This should make him counter Fire with Fire... but it doesn't happen. I even made sure that he had the skill available.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
My documentation didn't match my code lol


I've fixed the code to match what I wrote. Try again and it should work.
 

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
My documentation didn't match my code lol

I've fixed the code to match what I wrote. Try again and it should work.
Well... Now there's another problem...

It seems to cause the game to hang. Not even crash with an error. It just freezes up.

I even tried deleting Fomar's counterattack script to see if there was a conflict, but that didn't fix it. Seems that removing the forced trait didn't fix it either.

Maybe it's something with my battle system? I'm using a modified version of Yami's Charge Turn Battle System, which you can find in this thread: http://forums.rpgmakerweb.com/index.php?/topic/13223-game-crashing-whenever-berserkconfuseetc-is-used-on-actor-in-yami-ctb/

Could you take a look at it?

Edit: To clarify, the game hangs after using the skill that he needs to react to. It says "Monster reacted to Fire" and then hangs.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I've updated the script so the reactions have the same privileges as "forced actions" as well (sort of, since they pretty much are.


Still has compatibility issues with "charge_on" but I'm not going to try to figure that out since I'm not interested in that battle system.
 
Last edited by a moderator:

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
I've updated the script so the reactions have the same privileges as "forced actions" as well (sort of, since they pretty much are.

Still has compatibility issues with "charge_on" but I'm not going to try to figure that out since I'm not interested in that battle system.
Now it causes a crash with Ace Battle Engine: https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/

http://i.imgur.com/Uj20150.jpg

At that line.

I don't think charge_on is relevant. I think that's a special function of the battle system that allows you to require skills to charge up before they fire off, but I never use it.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Should be fine now.


I don't know what charge_on is for but I keep crashing on that so I just deleted it. If anyone is using that charge_on, I have no idea how to handle it.
 

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
Should be fine now.

I don't know what charge_on is for but I keep crashing on that so I just deleted it. If anyone is using that charge_on, I have no idea how to handle it.
Well... if I'm still getting the crash, then do you think that's the case?

I guess I can't use the script then...
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top