When enemies are "alerted"(using EventChasePlayer) I want to store their event ID and associated enemy ID into a set of variables. When the battle starts, I want to replace enemies in the troop with enemy ID stored in the variables. The Enemy Transform function doesn't seem to have an input for variables, so this likely needs to be done by scriptcall. What would be the scriptcall to do this?
MV Replace Enemies By Variable
Javascript/Plugin SupportThere's a list of script calls (post in the forum). You can replace the numbers with variables if you want.
// Transform enemy #1 (index 0) into enemy ID 8
// Transform enemy #1 (index 0) into enemy ID 8
Code:
$gameTroop.members()[0].transform(8);
$gameTroop.makeUniqueNames();
Do the parentheses in makeUniqueNames() take any arguments?
nope. it just adds the letters to the enemy names if there are duplicates
$gameTroop.members()[0].transform($gameVariables.value(26));$gameTroop.members()[0].transform($gameVariables.value(28));$gameTroop.members()[0].transform($gameVariables.value(30));$gameTroop.members()[0].transform($gameVariables.value(32));$gameTroop.members()[0].transform($gameVariables.value(34));$gameTroop.members()[0].transform($gameVariables.value(36));$gameTroop.members()[0].transform($gameVariables.value(38));$gameTroop.members()[0].transform($gameVariables.value(40));$gameTroop.makeUniqueNames();I need something to catch if its 0 and then delete the enemy.
Edit. I seem to have found something that works.
let v = 26;for (let t = 0; t < 8; t++) { if ($gameVariables.value(v) == 0) { $gameTroop.members()[t].hide() } else { $gameTroop.members()[t].transform($gameVariables.value(v)); } v += 2}$gameTroop.makeUniqueNames();Original thread: https://forums.rpgmakerweb.com/threads/replace-enemies-by-variable.175230/