So I have an ability that I only want to effect the user if they have State X, how do i do this?
Ability only effective while having X State
RPG Maker MV SupportYour title and post seem to be asking different things...
Do you want to make a skill only affect the target if they’re afflicted with a certain state?
Or do you want a skill to only be available for use if the character is under a certain state?
Do you want to make a skill only affect the target if they’re afflicted with a certain state?
Or do you want a skill to only be available for use if the character is under a certain state?
Oh yea just noticed that oddity, I want the ability to only effect to user if they have state X
@J_spencer93 In order to best assist you, what is the effect of the ability supposed to be, and what is the required state for it to take effect? Give us a short scenario about the use of the ability, its desired effect, and when it happens, or doesn't. Show and/or tell us in a little more detail with the scenario being like a story about what's happening in the battle when the ability would come into play. You will probably get better targeted and more helpful responses if you're descriptive.
If the skill only does damage (or youre willing to do all other effects in the damage formula), you can do this in the damage formula
What this does is that if the target is affected by the state, it does whatever formula you put, else it returns 0 damage
Code:
if (b.isStateAffected(stateID)) {damage_formula and effects};else{0};
What this does is that if the target is affected by the state, it does whatever formula you put, else it returns 0 damage
Basically I have a state that turns the user into metal (robotic sort of) and when they use this "electro" skill, if they are "Metal" I want it to increase their agility by a set amount,
What other things does electro does? Especially what does it do if you're not metal? Is it self target?
It's self targeted. As of right now, I want it to do nothing else (it will later) as I am strictly trying to learn how to make skills that work like this.
Then for now, make a new state that gives the bonis agility then do this on the electro skill's damage formula
Code:
if (b.isStateAffected(ID of metal state)) {b.addState(ID of new state)};else{0};
Yea, currently this is not working. It shows it deals 0 damage but does not apply the second state if they have the Metal State
Can you post the actual formula you used?
if (b.isStateAffected(29)) {b.addState(75)};else{0};
Can you try changing b to a?
I can but since its the target, wouldn't B be correct?
I just want to make sure if it being self target changes a behavior. Were testing things out to figure out why its not working, so better check everything that we can.
Can you try this formula and run the game with console on and what gets printed when you use the skill? If nothing gets printed, then that would mean the formula itself has an error.
Can you try this formula and run the game with console on and what gets printed when you use the skill? If nothing gets printed, then that would mean the formula itself has an error.
Code:
if (b.isStateAffected(29)) {console.log("true")};else{console.log("false")};
I am new at this, how do i turn console on?
Btw changing b to a literally changed nothing (odd i know). Another oddity is, when i apply the "ion field" spell, it depletes 2 rounds off of "iron skins" duration.
Press F8 once the game is running to open the webkit window, then find the tab which says console.. Thats weird, the formula doesnt reduce state count or do extra turns..
I believe your addstate is missing an a.addState(75) or a b.addState(75) just looking at the above.
Just noticed that too. I will try that.
Trying a.addState(75) nor b.addState(75) work either.
Original thread: https://forums.rpgmakerweb.com/threads/ability-only-effective-while-having-x-state.110553/
