Adding different states via common event (At the start of battle)

Status
Not open for further replies.

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
539
Reaction score
752
First Language
German
Primarily Uses
RMMV
So what I want to do is add certain states to all enemies at the start of any battle.
I'll be doing this via YEP_BaseTroopEvents which calls a common event on Turn 0 of every battle.

The main issue here is that I don't want every enemy to gain the same state.
Basically; All enemies gain the same state while a handful of strong enemies and all bosses gain a lesser variant of that state.

Now I need a way to distinguish boss and strong enemies from common enemies.
One way I thought of was something like this:

Script-Call:

let targets = $gameTroop.members();
targets.forEach(function(target) {
if (COLLAPSE EFFECT !== NORMAL) {
target.addState(x);
} else {
target.addState(y);
}
});

Firstly, I don't know the proper code for checking collapse effects.
Secondly, this solution does not really work for me because I also want it to affect some strong non-boss enemies.

So I need something to distinguish between boss and non-boss to add the states appropriately.

Edit: Any possible directions and alternatives are most appreciated aswell.
 
Last edited:

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
539
Reaction score
752
First Language
German
Primarily Uses
RMMV
Okay, so I am really stupid. Turns out the answer in my case was really simple.

I just give EVERY enemy BOTH states instead of figuring out how to give separate enemies different states. And then I just make Bosses immune to one state and all other enemies immun to the other state.
The rest resolves itself basically.

So in short I did something like this:
I add State X and Y to ALL enemies.
Bosses are immune to State X and thus only gain State Y.
Non-Bosses are immune to State Y and thus only gain State X.

The thread can be closed now. Thank you brain for giving me the obious solution like 20 hours later.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,054
Reaction score
8,906
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

When there's a will, there's a lifehack. :ninja:

Before i mess with battle UI further, does it look decent enough? :hswt:
Free MZ? That's good. I should go try it out then.
Let's see if I can make it in time xD
Knipsel.PNG

Forum statistics

Threads
112,523
Messages
1,068,912
Members
146,207
Latest member
TyRo87
Top