Change enemy name

● ARCHIVED · READ-ONLY
Started by DGM 10 posts View original ↗
  1. Is there an easy way to change an individual enemy's name mid-battle without replacing the battler? There's no script call for it and I haven't found a plugin. The new name will not chosen by the player so no input is needed.
  2. You could do $dataEnemies[ID].name = 'Test'

    Problem is when there are more enemies of that same type the name will be changed for all of them.
  3. you can use a troop event, and force-edit the active troop.
    you'll have to re-define the object enemy, so that the name can be changed (as it is by default, it's read-only)
    but yes, you can do it on the fly.
  4. Does anyone know where the code is for drawing an enemy's name in battle? I've searched the .js files for "drawText" but I'm coming up empty.
  5. window_battleenemy -> drawitem() -> drawtext()
    with each item being [member].name, out of gameTroop.members[]
    with name being originalname + letter, with letter defined by gameTroop.makeUniqueNames.
    give or take a "_", those are the function names.

    originalName is read-only.
    redefine that, and it should work.
  6. Have you thought of using the Transform Enemy command?
  7. @gstv87

    There it is! Okay, I should hopefully be able to figure it out from here. Thanks.



    @Shaz

    Transform isn't practical for my purposes. The idea is to draw modifiers for each enemy from a pool of options, rogue-lite style. To do that with transform I'd need many versions of every single enemy type in the game.
  8. Just edit the name method of the particular enemy with a script call.

    Code:
    $gameTroop.members()[index].name = function() {return "your new name"}

    This will have no lasting effect since it modifies an enemy instance and not the data itself from where enemies are created at battle start.
  9. Problem solved. I overwrote the Game_Enemy.prototype.name function to append the text I wanted. Thanks for the help, guys.
  10. DGM said:
    Problem solved. I overwrote the Game_Enemy.prototype.name function to append the text I wanted. Thanks for the help, guys.

    and that, ladies and gentlemen, is what programmers do.