Enemy ID to Variable

● ARCHIVED · READ-ONLY
Started by YuuHkiSay 3 posts View original ↗
  1. I'm trying to get both a Skill and a Troop Event to assign an Enemy's ID to a variable for two different things. The skill I had done weeks ago using "target._enemyId" and worked, but now all of a sudden it no longer works, also I got "target._enemyId" from looking at Yanfly's Tips and Tricks for a Scan/Libra skill, which I use and works as intended somehow. Is there any way I can get the targeted Enemy's ID into a variable?
  2. YuuHkiSay said:
    but now all of a sudden it no longer works



    Have you changed anything? Is there anything different? i.e. 1 enemy vs multiple enemies, etc.


    Code never suddenly just 'doesn't work' xD


    edit @YuuHkiSay by the way, target._enemyId stores the ID of the target, e.g. the target of a skill, or a heal, or something of that sort.
  3. From what I can tell, i've only updated the plugins since then, and added one that doesn't conflict with the old ones. And yeah, the "target._enemyId" was only used in the Scan/Libra skill and the other skills that uses it, for the Trop Event I used "$gameTroop.members()[n]._enemyId". In the case of the other Skill and the Troop Event I have the whole thing saying "$gameVariables.setValue(2, target._enemyId)" and "$gameVariables.setValue(2, $gameTroop.members()[0]._enemyId)".