Hello,
i'm kind of new on making rpg games, but i was trying to create something like a state that isn't always active, but activate itself at the start of a battle, also that same state showing as a passive skill on the character's abilities tab, and when you reach at certain level that you learn an upgrade of that ability, the weaker skill is deleted/unlearned. (I mean upgrade of the ability just like in final fantasy that you have thundaga being a stronger version of thundara)
Someone could help me on how to do this?
Hi, can you please edit your post and put in a more meaningful title? Given that you've posted in the MV forum, every post here is about RMMV 😉
Sorry, forgot to change that before posting, changed
I would recommend using plugins to do that. Yanfly has made one called Auto Passive States which should do the trick for the first issue, while for upgrading skills there are several plugins you could check out too.
If you don't want to do this however you could create a battle event that runs at the start of every battle and inflicts the state on your actor. You would set the state to wear off after battle then and just copy the event every time you design a new troop.
Then for the state to show as a skill in the actors profile you just need to create an unusable skill that does nothing with that name.
I'm not sure how to replace that skill without using plugins though, at least not via level up. You sure could use a parallel event that checks if your actor learned the new skill and if so deletes the old one, but since you can't know when exactly his happens you would need to place this event on every map ...
You can add new skills and seal other skills, when affected by a state, through the editor. Removing skills would need a line of script to be run through a method available via Yanfly's Auto Passive States.
Honestly, I didn't entirely understand the context of your post. However, I do know the general mechanics of the spells in Final Fantasy.
If you're using a powerup method: Use Thunder > Learn Thundara > Use Thundara > Learn Thundaga > Reset back to Thunder at the end of battle... this can be done with YEP Auto Passive States and Buffs and States Core (both are still free). Bear with me on the syntaxes. I'm at work but I'll help as much as I can to get it right.
Add the passive state to the actor or class and then add this note in the state:
<Custom Battle Effect>
user.forgetSkill(x) //Thundara ID
user.forgetSkill(x) //Thundaga ID
</Custom Battle Effect>
On casting Thunder add another state to the actor that lasts the whole battle "Learn Thundara"
<Custom Apply Effect>
user.learnSkill(x) //Thundara ID
user.forgetSkill(x) //Thunder ID
</Custom Apply Effect>
Then replicate this to forget Thundara and learn Thundaga. You'll have to figure out how you want to relearn Thunder, which there are a few ways to do that but it depends if this is even the right solution for you. Sealing skills would simplify the method above. If you want the states to last forever, keeping the higher level spells, just uncheck remove after battle. But be careful of the "Recover All" command as it removes all states unless protected by something like
<Bypass Recover All Removal> available with YEP X State Categories (which is now a paid plugin)
The final fantasy thing was just an example for a stronger skill, but not the exact mechanics i'm searching, let me try to explain better.
What i'm looking for is:
1 - Some way to add a state to a character at the start of any battle with any enemy (The removal can be done with the option to remove state after battle, but adding the state is the problem without having to add the condition in every troop in the game.
2 - That same state will be shown as an ability in the character ability tab, but the ability will not be able to be activated (on this item, it's after this bracket that i need help) and when the character reaches a certain level it will unlearn one skill and learn an upgraded version of it.
3 - The state that the hero starts the battle with, will have to change so it can match the skill the character has (example: if character have a lifesteal 1 skill at level 5 it starts the battle with lifesteal 1 state, if character learns lifesteal 2 at level 15, character unlearns lifesteal 1 and starts the battle with lifesteal 2).
So, is skill learning designed in a sense that a character might not learn a skill at a particular level? Like maybe level 16 instead of 15. Because if they do learn skills at set levels, then you should be able to program it through the default engine.
So for #1, that can be a passive state on the character. #2, the unusable skill can be added through the passive state (learn and seal simultaneously, the only way to keep it from ever being used but still shows help info). For #3, maybe this will work:
<Custom Battle Effect>
if (user.level >= 25)
{
user.learnSkill(7); // Level 3 Spell
user.forgetSkill(6); // Level 2 Spell
user.forgetSkill(5); // Level 1 Spell
} else if (user.level >= 15) {
user.learnSkill(6);
user.forgetSkill(5);
} else {
user.learnSkill(5); // Failsafe check
};
</Custom Battle Effect>
The skill learn and unlearn i've been able to manage through common event mechanics, in the way that as soon as you select the character and the intro ends it turns on a permanent common event to identify the character's level (ex: if character lv is >= 2 it learns skill 1, if character lv is >= 10 it unlearns skill 1 and learns skill 2).
Now i need to figure out a way to make work the battle state to start and define wich state will be (when i say define wich state it's for me the one developing the game to set not the player)
Tested here, and the auto passive states was bugging the learn/unlearn factor and also even with the passive condition the state was activated in and out of battle, so i did what ATT_Turan said about the base troop events and combined it with the common event and now it's working fine. Thanks everyone for the help