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.

[Resolved] Merged BlueScope's Name Input and Raziel's Character Select scripts

My question is this: now that a player can choose their own name and choose from a number of actors as their character, how do I get message windows to say the right name?
\n[id] would only help if I knew which actor was chosen. So that doesn't solve my dilemma.
Any and all help is greatly appreciated. Thank you.
 
Almost nothing is impossible, and because I feel honoured that my name is mentioned in your thread title, let me try to solve it...

I suppose you have the character select screen first, and then the name input scene... to get the actor you choose - I suppose it's the first one in your party then, not knowing Raz' script - take a look at the Scene_Name.initialize method:
Code:
def initialize(actor, max_char)
    super(0, 128, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    # (...)
  end
You could do this multiple ways, but which one to use depends on if you want to input any other name further in the game. If so, skip the following paragraph. If that'S the only time you need to name a character, do the following:

Search for the following line:
Code:
@actor = actor
and replace it with
Code:
@actor = $game_party.actors[0] # Sets the first actor in the party to the one to be (re)named

If you need the scene again afterwards, replace the same line as before with this line:
Code:
@actor = $game_switches[[b]1[/b]] ? actor : $game_party.actors[0]
This line sets the actor to be (re)named to the first actor in the party (e.g. the one you select in Raz' scene) or the one you select from the event menu if $game_Switches[1] (the first switch in the list) is already true... that means, activate that switch before you trigger the name scene again and it'll work as usual.
 
Actually, I just noticed Raziel answered my question in his script's topic.
You still could use something like:

$game_variables[1] = $game_party.actors[0].name

Use it in a call script command and then when using the message box use \v[1].

The variable stores the name of the first character in your party.

I'm sorry I didn't check back sooner, but thank you for taking the time to respond to my question! You have a great script, too.
 

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