So Ive been trying to figure out how to add and remove skills with events. The events pages seem to give you the option to do this but I can figure out how to make it work. Basically I want a skill to show up if an enemy appears and then have it removed when the enemy dies. I probably need some kind of plugin to do this, though.
Adding and removing skills with events
RPG Maker MV SupportYou can achieve this without additional plug-ins.
If it's a scripted battle (eg. boss battle), you can add the skill to your character just before the battle, then remove it after the battle is over (or even in battle with use of the conditional branch, if you have more than one enemy).
Otherwise, if it's a random battle, in the relevant 'Troops' database event boxes, use 'Change Skill' to add the required skill to the actor, then when you want it removed, use 'Conditional Branch' and use 'Enemy' in tab 3. Set the <insert relevant enemy here> in the dropdown box, and set the State to 'Knockout'.
Hope that helps. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif
If it's a scripted battle (eg. boss battle), you can add the skill to your character just before the battle, then remove it after the battle is over (or even in battle with use of the conditional branch, if you have more than one enemy).
Otherwise, if it's a random battle, in the relevant 'Troops' database event boxes, use 'Change Skill' to add the required skill to the actor, then when you want it removed, use 'Conditional Branch' and use 'Enemy' in tab 3. Set the <insert relevant enemy here> in the dropdown box, and set the State to 'Knockout'.
Hope that helps. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif
not event but using yanfly's skill core:
<Custom Show Eval>
var aliveEnemies = $gameTroop.aliveMembers();
var id = x;
var enCount = 0;
for (i = 0; i < aliveEnemies.length; i++) {
if (aliveEnemies.enemyId() == id) enCount++;
}
visible = enCount > 0 ? true : false;
</Custom Show Eval>
id = x, change x to the enemy id.
<Custom Show Eval>
var aliveEnemies = $gameTroop.aliveMembers();
var id = x;
var enCount = 0;
for (i = 0; i < aliveEnemies.length; i++) {
if (aliveEnemies.enemyId() == id) enCount++;
}
visible = enCount > 0 ? true : false;
</Custom Show Eval>
id = x, change x to the enemy id.
That code looks like what I might be looking for. How do I use it? Just paste it into Yanflys skill core?
paste it in the skill's notetag. You need yanfly's skill core for it to work.
don't forgot to change 'x' to the enemy id.
Original thread: https://forums.rpgmakerweb.com/threads/adding-and-removing-skills-with-events.58148/