Hi, so basically I'm trying to do a skill that adds a status effect to a party member but the second time you use that same skill on the same party member, it adds a different one and removes the previous status effect, but I'm having trouble finding out how to do that 😐 I would really appreciate it if someone could help me.
Help, I want to make a status effect that changes the second time you use it :(
RPG Maker MV SupportI'm pretty sure you can achieve this using common events and variables.
To accomplish this, you need to create a variable (let's call it "skill variable") specifically for this purpose. This variable will command two states: the first state and the second state, which is the main state you want, that occurs after the second time you use the skill.
On the skill effects tab, set it to call a common event. Inside that event, include a conditional branch to check if the skill variable has a value of 2. If it does have this value, set it to remove the first state you mentioned and assign the second state. If the value of the skill variable is 1 or less, in the "else" part of the conditional branch, set it to add 1 to the variable and assign the first state.
To accomplish this, you need to create a variable (let's call it "skill variable") specifically for this purpose. This variable will command two states: the first state and the second state, which is the main state you want, that occurs after the second time you use the skill.
On the skill effects tab, set it to call a common event. Inside that event, include a conditional branch to check if the skill variable has a value of 2. If it does have this value, set it to remove the first state you mentioned and assign the second state. If the value of the skill variable is 1 or less, in the "else" part of the conditional branch, set it to add 1 to the variable and assign the first state.
You could do this with an event, no need for variables. Using a variable the way you describe would result in the second state being used whether or not the skill was used on the same target.
You do, however, need a way to track the target of the skill. This is commonly done with a dummy state.
In the Effects of the skill, apply the dummy state to the target, then call a common event.
In the event, check each member of the troop.
- If they have the dummy state:
-- Check if they have State 1 applied. If not, apply State 1 and be done.
--- If they do have State 1 applied, remove State 1 and apply State 2
- Remove the dummy state
----------------------------------------------------------------------------------
The easier way to do this is with Yanfly's Skill Core.
Code:
<Post-Damage Eval>
if (target.isStateAffected(X))
{
target.removeState(X);
target.addState(Y);
}
else
target.addState(X);
</Post-Damage Eval>
Omg it worked! Thank you so much for your help!
Could also use action sequences for it... 🤣
or
Placeholder States
https://youtu.be/6zeiAOLtRvoPlaceholder States are special states that use a formula to determine which state will be added, when they are actually being added to a battler.For example, let's
himeworks.com
Original thread: https://forums.rpgmakerweb.com/threads/help-i-want-to-make-a-status-effect-that-changes-the-second-time-you-use-it.158538/