I've been working on an enemy scan skill along the lines of this. The main thing I want to differently from it is that I want to put in a blurb with some more information about the enemy, along the lines of OFF or Undertale.
As an example:
"Enemy Name
This enemy doesn't exist, as it's being used as an example.
HP: 44983/182908 MP: 392/3832 SP: 100
etc."
There didn't seem to be an easy way to alter the given code to put the blurb in, so I opted to do something a little different. Here's what I have so far.
It works all right so far. My problem is that I'd have to create a separate conditional branch for every enemy in the game, which would be a bit tedious (and also a bit of an eyesore within the common event itself). What I'd actually like to do is give each enemy a notetag with the analyze blurb in it and have the skill check that notetag when it scans the enemy, but I'm not sure if that's possible without a plugin.
I also don't know how to work elemental weaknesses/resistances into this, as there doesn't seem to be a way to store strings for a common event (or anything else) to reference. My first thought was just to copy the bit from Yanfly's and put it after my stuff, but that made the elemental stuff appear before everything else, which I don't want. I also tried putting that script into the common event, which gave me a "target is not defined" error.
As it turns out, it is possible to store strings in variables via scripting. So I adapted the elemental check from Yanfly's and changed the bit that would normally convert it into text to have it store the weakness, resist, immune, and absorb strings into respective variables and have the common event reference those variables.
Finally, there's a certain enemy in the game I don't want to be scannable; if that enemy's scanned, it hurts the user of the skill for a fourth of their health instead. That bit of the code also works all right; I'd just like to know if it's possible to have the user act like they've been damaged once the damge is dealt, and also if it's possible to have the animation finish before doing the damage. I managed to figure out how to get the game to wait for the animation to finish (BattleManager.actionWaitForAnimation()), but the damage still occurs at the start of the animation rather than at the end.
I apologize if I put this in the wrong forum; although this does make heavy use of Yanfly's Skill Core, I thought that since I am trying to JavaScript here that this forum was appropriate.
As an example:
"Enemy Name
This enemy doesn't exist, as it's being used as an example.
HP: 44983/182908 MP: 392/3832 SP: 100
etc."
There didn't seem to be an easy way to alter the given code to put the blurb in, so I opted to do something a little different. Here's what I have so far.
<Before Eval>
if (target._enemyId != 21 && target._enemyId != 22) {
$gameVariables.setValue(13, target._enemyId);
$gameVariables.setValue(14, target.hp);
$gameVariables.setValue(15, target.mhp);
$gameVariables.setValue(16, target.mp);
$gameVariables.setValue(17, target.mmp);
$gameVariables.setValue(18, target.tp);
$gameVariables.setValue(19, target.atk);
$gameVariables.setValue(20, target.def);
$gameVariables.setValue(21, target.mat);
$gameVariables.setValue(22, target.mdf);
$gameVariables.setValue(23, target.agi);
$gameVariables.setValue(24, target.level);
$gameTemp.reserveCommonEvent(10);
} else {
var damage = 0;
damage -= Math.ceil(user.hp / 4);
user.startAnimation(63);
user.gainHp(damage);
user.startDamagePopup();
user.clearResult();
}
</Before Eval>
if (target._enemyId != 21 && target._enemyId != 22) {
$gameVariables.setValue(13, target._enemyId);
$gameVariables.setValue(14, target.hp);
$gameVariables.setValue(15, target.mhp);
$gameVariables.setValue(16, target.mp);
$gameVariables.setValue(17, target.mmp);
$gameVariables.setValue(18, target.tp);
$gameVariables.setValue(19, target.atk);
$gameVariables.setValue(20, target.def);
$gameVariables.setValue(21, target.mat);
$gameVariables.setValue(22, target.mdf);
$gameVariables.setValue(23, target.agi);
$gameVariables.setValue(24, target.level);
$gameTemp.reserveCommonEvent(10);
} else {
var damage = 0;
damage -= Math.ceil(user.hp / 4);
user.startAnimation(63);
user.gainHp(damage);
user.startDamagePopup();
user.clearResult();
}
</Before Eval>
It works all right so far. My problem is that I'd have to create a separate conditional branch for every enemy in the game, which would be a bit tedious (and also a bit of an eyesore within the common event itself). What I'd actually like to do is give each enemy a notetag with the analyze blurb in it and have the skill check that notetag when it scans the enemy, but I'm not sure if that's possible without a plugin.
As it turns out, it is possible to store strings in variables via scripting. So I adapted the elemental check from Yanfly's and changed the bit that would normally convert it into text to have it store the weakness, resist, immune, and absorb strings into respective variables and have the common event reference those variables.
Finally, there's a certain enemy in the game I don't want to be scannable; if that enemy's scanned, it hurts the user of the skill for a fourth of their health instead. That bit of the code also works all right; I'd just like to know if it's possible to have the user act like they've been damaged once the damge is dealt, and also if it's possible to have the animation finish before doing the damage. I managed to figure out how to get the game to wait for the animation to finish (BattleManager.actionWaitForAnimation()), but the damage still occurs at the start of the animation rather than at the end.
I apologize if I put this in the wrong forum; although this does make heavy use of Yanfly's Skill Core, I thought that since I am trying to JavaScript here that this forum was appropriate.