Battle Reactions

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
This script provides functionality for setting up "battle reactions", which are actions that are automatically invoked in response to certain actions. A reaction is similar to a counter-attack, except instead of responding to any attack, it only responds to specific "reaction triggers" and responds with an appropriate "reaction response".


For example, your actor might have a shield that casts "heal" on the wearer whenever the wearer is targeted by the "attack" skill. The reaction trigger is the "attack" skill, while the reaction response is to cast heal.


You can have multiple reactions occur simultaneously and all of them will be executed.





Download


Get it at Hime Works!
 
Last edited by a moderator:

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A
This could have some cool uses to add to the enemy A.I.!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
can you add  the functionality to react to a certain skill type or react to all skills?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Sort of backlogged on actual features because people have been saying that victor's battle system is not compatible and I haven't been able to figure out how to deal with it.


Unfortunately it doesn't like the way I'm using "force action"
 
Last edited by a moderator:

Lowell

The Walking Atelier
Veteran
Joined
Apr 21, 2012
Messages
292
Reaction score
69
First Language
English
Primarily Uses
Victors Scripts from what I understand rewrite a lot of things in his basic module, which breaks compatibility with other scripts.

As far as I know it's like making compatibility patches for Takentai.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
can you add  the functionality to react to a certain skill type or react to all skills?
I've implemented two new types of reaction triggers:

1. Skill Type Reaction Triggers

2. Element Reaction Triggers

Usage is similar to the skill reactions

<stype reaction: stype_id react_id chance forced><element reaction: element_id react_id chance forced>Both reactions respond with skills, so the react_id is the ID of the skill to respond with.They are self-explanatory: when an attacker uses a skill with the specified skill type or element type, the reaction will respond.

You don't want to react to "all skills" because that would mean even when you "guard" it will react.

Currently, all of the reaction types are skills.

I am looking into generalizing it to items, commands, events, and other things.

Unfortunately, those reactions will use an extended note-tag that looks like this

<battle reaction>trigger_type: stypetrigger_id: 2react_type: itemreact_id: 1</battle reaction>Where you literally set up every detail of the reaction.However there is much more flexibility when you do that, as opposed to using the pre-defined reaction triggers (skill, stype, element) which are hardcoded to use a skill in response.
 
Last edited by a moderator:

Lowell

The Walking Atelier
Veteran
Joined
Apr 21, 2012
Messages
292
Reaction score
69
First Language
English
Primarily Uses
you can generally scratch out commands since commands are skills in ace, on another note, the only other thing I'd recommend is status effects, though you can also link those to skills as well.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
In that sense, events would also be done the same way by simply calling a skill that calls a common event, which would be easier than writing a reaction response that calls a troop event.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
element reaction... that was nice Tsukihime... :)
 

Ultima01

Unhinged
Veteran
Joined
Mar 13, 2013
Messages
69
Reaction score
11
First Language
English
Primarily Uses
N/A
Uh, if the actor/enemy affected by the tag is NOT tagged, the actor can't act if they've taken a hit that turn.  Is this intentional?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I'm not sure what you mean, but if you mean an actor/enemy that reacts can't perform their own action, no that's not intentional. Someone had raised the issue and I updated the script to address it, but you probably found another bug.


How to reproduce?
 
Last edited by a moderator:

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
I was getting the bug CtelinAjira mentions as well, but I believe I fixed it quite easily. As far as I could tell, the issue was in this section of invoke_reactions:

target.backup_actions target.clear_actions reactions = target.get_reactions(item) return if reactions.empty?If there were no reactions, the target's actions were cleared and never restored. Moving the clear_actions command under the reactions.empty? check fixed this for me.Also, A+. This works with my current mish-mash system with just some minor edits and allows me to get the effect I was looking for without having to code something myself.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Thanks, I added the "backup" and "restore" steps but didn't catch the return that I originally wrote.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Would there be a way where I can make the chance based on an actor's CNT or RFT parameters?  I'd like this to work as a replacement for the default counter/reflect mechanics because I can't use Victor's Retaliation Damage.

Like maybe if the parameter is stored as a numeric integer variable in some fashion (maybe I can do that part) and then chance can be replaced with the variable.

Basically a variable'd chance,
 
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 that the chance can be specified as a formula.

Note that the chance is between 0 and 100, and feature values are between 0 and 1.

So suppose you gave your actor a CNT rate of 50%. That means the chance is 0.5, which is extremely small.

You would need to scale it up as such

a.cnt * 100So your skill reaction might look like

Code:
<skill reaction: 1 51 a.cnt*100>
Which will react to skill 1 with skill 51 with a probability based on your counter.The formula supports the standard variables

Code:
a - battler that is reactingb - target of the reactionp - game partyt - game troops - game switchesv - game variables
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I've made a fairly large update to the script.


It introduces the concept of “Reaction Conditions”, which are conditions that must be met in order for the reaction to occur.


For example, you may require a certain state to be applied, or your HP to be under a certain threshold, or that certain actors are in the party.


The script originally provided a “chance” variable that allowed you to indicate the likelihood that the reaction will occur. This is considered to be deprecated and should not be used.


All conditions should be done using reaction conditions, including random probabilities, because they are much more flexible and allow you to condition your reactions on anything that you can imagine.


See the script usage and examples for more information!
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

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
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top