Hi guys, I'm wondering if anyone here can make a script that allows us to add a random state to enemies?
Actually, I can make it by using variables, but I can't make 2-3 random states at once. So, I want in a particular battle, at each the beginning of the battle; the boss will buff his/her minions. If we can configure it on the script editor, it will be nice.
If anyone can make this, you'll be credited for sure.
Sorry for my bad English. Thanks.
Add random states to enemies.
● ARCHIVED · READ-ONLY
-
-
Try to put this snippet
Code:Then in damage formuladef random_states states = [1,2,3,4,5,6] # State ID result = [] 2.times do result.push(states.shuffle.shift) end return resultend
Code:I haven't tried it yet thoughrandom_states.each {|s_id| b.add_state(s_id)} -
why can't you do that with events?
One randomizer (variable) for the number of states to add in a loop where a second variable randomly selects which state to add.
If there are enough possible states in the list, you don't even need to check for existing states - in those cases the player has luck and gets one less state on their enemies...
OK, doing everything in troop events on turn 0 does require quite a big event, but I don't see a reason why you can't do it... -
@TheoAllen
It didn't work, but thanks for trying. And I forgot to mention that the buffs are only applicable only for bosses. :)
Yeah, it because I must make a huge list of conditional branches, looping the branches seem to be very annoying, and I think I've found a way to manage it.
Actually I have to use 3 common events, each common event contains a list of potential states to occur.
I must make 3 variables and 4 common events :
Set 1 states :
SpoilerSet 1 states are mostly elemental buffs, it's kinda awkward to add fire and ice buff simultaneously.

Set 2 states :
Set 3 statesSpoilerSet 2 states are usually relevant to the special skill and states.

SpoilerSet 3 is mostly for adding abnormal states.

And, this is my troop event :
I think it's solved. I think it should be moved to the event tutorial right now. lolSpoiler[1.] is the enemy's name. I always put the boss in the first monster.
And note, that I added variable 6 and 7 to add a possibility to not add the 2nd and 3rd buffs.

Thanks everyone.