DGM

Veteran
Veteran
Joined
Jul 22, 2013
Messages
71
Reaction score
12
Primarily Uses
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.
 

waynee95

Inactive
Veteran
Joined
Jul 2, 2016
Messages
701
Reaction score
635
First Language
German
Primarily Uses
RMMV
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.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,713
Reaction score
1,786
First Language
Spanish
Primarily Uses
RMVXA
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.
 
Last edited:

DGM

Veteran
Veteran
Joined
Jul 22, 2013
Messages
71
Reaction score
12
Primarily Uses
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.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,713
Reaction score
1,786
First Language
Spanish
Primarily Uses
RMVXA
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,721
Reaction score
15,848
First Language
English
Primarily Uses
RMMV
Have you thought of using the Transform Enemy command?
 

DGM

Veteran
Veteran
Joined
Jul 22, 2013
Messages
71
Reaction score
12
Primarily Uses
@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.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
603
First Language
French
Primarily Uses
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.
 

DGM

Veteran
Veteran
Joined
Jul 22, 2013
Messages
71
Reaction score
12
Primarily Uses
Problem solved. I overwrote the Game_Enemy.prototype.name function to append the text I wanted. Thanks for the help, guys.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,713
Reaction score
1,786
First Language
Spanish
Primarily Uses
RMVXA
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.
 

Latest Threads

Latest Profile Posts

What happens with this list, is it currently possible to buy any of these RPGMAKER at least those that are for PC?

Combat skill combination demostration
grief... finding a font that works with the engine has been a bigger process than I thought it'd be. doesn't help MV loves to scrunch letters next to each other like a football huddle.
The new Phoenix plugin. I drew icons and an interface into it

Forum statistics

Threads
122,182
Messages
1,147,095
Members
160,455
Latest member
fajar82
Top