Getting enemy level by code (YEP_Enemylevels)

Hi,


I try to get out the enemys level by script as part of an ability/item.


By Yanflys description it should be enemy.level ...but I get the message that enemy is not defined. (in and out of battle)


Maybe someone has a clue to help? 🙁


thx a lot 🙂
$gameTroop.members()[x].level    <------- this is in the battle
As far as i know you can't trully give levels to enemies, that's why skills whose formula has a.level on them gets an error.


I've tried this before and all i got were zeros from skills, say may happen with anything else.
As far as i know you can't trully give levels to enemies, that's why skills whose formula has a.level on them gets an error.


I've tried this before and all i got were zeros from skills, say may happen with anything else.



He is using  YEP_Enemylevels, it's gives enemies level
That indeed helped a lot! Thx to both of you 🙂

@mrcopra: I actually try to make a actor out of the enemy...works quite fine so far. I just need to reach his enemy index number for the class of the new actor and the name of the enemy...well - for the name. 😀


I tried it the same way like for the level now... Maybe you can give me a hand there 2?


For the ID


$gameActors.actor($gameVariables.value(1)).changeClass( $gameTroop.members()[0].id , false);


Here I get ... cannot read property 'traits' of undefined


For the Name


$gameActors.actor($gameVariables.value(1)).setName($gameTroop.members()[0].originalName);


That sadly gives me a unreadable name in some kind of buggy signs :/


The lvl command allrdy helped me a lot! Thank you 🙂
 
@mrcopra i've tried to work with levels for enemies using the same plugin and nothing happened.


Shouldn't it be $gameTroop.enemy.level ?


As far as i know it returns the current level


You can only increase and decrease level of enemies with this plugin, it doesn't give it actual levels. Trying to make skills or items that are based on enemy levels to deal damage for example will only result in error.
@mrcopra i've tried to work with levels for enemies using the same plugin and nothing happened.


Shouldn't it be $gameTroop.enemy.level ?


As far as i know it returns the current level


You can only increase and decrease level of enemies with this plugin, it doesn't give it actual levels. Trying to make skills or items that are based on enemy levels to deal damage for example will only result in error.

What mrcopra put is right. The plugin does gives levels to enemies.


With that plugin you could do something like : var dmg = $gameTroop.members()[1].level * 30 * $gameTroop.members()[1].atk;


Or something like that...


It would work.
Try to use "a.level" for damage or healing formulas and you'll see that it won't work.


This is totally virtual.
The plugin will work with attributes that an enemy can have and that's it.
You can use a little trick to get index of enemy so you can use it in formula



$gameTroop.members()[b.index()].level

Original thread: https://forums.rpgmakerweb.com/threads/getting-enemy-level-by-code-yep_enemylevels.65720/