So in my game there's this coin item that has a 50% percent chance of giving the effect of either increased attack or defense. The problem is that there's no way I can find to make the 50/50 chance work! I tried to have the item call a common event that randomly chooses one or the other but the problem is that I have to specify which actor to effect. There's also an option to affect an actor using a variable but I have no clue how to set that up. Help is very appreciated!🙂
Help with a 50/50 item effect!
RPG Maker VXAce SupportThe easy (albeit tedious) answer is to have a different version of the skill for each actor; that way you can link to different versions of the common event which can simply specify each of their given actors as the targets.
As for specifying it with a variable, I believe you can use something like $game_variables[#] = a.id in the damage formula, though it may cause some weirdness with messaging if you aren't dealing damage or healing. It'll throw out a "no effect" battle message, for instance. Not sure how to use damage formulas on non-damaging skills without a failure message, short of using a script.
Obviously, any number of scripts could streamline all of this. 😅
As for specifying it with a variable, I believe you can use something like $game_variables[#] = a.id in the damage formula, though it may cause some weirdness with messaging if you aren't dealing damage or healing. It'll throw out a "no effect" battle message, for instance. Not sure how to use damage formulas on non-damaging skills without a failure message, short of using a script.
Obviously, any number of scripts could streamline all of this. 😅
Should be easy with a damage formula.
or if its a buff
Code:
rand < 0.5 ? b.add_state(atk_state_id) : b.add_state(def_state_id)
or if its a buff
Code:
rand < 0.5 ? b.add_buff(2, 5) : b.add_buff(3, 5)
Thank you so much! It works now!😀
Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-50-50-item-effect.75353/