Do you want your enemies to have levels like actors?
You could use levels as a way to determine their difficulty level compared to the actor’s current level. For example, if your actor is currently level 10 and the enemy is level 20, you might use a red font to draw the enemy’s name to indicate that it is dangerous.
Levels themselves do not mean much on their, for they are just a number. They become more powerful once you use other plugins that make use of them. For example, a plugin that you can use is Enemy Classes, which allows you to assign classes to enemies. Using both plugins, you can now set up parameters curves based on the enemy’s level, as well as the skills they can use based on the level.
Plugin: download here (right-click, save as)
Download ths plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_EnemyLevels plugin.
Once it is in your list of plugins, turn the plugin on.
To initialize enemies with a particular level, note-tag enemies with
<enemy level: FORMULA />
For example, you could write numbers
<enemy level: 23 />
Or you could include the game variables, using the formula variable `v`:
<enemy level: 5 + v.value(3) * 4 />
Which means the enemy’s level is equal to 5 plus the value of variable 3 multiplied by 4. This can be used to set up dynamic levels based on things like difficulty.
If you would like to display the enemy’s level in their name, in the plugin manager you can set the “Name Format” which is a formatted string that takes two pieces of info
1. Enemy name
2. Enemy level
So for example, if you write
%1 Level %2
And you encounter a level 5 slime in-game, it will read
Slime Level 5
If you would like to change levels, there are two ways to do it
1. Using plugin commands
For simple level management, you can use the following commands during battle:
set_enemy_level member MEMBER_ID to level LEVEL
Where the MEMBER_ID is the position of the enemy in the troop and the LEVEL is the number of the new level. For example, to change the second enemy in battle to level 10, you can write
set_enemy_level member 2 to level 10
You can also add or substract levels, using this plugin command
add_enemy_level LEVEL levels to member MEMDER_ID
If you specify a negative number, it will subtract the level.
For example, to add 5 levels to the third enemy, you would write
add_enemy_level 5 levels to member 3
To remove 10 levels from that enemy, you would write
add_enemy_level -10 levels to member 3
2. Script calls
If you would like more advanced ways to control enemy levels, you can use script calls directly. Say you wanted to modify the second enemy
Then you can use the following methods
$gameTroop.members().setLevel( NEW_LEVEL ) $gameTroop.members().addLevel( NEW_LEVEL )