Enemy Levels




This script allows you to assign levels to enemies. The level of an enemy is determined when you encounter the enemy.


The level is specified as a formula, which means you can define two types of levels:


1. Static level. This means the enemy's level never changes throughout the game. For example, a slime might always be level 1 no matter what.


2. Dynamic level. This means the enemy's level relies on data that may change throughout the game. For example, you can bind an enemy's level to a game variable so that its level changes whenever you change the variable.


Enemy levels on their own don't do anything, but with combined with enemy classes and other scripts, it can add a lot of customization options.


In addition to setting enemy levels, this script provides a number of other enemy level related functionality, such as changing levels during battle and setting max/min enemy levels.


Get it at Hime Works!
Interesting, oh, looking through the code there are some small mistakes.

On Lines 130, 143, and 156 you have t=$game_switches, which is already covered by s=$game_switches.  That and according to the instructions they should probably be t=$game_troop instead.

I don't see that problem in your other enemy/formula scripts so no problems in those thankfully, but thought you should know ^^
Thanks, the first one was me typing and not reading what I typed and the others were a result of copy-pasting.
Not sure why such a script does not have more comments. Makes it harder for a newbie like me to go through it and get the extra help. So I wanted to add say level 1 bat and level 5 and 10 and 15 and so forth. I added the simple <enemy level: 50> and I was hoping to fight a level 50 bat. Well it was a level 50 bat but none of its stats went up. At this part I kept reading the comments but was pretty confused. Being newer to RPG Maker I tried looking for an example game in the thread but I could not find one.

Any help would be wonderful. 
It isn't obvious in the post, but you need to use something like Enemy Classes (http://www.himeworks.com/2013/11/16/enemy-class/) if you want to set up stat curves.
It isn't obvious in the post, but you need to use something like Enemy Classes (http://www.himeworks.com/2013/11/16/enemy-class/) if you want to set up stat curves.
Thanks so much it works really well. I guess I will have to learn how to balance my game a bit more. I tried basic setting actor to 50 with a good weapon vs 50 slime and its class to just default values and got owned a lot haha.

Is there a way to do the class/level through event call only and not through enemy comments? Right now I use the roaming feature of mobs on the map through the event. So rather then having to create say 5 different slime enemies it would be sort of nice if I could just set it through the event and nothing in their comments maybe beside class if that is a must.

I will have to try your other scripts as well I hear you have a gold/exp one as well 🙂
Looks great!
Is there a way to do the class/level through event call only and not through enemy comments? Right now I use the roaming feature of mobs on the map through the event. So rather then having to create say 5 different slime enemies it would be sort of nice if I could just set it through the event and nothing in their comments maybe beside class if that is a must.
Yes, enemy levels can be adjusted dynamically during battle using script calls.


Check the section called "Adjusting Levels" in the usage section for more details.


Similarly, enemy classes can also be changed. It is described in the usage section for that script as well.
Thanks 🙂 I tried this:

Spoiler
H3XKxpU.png
Got this when I went into combat:

Spoiler
cL0cvDQ.png
Oh, I didn't add support for that.


The script call is assumed to be used during battle (eg: in the troop event).


But that is a common use case, so I'll add that some point.
Oh, I didn't add support for that.

The script call is assumed to be used during battle (eg: in the troop event).

But that is a common use case, so I'll add that some point.
Ahhh, Thanks. Yeah I was hoping to built it right into the event so I did not need to touch the database as much. My friend and I are working on this and end up syncing with dropbox or more like merging by hand but through dropbox. So we work on different maps and such but everytime we both touch the database its a bit of a pain so we try hard to keep everything in the event level.

Thanks for the information and sorry for getting back so late. Just got back home from my Birthday 🙂
Well, one workaround is to set a variable outside of battle, and then have the troop read the variable on turn 0 and then make the script call.


This may be preferable over setting the level outside of battle.
Thanks I will give that a try 🙂
I am using an ABS and enemies levels. Can you make it where the levels can be modified outside of battle? 
How do you assign levels to enemies on the map? Because this was designed with the default battle system in mind assuming enemies are organized in a troop.
They are not. They are taken straight from the database. I am using the Pearl ABS and to make an enemy you set it up in the database and tag the event with something like this in the event named. <enemy 34> That will use the information from the 34th enemy in the database. The levels appear on the name of the enemy after I set it up in the note box.
From what you're saying, I would likely need to know how the enemies are set up in order to reference them so that I can actually change the level.


I can't just change the database enemy's level directly because that will either affect every enemy, or won't affect existing enemies.


If you want an add-on made for pearl ABS you can create a demo with everything set up (preferably a minimal setup so I don't need to spend much time downloading it)
So I used the Pearl Demo and added the Enemy Levels script. Here is the link to the Demo.

https://www.dropbox.com/sh/leu86d12b71m5lf/AAB6nuQhx0g_7HgFYlkBGGZya
The enemies are just thrown into an array, which makes it less convenient for updating.


The first problem I see is this

@enemy = Game_Enemy.new(0, $1.to_i) if event.name =~ /<enemy: (.*)>/iAll enemies have the same index. There is nothing distinguishing one enemy from another, which means you have basically no way to reference a specific enemy.
In order to change this, the script would need to be changed so that a unique ID is used for each enemy. An event ID can be used, but this becomes an issue if you start having dynamic spawning, where random ID's are assigned to enemies.


Unfortunately adding enemies to the map is not written modularly so I need to overwrite a lot of logic just to add this change.


Here's the patch


http://www.himeworks.com/2014/07/13/enemy-levels-pearl-abs-patch/
so would the enemy's level be the same as the player

Original thread: https://forums.rpgmakerweb.com/threads/enemy-levels.20022/