Tsukihime 1,487 Posted September 17, 2013 (edited) 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! Edited February 18, 2014 by Tsukihime 7 Darkanine, dbchest, Caveras and 4 others reacted to this Share this post Link to post Share on other sites
Coolie 147 Posted September 17, 2013 (edited) This might be the answer to counterattacks crashing VE Animated Battle. I'll be trying this out. EDIT: Too good to be true. Freezes the game, just the same. It'd be a good idea to allow reactions to skill TYPES as well, rather than just single skills to avoid having to thow 20 note tags in for an enemy that counters Black Magic specifically, for example. Edited September 17, 2013 by William C Share this post Link to post Share on other sites
Tsukihime 1,487 Posted September 17, 2013 I threw in some hack-ish compatibility patches for yanfly engine, but they probably didn't work for victor's. If you create a new project with the battle system and the script to demonstrate the freeze issue I could look into it. Share this post Link to post Share on other sites
Caveras 39 Posted September 17, 2013 Fine script! Thanks for your ever great efforts there, TH ! =) Share this post Link to post Share on other sites
+ thechancellor 8 Posted September 20, 2013 Not able to test this just yet. Does this allow for the damage to occur before the reaction skill is triggered? Where counter attacks don't allow for the attacker to inflict damage, this script could really shine. Share this post Link to post Share on other sites
Tsukihime 1,487 Posted September 20, 2013 (edited) Yes, the attacker's action is processed normally (hit, miss, evade, etc), and then the defender's reactions are triggered as a result. While difficult to see, the screenshot demonstrates the slime attacking an actor, and the actor responding with a skill. Edited September 20, 2013 by Tsukihime Share this post Link to post Share on other sites
+ thechancellor 8 Posted September 20, 2013 That's fantastic! Before this, the only script that could create that effect was Victor's Retaliation Damage. Very nice to have options considering the amount of compatibility issues I had with Victor's scripts. Thank you very much. Share this post Link to post Share on other sites
Tsukihime 1,487 Posted September 21, 2013 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. Share this post Link to post Share on other sites
+ thechancellor 8 Posted September 21, 2013 Excellent. Even more flexibility. Great addition. Share this post Link to post Share on other sites
Jolt Android 36 Posted January 13, 2014 Hi there. Thanks for the script, have it working great. There's a compatibility problem though if I put it with "YSA's Battle System: Classical ATB". With this I get an error on line 703: NoMethodError occurred. undefined method `shift' for #<Game_Enemy:0x904433c>. If you're able to provide a fix or point me in the right direction on how to fix this that would be awesome =) Share this post Link to post Share on other sites
Tsukihime 1,487 Posted January 13, 2014 YSA requires yanfly's ace battle engine, which is full of bugs related to force action. You will need yanfly's ace core engine to address the force action issues. Share this post Link to post Share on other sites
+ TBWCS 951 Posted January 13, 2014 Another nice work, Tsukihime. Totally going to check this out. Share this post Link to post Share on other sites
Wren 179 Posted January 14, 2014 This looks great, I'll be looking into this one soon, since my combat system is based on reactions to skills/attacks. Share this post Link to post Share on other sites
Tsukihime 1,487 Posted February 8, 2014 (edited) 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! Edited February 8, 2014 by Tsukihime Share this post Link to post Share on other sites
Wren 179 Posted March 4, 2014 (edited) Errr, nevermind, I am a goober! Edited March 4, 2014 by Wren Share this post Link to post Share on other sites
Tsukihime 1,487 Posted March 4, 2014 (edited) Is 202 a skill that applies the death state to the user? What's the purpose of state 51? The reaction logic would be if the skill I use on the target is element type 14, then the target would react with a skill that does something. Like add a death state to itself. Edited March 4, 2014 by Tsukihime Share this post Link to post Share on other sites
Wren 179 Posted March 5, 2014 (edited) Yes, 202 is a skill called death that applies the death state. <element reaction: 14 202 100 forced> is my tag, I removed the state restriction (which I may add in later once I figure out why this isn't working. I think it has to do with my ammo script. I'm going to test with a weapon that doesn't use ammo. I'll update this post with the result in a few minutes. I set up a skill that does pierce element damage and attacked the enemy and same thing, the reaction didn't trigger. Tested skill 202 on one of my characters, they die as expected. I know it must be something super simple that I am messing up, so I'll keep looking through your instructions. **EDIT** Okay, with testing I still can't get element reactions to work, but I was able to apply states and use state reaction conditions and have skill reactions work. However, for some reason now, when the reaction works and the enemy is defeated, the party is victorious and it starts to award xp, it has everyone in the party gain xp, then it has the first character gain more xp again and then crashes to desktop without an error message. I can repeat this over and over with the encounter with an enemy that is defeated using reactions and synchronized battler and effects. I'm going to set up an encounter that doesn't use synch and effects to see if I can track down what is happening. Will update soon. **Additional update** Okay, when an encounter ends by applying the death state and the enemy being defeated, with or without triggering synchronized battler effects, the party is awarded xp twice and then the game crashes. Other reactions triggering doesn't seem to have any impact, only when the death state is added resulting in the party being victorious. All party members are awarded XP twice and as soon as the last character is awarded XP the game crashes to desktop without any sort of error message. I did test with a skill that deals enough damage to defeat an enemy and the same thing happens, the party is victorious and is awarded xp twice and then the game crashes with no error message box. If needed I can set up a youtube video or compress a copy of the project for you to take a look at. Here is a screenshot of my currently installed scripts: ****So much edit!**** So, I had the same thing happen using this configuration of reactions: <skill reaction: 1 204 100 forced><reaction condition:1>a.state?(51)</reaction condition><skill reaction: 1 205 100 forced><reaction condition:2>a.state?(52)</reaction condition> Skill 204 adds a state (52) that increases all params Skill 205 does the same thing, adds state 53 Then I have another skill that checks if the enemy is inflicted with state 53, is so it removes 53 The skill if used again will check if state 52 is applied, if so it removes 52 The skill if used again will check if state 51 is applied, if so, it removes 51 If I use attack (skill 1) to kill the enemy, it does the thing where the party is victorious twice and then crashes out completely with no error message box. If you can assist in any way, it would help me greatly. Thanks! Edited March 5, 2014 by Wren Share this post Link to post Share on other sites
Tsukihime 1,487 Posted March 5, 2014 (edited) I noticed one of the changes I made a few months ago was reverted for some reason. Might have been me working with an older version in a separate project and then overwriting a newer version. I've updated the script to address the issue so now element reactions should function as expected. Create a demo with only my scripts set up with the desired effect and see if that works now. For the exp issue you'll have to verify whether it is related to my scripts or not. Edited March 5, 2014 by Tsukihime Share this post Link to post Share on other sites
Wren 179 Posted March 5, 2014 Tsuikihime, Thank you very much for answering so fast and being as helpful and nice as can be. I pulled all other scripts, graphics, music, etc. to make the demo as small as possible. If you use the menu it will crash, but if you start the demo, select test, then use the switch next to you and then fight the monster, and only use the attack skill, the crash can be duplicated using only your scripts. https://www.dropbox.com/s/qc2rd74u3dea6me/MHLR%20-%20Tsuki%20only.zip Share this post Link to post Share on other sites
Tsukihime 1,487 Posted March 6, 2014 (edited) It's the troop event span that's causing the battle victory to process twice. The bug specifically occurs when you have a force action processing before the end of the battle (or in this case, reaction processing, since that is considered forced action as well). The game crashing is a consequence of this: because the victory processing is run twice, the scene manager tries to return twice. The second time happens to go to a nil scene, which tells RM that it's done. Normally this shouldn't happen, but the way that script was written in fact caused action end processing to occur twice. I've updated troop event spans to address the issue. Edited March 6, 2014 by Tsukihime 1 Wren reacted to this Share this post Link to post Share on other sites
Wren 179 Posted March 6, 2014 Okay, I'll test this right away, thanks again for how fast and nice you are, I'm so amazed you looked into this so quickly for me. I'll PM you if there is any more problems as I don't want to hijack this thread any more than I already have, you and your scripts are simply amazing, and I thank you from the bottom of my heart for keeping the community alive with all of your additions and support. Share this post Link to post Share on other sites
sartha 0 Posted March 12, 2014 I have found a strange incompatibility between two of your own scripts... Battle Reactions (Dated March 5, 2014) Casting Time (Dated September 21, 2012) I tried this in a fresh project giving the slime's notetag: <skill reaction: 1 51> (51 being the default Fire spell) and gave him 100 MP for testing. The Attack skill has not been modified. The expected result: I use the Attack skill on the slime and he reacts with a Fire spell. The actual result: I use the Attack skill on the slime, hit, evade or kill happens twice in a row then the slime reacts with a Fire spell. This happens no matter which order I put the two scripts in. There are NO other custom scripts in this test project. Thanks! Share this post Link to post Share on other sites
Tsukihime 1,487 Posted March 12, 2014 Cannot reproduce. 1. Create new project 2. Insert Battle Reactions 3. Insert Casting Time 4. Tag slime with the same reaction 5. Attack slime Expected result occurs. Share this post Link to post Share on other sites
sartha 0 Posted March 12, 2014 Hmm I don't know why you can't reproduce honestly... 1) Created another new project 2) I copy-pasted the Battle Reactions script from your website 3) I copy-pasted the Casting Time script from your website 4) Tagged slime with the reaction 5) Attacked slime ... still get double hit/miss/kill every time. Share this post Link to post Share on other sites
Tsukihime 1,487 Posted March 12, 2014 (edited) Maybe you can send me that project. EDIT: I see what you mean now. I thought you meant they were getting hit twice, which doesn't happen. The log window is showing it twice because when the target reacted, it uses the same action processing logic as a normal action, but the casting time has been written so that it displays the actions for some reason. I don't know why. Cast time has been updated to address the issue. Edited March 12, 2014 by Tsukihime Share this post Link to post Share on other sites