Enemy

I want to make 1 enemy random within a premade troop event.

EG. I want a character to fight alongside a familiar what is random
How could this be done

I thought of:
Character Battle event
if variable = 1:
Familiar 1 Battle Event
if variable = 2:
Familiar 2 Battle event
....

But this doesn't work, can somebody help
please show us a screenshot of the troop event.
what is the condition under which the event runs? how often can it be triggered (span)?
@Andar The Only thing in troops is the character as a separate from the familiars one and theres no event under the code due to frustration on the topic
I want to make 1 enemy random within a premade troop event.

....

But this doesn't work, can somebody help

theres no event under the code due to frustration on the topic
I'm confused by the situation. If there's no event, then what did you try that didn't work?

In any case, what I would do without needing to use any plugins is:
1) Create the Troop including your main enemy and all possible random familiars.
2) Right-click on the pictures of the familiars and select appear halfway, which will make them not load at the start of battle.
3) Make a troop event at Turn 0 that does precisely what you were describing, check a random number and use that to determine which familiar you bring in (event tab 3, Enemy Appear).
so, you want a set group of enemies, and one additional left to chance?
theres no event under the code
then where is that event code you wrote on the first post?
please show us a screenshot of whereever that is, because we need the full event properties instead only a text of event content
@Andar like I said I had it until I got frustrated and closed software. All I want is a solution to my question can I have a set character and another randomized either plugin or variable

@gstv87 yes i want that idea one set and one randomized

Is there a plugin or a script code for this idea or something
@ATT_Turan gave you a solution that would work if you only want one fixed and one random - this would let you choose between 7 random enemies.

If you have more than 7 to choose from, you could take the same approach but just add your fixed and your one random enemy, set to appear halfway, then at the start of battle use the Transform Enemy command to set it to whatever familiar you wanted, then make them appear.

No need for a plugin or script code, unless the above ideas don't work for you (and then you should state why they don't work because that would mean you're after something a little more/different than you've stated so far).
If you have more than 7 to choose from, you could take the same approach but just add your fixed and your one random enemy, set to appear halfway, then at the start of battle use the Transform Enemy command to set it to whatever familiar you wanted
That would be more elegant - I forgot there was a button for that in the event editor 😉
ok sorry for being too long decided to have a break from internet.
1630361796811.png

The Troop set up is Character (Static) and the random is shown as one but this code doesn't change the battle of enemy 2, where have i gone wrong
please show the full troop event, not only the contents.

most likely you either messed up the condition or the span of the event.

and you don't have to set a variable to zero before randomizing, one control variable for the random effect is enough.
where have i gone wrong
How can we answer without seeing the full event?

Some possibilities based on what is visible:
1) Why do you have a second random number? All of your enemy transforms that we see are only happening if the first random variable is 0, so it would only happen 25% of the time.

2) Are you taking the suggestion to have the enemy that represents the random battler set to halfway inside the troop? If so, are you actually revealing them after transforming them?
I know a few things about eventing, but I am puzzled here.
In this it's only 25% of the time, and what about test 2 = 5 or 6?
So it's 5/7 chance that the enemy would transform into another enemy.

You should make a troop event like this:
When enemy (1) <50 %
Control variable 0-4
if variable = 0 then ...Sea angel appear
if variable = 1 then ...Blob appear
if variable = 2 then ...Wazard angel appear
if variable = 3 then ...Cerberous appear
if variable = 4 then ...Wasp appear
You will have to set the enemies in each troop, but then with (right mouse click) Appear Halfway.

You could do it like this, but why not make a troops with these enemies, so you could
run a variable when you touch your enemy (if you have that on the map) and set it to troops.
If var 1 = 1 then troop 1, if 2 then troop 2 and so on....
It's random also, I use it in my game.

Oh wait, I see what you mean, you would not a random enemy, but a random ally to fight with you!
In that case: control variable 0-4.
if 0 then add party member X,
if 1 then add party member Y.
and you'll need a troop event when all enemies are dead that the party member leaves the party.
@Walldeaf the rest of the code is under just couldn't get the snap shot to fit all code. It just more of what is shown, and it is enemy not ally
the rest of the code is under just couldn't get the snap shot to fit all code. I
That code is useless without the code properties.
As I already asked above, we need to see the entire event not only the contents, especially as one reason for the failure could be wrong condition or wrong span.
and we need to see the enemies available in the troop as well - what is enemy #2 for that troop?

so please post full screenshots - preferably using [alt]-[prtscrn] because that will automatically crop the screenshot to the current wndow.
Walldeaf the rest of the code is under just couldn't get the snap shot to fit all code. It just more of what is shown, and it is enemy not ally
Why did you respond to that weird, random post and not to myself and Andar saying you need to provide the full event and asking relevant questions? 😛

Original thread: https://forums.rpgmakerweb.com/threads/enemy.139875/