MZ A boss that copies itself

Hi! Chugging along with my game and I'm now working on bosses. I want some opinions, I think this might be a tad ambitious for my skill level, but I wanted to give it a shot.

You know bosses like Crystal King in Paper Mario, who split into copies and you need to find the real one to actually cause damage? I was wondering if something like that is possible in MZ. Cause well, I have come up with a solution where I just make a phase change where the boss transforms from the singular boss to its clones, but with this method, the real enemy remains static and it sounds real cumbersome to make different troops just to rotate the real enemy.

I have seen another idea where you set up the clones to appear halfway, but that yields the same problem of the main foe remaining in the same spot. So... if there a way to make this work? I've seen people have made threads like these in the past, but all have gone dead so here's hoping!
Funny you should ask. I'm about to design a boss fight where the boss creates illusions of herself. If swapping positions isn't an option I was going to try switching the HP and Mp and statuses. The names under the enemies would be a problem though
Depends on what you want to happen when the player hits the wrong one I suppose, but generally what you could do is have x amount of copies of the boss appear half way, when the boss uses his clone skill, save his HP in a variable, make a troop event with a random variable and a bunch of conditional branches (as many as you got copies), make all the copies appear and set the HP of the one chosen by the random variable to the boss HP variable and the other to 1 hp or whatever.

Then make them all immune to your knockout state. Have a troop event check if any enemy is 0 HP and if so make the clones disappear either just like that, or sync the HP back up with the enemy id 0 (the main original boss battler) , then kill off the rest. Or however else your clones are supposed to work.

This should work, although I wrote it off the top of my head and I'm sure with some plugins it might be possible to get a less tedious solution.
Hmm there are tons of ways to do this so you may need to be specific in what you want. My mind thinks maybe a hidden dummy state is applied to the "real" boss and you use a special skill then to "reveal" the boss (check for dummy state) and, if so, reveal that it's the real boss. But then again maybe you want the hp to be divided and their stats are boosted like speed so they multi strike like glass cannons and you have to take them all out, or maybe if you don't do enough damage or have a specific skill or trinket the boss will taunt and split at the end of each turn. really my imagination could run wild with a shadow cloning Naruto type boss. I could prolly walk you through enough to get it going but you'd have to be specific in what exactly what you want if you want me to try to make a step by step for this one. its a pretty dynamic feature. Might take a little scripting depending what you want.
Depends on what you want to happen when the player hits the wrong one I suppose, but generally what you could do is have x amount of copies of the boss appear half way, when the boss uses his clone skill, save his HP in a variable, make a troop event with a random variable and a bunch of conditional branches (as many as you got copies), make all the copies appear and set the HP of the one chosen by the random variable to the boss HP variable and the other to 1 hp or whatever.

Then make them all immune to your knockout state. Have a troop event check if any enemy is 0 HP and if so make the clones disappear either just like that, or sync the HP back up with the enemy id 0 (the main original boss battler) , then kill off the rest. Or however else your clones are supposed to work.

This should work, although I wrote it off the top of my head and I'm sure with some plugins it might be possible to get a less tedious solution.
I like this idea and I was thinking of a variant where upon the skill activation (or any trigger that causes the boss to hide its identity), use enemy transform. Clones look identical (but are immune to all forms of damage) while boss is not (and thus is the only one whose HP can be lowered). Decide who transforms to boss and who to clone by RNG. Once the variable with stored HP hits 0, manually trigger all enemies to die/disappear with another troop event, winning the battle.

If you don't mind the clones being permanent, this will cause the boss to hop from one enemy slot to another without player knowing until they attack the right enemy slot.
Funny you should ask. I'm about to design a boss fight where the boss creates illusions of herself. If swapping positions isn't an option I was going to try switching the HP and Mp and statuses. The names under the enemies would be a problem though

Hey Twinsies! If yours happens to be a witch with butterfly motifs, teach me how to get into people's heads! :LZScheeze:

To everyone else who's pitched in, thank you so much!

Hmm there are tons of ways to do this so you may need to be specific in what you want. My mind thinks maybe a hidden dummy state is applied to the "real" boss and you use a special skill then to "reveal" the boss (check for dummy state) and, if so, reveal that it's the real boss. But then again maybe you want the hp to be divided and their stats are boosted like speed so they multi strike like glass cannons and you have to take them all out, or maybe if you don't do enough damage or have a specific skill or trinket the boss will taunt and split at the end of each turn. really my imagination could run wild with a shadow cloning Naruto type boss. I could prolly walk you through enough to get it going but you'd have to be specific in what exactly what you want if you want me to try to make a step by step for this one. its a pretty dynamic feature. Might take a little scripting depending what you want.


Now for the details you were asking: I plan on having the boss use the illusions of herself pretty much as extra firepower, since they have access to pretty much her same moveset and stats with the exception of a special desperation move.

The clones don't poof with a single attack, they'd probably need a few hits to go down. Unless you find the real witch, in which case dealing any amount of damage to her will make them disappear. She would then engage solo for a few rounds before re-summoning the clones and change position to keep players guessing.

I think the crux of it is making her change position from among the available enemy slots, so players actually need to find her instead of attacking the same spot every round lol I already have a solution if players spam multi-target attacks, so don't worry about that lol
One way to do it is to have one witch in the middle and four clone witches surrounding the real one:
FAKE FAKE
REAL
FAKE FAKE


The FAKEs will be set to Appear Mid-battle in the troop settings (right click on the battler). When REAL uses its clone ability the first time, have the FAKEs appear and hide REAL by setting e.g. $gameTroop._enemies[0]._hidden = true". Have some random variable pick which is the true one, and give him a state or give the illusions immortal or something.

Then when the correct one is hit set all the FAKEs' _hidden property to true, and REAL's _hidden property to false.

When REAL uses clone ability second time and on, reverse the _hidden properties.

Something like that?
I had some time at work today to think about ways to do this feature, and get the randomization you want. It's not perfect and will need some trial and error to work out. It is just a basic outline, but it can be built with a little effort and creativity.
create the enemies: In your database, create four enemies: the real boss and three clones. The clones should have the same stats and abilities as the real boss, but with reduced HP.
Create the Cloning Skill: In your database, create a new skill for the boss. This skill will be used to trigger the cloning process. It doesn't need to do any damage or have any effects, its only purpose is to trigger the common event that creates the clones.
Create the common event: In your database, create a new common event. This event will be triggered when the boss uses the cloning skill.
First, use the 'Control Variables' command to create a new variable. This variable will be used to randomly select the position of the real boss. Set the operation to 'Set', the operand to 'Random', and the range to 1-4.
Next, use four 'Conditional Branch' commands to check the value of the variable. If the variable is 1, the real boss should be added to the first position and the clones to the other three positions. If the variable is 2, the real boss should be added to the second position, and so on. Use the Change Enemy HP command to remove the real boss, and the 'Force action' command to add the real boss and the clones to the battle in the selected order.

Create the battle event: In your Troops tab, create a new battle event. This event will check if the real boss has been hit and make all clones disappear if it has.
Use the 'Conditional Branch' command to check if the real boss' HP has decreased. If it has, then just use the 'Change Enemy HP' command to remove all clones from the battle.

So with this game mechanic, the boss has the ability to clone itself, creating three additional enemies that appear identical to the player. These clones have the same abilities as the boss but are weaker in terms of hp.
The real boss hides among these clones, and its position is randomized each time the cloning skill is used. This forces the player to spread out their attacks, as they cannot tell which enemy is the real boss.
The twist in this mechanic is that when the player successfully hits the real boss, all the clones disappear. This means the player's strategy must involve finding the real boss among the clones, rather than simply defeating all enemies. That's the idea in a nutshell. Hope something from it gives some inspiration. :LZYcool:
Mmmmm! I see! I will fiddle with both Ludovinsky's and Canned_Dinosaur's ideas and report back! I have a good feeling about this :LZScheeze:
Okay, I've been working on this and I reached my first obstacle, yay!

So I went with Canned_Dinosaur's idea first of using a script call. I made the random variable and used it to give a special state to the one the variable marks as the "original". I managed to get the first half to work, making the original enemy disappear and leave the clones behind (strangely, I couldn't get a Show Animation command to do its thing, I wanted the transition to look pretty but oh well...) The issue came with the second half, hitting the clones and making them disappear to reveal the original. It's borked.

Here are the screenies, for the sake of space I only showed the first two conditional branches and the first two event pages, but they go all the way to 5. I tried to see if maybe adding several event pages would work, but apparently they didn't... I have the distinct feeling it could be the script? To my understanding, when using scripts, you count from 0 (so enemy 1 is 0, enemy 2 is 1 and so forth.... right? :LZSlol:)
Spoiler: Battle Event 1
1758946853152.png

1758946879334.png
1758946892643.png
1758946909677.png
Tried some prototyping on my end as well, and tried to keep the number of scripts to a minimum. But there's just some things that are too cumbersome without scripts...

The basic setup when placing the battlers is that you place the real witch first. That way the real witch will be treated as Enemy #1 (or in other words $gameTroop._enemies[0]). As for your animations not working, note that there is a separate event commands for animations during battle.

Spoiler: Page 1, Turn End, Turn 1, Span: Battle
◆Text:None, None, Window, Bottom
:Text:The enemy cloned itself!
◆Show Battle Animation:#1 Ghast, Flash
◆Control Variables:#0092 CloneReal=Random 1..4
◆Enemy Appear:#2 Ghast
◆Enemy Appear:#3 Ghast
◆Enemy Appear:#4 Ghast
◆Enemy Appear:#5 Ghast
◆Script:$gameTroop._enemies[0]._hidden=true;
◆Change Enemy State:Entire Troop, + Immortal
◆Script:$gameTroop._enemies[$gameVariables.value(92)].removeState(3);
◆Script:$gameTroop._enemies[$gameVariables.value(92)].setHp(1);

The below will basically be copy-pasted to pages 3 through 5. I used "setHp(100)" but you can also use recoverAll() if you prefer.

Spoiler: Page 2, Enemy HP (2) <= 0%, Span: Moment
◆If:Script:!$gameTroop._enemies[1].isStateAffected(3);
◆Text:None, None, Window, Bottom
:Text:Dammit!
◆Show Battle Animation:Entire Troop, Flash
◆Script:$gameTroop._enemies[0]._hidden=false;
◆Script:$gameTroop._enemies[1]._hidden=true;
◆Script:$gameTroop._enemies[2]._hidden=true;
◆Script:$gameTroop._enemies[3]._hidden=true;
◆Script:$gameTroop._enemies[4]._hidden=true;
◆Script:$gameTroop._enemies[$gameVariables.value(92)].setHp(100);
◆
:
End

Finally, something that will repeat every three turns:

Spoiler: Turn End, Turn 3+3*X, Span: Turn
◆If:Script:$gameTroop._enemies[0]._hidden != true;
◆Text:None, None, Window, Bottom
:Text:The enemy cloned itself!
◆Show Battle Animation:#1 Ghast, Flash
◆Control Variables:#0092 CloneReal=Random 1..4
◆Script:$gameTroop._enemies[0]._hidden=true;
◆Script:$gameTroop._enemies[1]._hidden=false;
◆Script:$gameTroop._enemies[2]._hidden=false;
◆Script:$gameTroop._enemies[3]._hidden=false;
◆Script:$gameTroop._enemies[4]._hidden=false;
◆Change Enemy State:Entire Troop, + Immortal
◆Script:$gameTroop._enemies[$gameVariables.value(92)].removeState(3);
◆Script:$gameTroop._enemies[$gameVariables.value(92)].setHp(1);
◆
:
End

It's a bit wonky but it should work.
I GOT IT TO WORK!!!!

So, rather than setting enemy HP to 1 (which would give the clone away, since I use Visustella and that has HP gauge visible), I created a variant of the witch that already has 1 HP so her gauge would appear full. I'm sure there's a way to finagle that, but I'll get to it when I make editing passes xD

The first spawn event worked perfectly. Witch clones, animations play (I feel so dumb for not realizing Battle Animations were in another page T-T), clone is destroyed, witch reappears... I had to set it to Turn instead of Moment, 'cause for some strange reason the game would freeze after the first enemy is killed.

For the deletion event, I had to add some Set HP scripts to the other clones, 'cause one thing I noticed is that when the respawn event triggered, some clones would appear with empty HP bars (or not appear at all) and it would mess up with the event, sometimes procc'ing the clone deletion if the variable decided one of those empty bar clones was the "it"

But yeah, the event now works!!! I'm quite happy with this result. Thank you Canned_Dinosaur!!!!! 😍😍😍
Not sure why it soft locks when you set it to moment. Are you sure you set it to Enemy HP <= 0%?

But in any case, glad you got it to work!

If you're already invested in Visustella jungle, probably the easiest way to go about it is to have a state with <JS Pre-Damage as Target> that turns on a switch (so iow, if the real witch is damaged, it turns on a switch). Have a troop event set to moment with that switch as a trigger, and have that troop event process the "Dammit!" stuff like in the example I detailed above.

Original thread: https://forums.rpgmakerweb.com/threads/a-boss-that-copies-itself.180261/