Effect Conditions

effectConditions1.png



 
In RPG Maker, you can assign effects to items or skills. Effects are special behaviors that occur when the item or skill is successfully executed.
 
For example, you can create a "Poison" skill that has a 50% chance to add a "Poison" state to the target, or you can create a "Skill Book" item that will teach a new skill to a particular actor when that actor is selected.
 
Now, let's say you had a skill book that teaches Fire, but only magic users can learn it. Do you want non-magic users to be able to use the book as well? Maybe not.
 
In this situation, it would be useful to be able to define "conditions" that must be met in order for the skill book to be used.
 
This plugin allows you to define "effect conditions", which are conditions that are given to each and every effect on an item or skill. Before an effect can be applied, all conditions must be met.
 
With these conditions, you can now check whether the actor that you would like to use it on is able to learn Fire!
 
Effect conditions are formulas, so you can create conditions on anything that you can imagine.
 


More information and downloads available at HimeWorks


Free for use in Commercial and Non-Commercial projects.
This plugin sounds useful, but I found a bug: Just having this plugin installed breaks the feature where it won't let you use items that have no effect, whether they have effect conditions or not. (Though if they do have effect conditions, at least one must be met.)


For example, your "Fire Book" would be usable on someone that already knows Fire, assuming they meet the first effect condition. A Potion with no effect conditions at all can be used on someone with full HP. Neither of those would happen without this plugin.


EDIT: Ah, I figured out why. The problem is in this line:


TH_GameAction_applyItemEffect(this, target, effect);


It should be

Code:
TH_GameAction_applyItemEffect.call(this, target, effect);
Thanks for the report.


I tested whether the logic works, but I think I may have only been doing positive testing and not negative testing.


I've updated the plugin with the "call".
Supercool plugin!!!! Thank you a lot Hime!! You're awesome! 🙂 Just one question what I didn't find out yet. I want to acheave if the actor can't learn the spell, he's saying this in a message box. I added it as 2. effect but it doesn't work.... Maybe I do something wrong?
Maybe I do something wrong?
Your first effect is learn spell
Your second effect is call common event
But you wrote them the opposite in the note box.
not class 11 learn then class 11 common event
yes was some kinda logical thing ^^ works now...

Original thread: https://forums.rpgmakerweb.com/threads/effect-conditions.56431/