Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Character that becomes a boss

I have a character that turns into a boss at one point. The problem is that I want to let the player name him, but have him keep the name when you fight him. I tried the old \n[3] (he is actor 3) thing, but that only affects the opening text, and his name reads as \n[3].I want to have him as a boss, but I'm also trying to let the player name all the heroes. What can I do to make the boss keep his name?

3_3.png
 
Possibly better solution (less call-script-involving and scaleable for multiple actors, also not needing manual adjustment):

Look for:
Code:
@original_name = enemy.name

Replace with:
Code:
@original_name = enemy.name.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }

After that, you should be able to use the \n[id] in battler names flawlessly (unless anything within the default battle scene/your custom battle script uses not the battler names, but the database names directly, in which case you need to adjust that call as well).


Also... what's with the random character image in your post? O_o
 

PMG

Member

SephirothSpawn":1dn6e1fq said:
Before the battle starts, just use:

$data_enemies[enemy_id].name = $game_actors[actor_id].name


Replace enemy_id with the enemy id value
Replace actor_id with the id of the actor to get the name from

this gives me an error
"NoMethodError occurred while running script.

undefined method 'name' for [1]:array"

wrong.png



BlueScope":1dn6e1fq said:
Possibly better solution (less call-script-involving and scaleable for multiple actors, also not needing manual adjustment):

Look for:
Code:
@original_name = enemy.name

Replace with:
Code:
@original_name = enemy.name.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }

After that, you should be able to use the \n[id] in battler names flawlessly (unless anything within the default battle scene/your custom battle script uses not the battler names, but the database names directly, in which case you need to adjust that call as well).


Also... what's with the random character image in your post? O_o

where do I look? does anything need doing to the replacement code?
 
@PMG: As for my suggestion, I think you need to look within Game_Battler, however, I'm not completely sure of that. Either way, you have to find some place where the battler's name is defined, and change the line in the way I suggested (basically, I merged it with the message's name replacement string).
And no, when you changed the line accordingly, you're perfectly set up script-wise. What the code does, however, is enabling the \n tags from messages for battler names, aka you have to name the enemy \n[1] if you want the name to be the first actor's name.

Please note that you either need Seph or my script, not both. Seph's is a tad easier to set up, while mine requires no clutter within the event code.


As far as Seph's script goes, you might get that error because of the line break in the Call Script event. Solve it by writing this instead:
Code:
$data_enemies[32].name =

$game_actors[1].name
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top