I Want to Make a 'Check Enemy' Skill

Not sure exactly how to word that. I'm not looking for a 'scan' skill that shows an enemy's stats or anything like that, I want to make a skill that gives you a description of the enemy, like "That's a Goblin. They attack travelers in forests. Their favorite food is hamburgers." That kind of thing.


I know I can use the damage formula box to do this. The absolute most basic way to do what I want to do would be to use an if statement to show a different message to the player based on the ID of the target, so I tried this:


if (b.id == 4) {$gameMessage.add("Test message.")}


But it didn't work. If I remove the if, I get the message, so is b.id not the right syntax? Or am I doing something else wrong? Alternatively, if there's a less clunky way to go about doing this, that would be greatly appreciated.
You're referring to the ID of the enemy in the database, right?  I think you want enemyId (note the capitalized i) rather than id.
That didn't change anything. Here's what I've got:


if (b.enemyId == 4) {$gameMessage.add("Not a slime.")} else {$gameMessage.add("Failed.")}


After I posted this thread realized I should put an else in to make sure that the if wasn't just being ignored entirely. When I use the Check skill in battle I always get "Failed.", so the loop is working, it's just b.enemyId doesn't give the correct value. I've also tried "b.enemyId > 0", in case I made some mistake about exactly what the enemy's ID number is, and that didn't change anything, either.
I don't know about the whole messaging thing, but I can help you with the enemy id part of the question.


You want to use b._enemyId and below is an example of a skill that would do 5 damage to enemy that has the id of 7, and 10 damage to everyone else.


(b._enemyId == 7)? 5 : 10
There we go, that worked. I was doing b.enemyId, not b._enemyId. That syntax feels...strange, but thank you!


I'm still hoping for an angel to fly in and link me to an 'Exactly What I Need' plugin, though.
try this one


$gameMessage.add($dataEnemies[b._enemyId].note)


it will make message with enemy's note
try this one


$gameMessage.add($dataEnemies[b._enemyId].note)


it will make message with enemy's note

This is great! But if the enemy has any notetags, they'll show up in the message too. Is there an easy way to fix that?
where u want get messages?

Original thread: https://forums.rpgmakerweb.com/threads/i-want-to-make-a-check-enemy-skill.59301/