So, I'm trying to make an enemy that alternates between two sets of skills, two total actions per turn. One set to prime its allies to explode and summon more, and the other to attack directly. It is not working like that. At least not 100%. Am I way overcomplicating this by trying to use switches to determine which ones it uses?
Alternating skill list
RPG Maker MV SupportWhy not base each set on a particular state condition, and have each set inflict the opposite state and remove its own?
You could condition the primer skills to require over 80% MP and have them cost near-max MP. Then the damage skills could fire on condition that MP is under 50%. Have the damage skills refresh the enemy MP. That way, each turn they will fire a random primer followed by a random damage skill.
State conditions seem like a way more reliable method than that. What if one of your party members has a skill that absorbs MP from an enemy, for example?
Agreed, unless you purposely want that to play into the tactics.
Forgive me if this isn't quite it but could you possibly make 2 versions of the same enemy and have them rotate using the Battle Event page? I have a method of two-phase bosses (once they get to 50% HP they change for example) but I also have mechanics sometimes set to happen every X amount of turns, not sure if having something similar or having your enemy damaged a certain amount prompting the switching multiple times would solve this?
Then you'd have to copy over parameters, states, buffs, debuffs etc.
I take this approach too. I hadn't thought of the point Trihan raised, but then again, when my event transforms I want the new form to have a clean slate so I don't care about debuffs etc
Good news is, this worked! Bad news is, it only checks which state its in at the start of each turn, so it uses two skills from one set first turn, two skills from the second set next turn, repeat ad nauseam. And this is especially weird because I checked, it IMMEDIATELY changes the state, and I put a custom requirement to where it requires the state for it to even show up. I know it immediately changes because I gave it a visual to make sure I wasn't going insane.
Hmm, handy to know!
Hey,
From what I remember, at least by default enemies will choose their actions at the beginning of each turn so even if you alter the conditions it won't change the actions they have already lined up.
Transforming the enemy should be an exception though, so EsoStrix's solution might work here (transforming an enemy should leave its states and debuffs intact, they will just assume new base stats and abilities).
Other than that or an extra plugin, you could also use a script command to force a specific action (via a troop event at the start of the turn):
From what I remember, at least by default enemies will choose their actions at the beginning of each turn so even if you alter the conditions it won't change the actions they have already lined up.
Transforming the enemy should be an exception though, so EsoStrix's solution might work here (transforming an enemy should leave its states and debuffs intact, they will just assume new base stats and abilities).
Other than that or an extra plugin, you could also use a script command to force a specific action (via a troop event at the start of the turn):
JavaScript:
let enemy = $gameTroop.members()[0]; // Replace 0 with the enemy position in the troop (starting at 0)
let action = enemy.action(0); // Replace 0 with the number of the enemy action (starting at 0)
if (action) { // Checks if the action exists (in case the enemy is stunned or dead)
action.setSkill(17); // Replace 17 with the ID of the desired skill
action.setTarget(0); // Optional line if you want a specific target (Index starting at 0)
}
Right, though you can run the script $gameTroop.makeActions() to force them to pick their actions again. So if you had each set of skills change state and then run $gameTroop.makeActions() it might work?
So, I assume these would either go in the Troop comments or the Enemy comments, but can I get confirmation on where they go specifically before I start doing trial and error?
I thought I had something by using the Skill Cooldowns and AI Core to have it so that it would - assumably - be using one of the priming skills, then one of the attack skills, but I did it by listing two priming skills - both of which have a linked cooldown - and one attack skill with a bunch of extra turns. All this did was make it use a priming skill the first turn, then nothing else for the rest of the turn. Does that show any promise, or should I just give up on the alternating skill list and just make its attack skills curse allies?
it sounds like the enemy selected priming skills for both actions at the start of the turn and then locked them self out of the second action with the linked CD by the time they were ready to use the 2nd action. Yanfly's AI core has a parameter to make enemies choose their actions as their turns come around. that should prevent something like that from happening.
You could also play around with yanfly's instant casts and make one of the sets of skills instant if it doesnt work out. If the priming skills are instant and the attack skills are regular skills, i dont think an enemy would end up in the same situation
Wouldn't it still try to select all the priming skills? Or can you only use one Instant skill per turn?
you would still have to use the linked cooldowns to restrict them from doing as many of their primed skills as they can before attacking. if you dont give them some kind of restriction, then enemies can and will repeat them.
Alright, I'll give that a , but I think I found a way to do this using midfight scripting
edit: this is the funniest typo i've ever made
edit: this is the funniest typo i've ever made
Update: I DID IT, IT WORKS!
THANK YOU @Another Fen FOR GIVING ME THE FOUNDATION, THANK YOU POKEMON ESSENTIALS FOR GIVING ME THE IDEA, AND THANK YOU WE3 SCHOOLS FOR REMINDING ME HOW JAVA CODING WORKS!
THANK YOU @Another Fen FOR GIVING ME THE FOUNDATION, THANK YOU POKEMON ESSENTIALS FOR GIVING ME THE IDEA, AND THANK YOU WE3 SCHOOLS FOR REMINDING ME HOW JAVA CODING WORKS!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/alternating-skill-list.177658/