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.
Change enemy name
● ARCHIVED · READ-ONLY
-
-
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. -
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. -
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.
-
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. -
Have you thought of using the Transform Enemy command?
-
@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. -
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. -
Problem solved. I overwrote the Game_Enemy.prototype.name function to append the text I wanted. Thanks for the help, guys.
-
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.