I'm trying to make encounters not random. What I mean is you need to touch the event monster to fight them. But I need to make it so that the enemy's behavior and character set change according to the average of the party's level. Like if the player is stronger than the monster, the enemy event will mostly run away and have a blue color. Blue means it's weaker, White means it's just right, Red means it's stronger but still killable, Black means it's out of the player's league and purple means it's and event.
How do I make the behavior change according to the party's average level? Any ideas?
Thanks,
Doing this without RMXP up so... bear with me XD
Common event that's always on, have 1 variable for each actor in the party. Variable 1 set it to Actor 1's level, Variable 2 set to Actor 2's and so on. Add all of them and store it in another variable. Then divide that variable by the number of actors you have. And there... you have the average level.
Then on the monster event, set the conditions of the first page, the blue one to be, if Variable Average Level is 10 or greater, second page, white one with Variable Average Level is 15 or greater and so on.
Hope you under stand me :P
It can be done simplier if you use a code snipplet in a call script command so you don't have to bother with dynamic calculation of the level.
levels = 0
$game_party.actors.each {|actor|
levels += actor.level}
$game_variables[ID] =
levels / $game_party.actors.size
Use a parallel process which changes the color of events all the time. That way when you return from a battle, it will update the colors if your party's average level increased if necessary.
BTW, there is an event command that calls battles. You can also set up enemy actions to have a specific average party level as condition. This option calculates the average level internally, you don't have to worry about it.
Thanks for the little script. Its soo much better than having to event it with 6 characters to calculate but I managed to event 4 characters before checking on the thread.
Quote from: Blizzard on June 28, 2008, 06:51:07 am
Use a parallel process which changes the color of events all the time. That way when you return from a battle, it will update the colors if your party's average level increased if necessary.
I also tried to do that. I put a parallel process on the map and then I made another event that ups my char's level by one. But even though the average level was higher, the event's charset didn't change at all.
This is what I put on the parallel process. (The calculating was done with eventing)
<>Common Event: Calculating Average Party Lv
<>Wait: 10 Frames