Name Problem

http://i.imgur.com/SkOcn2P.png

Can you fix the name part? That is all I'm asking for...
Fix what part? I'm not sure what you're asking about.

If the problem is that you name the actor ''Micheal'' but then can end up adding actor ''Mary'' when picking girl and not having your name changed, just reverse the choice. If the player picks girl, name ''Mary'' instead of ''Micheal''.
the "n" in text codes is the placeholder for a number - in the case of /N[n], the ID number of an actor in the database. That's why the help for that code says "Name of the nth actor in the database" - it can be the 1st, 2nd, 3th, 4th, 5th... actor depending on the number you replace n with, but n itself will never work.


I suggest that you work through the basic tutorials (perhaps by following the link in my signature) to learn how the commands are used, it will speed up your work a lot and prevent you from spending hours on misunderstanding how the commands work-
Since you are allowing the character a name creation, you kind of have to have that character force restricted to a single ID number.

Here is what I would do:

- Restrict the character that has player choices to a single ID number, lets call it 1.

- During choice phase, use "Change Actor Graphic" command to change Actor 1's Face and Spritesheet instead of changing actor ID.  This will allow \N[1] to pull the player chosen name.

- Use the script snippet below, which allows you to draw the player chosen face in the text box by using the \F[1] command at the start of the text box and leaving the face part as "None".

Now you can pull player chosen faces and names with simple \ functions in your text box while bypassing all of the hooey.  Script by Shaz.

Place anywhere between Materials and Main

# Show Actor Face (by Shaz)

class Window_Base < Window

  alias shaz_ffa_convert_escape_characters convert_escape_characters

  def convert_escape_characters(text)

    result = shaz_ffa_convert_escape_characters(text)

    result.gsub!(/\eF\[(\d+)\]/i) {

      $game_message.face_name = $game_actors[$1.to_i].face_name

      $game_message.face_index = $game_actors[$1.to_i].face_index

      ''

    }

    result

  end

end
http://i.imgur.com/O7UiKJS.png

Well I tried that now Shaz... It doesn't work.
Use the lowercase "n" for Name, and the Uppercase "F" for Face on the \ commands.
what exactly doesn't work?


We can't see what happens on your screen, you have to tell us what works and what doesn't.
The name won't pop up... 😛
It's still overly complicated, just use this + the script snippet that Optimum posted.

uWCLTQz.png
Actually you would want to put \P[1]

You all weren't understanding what he was asking for

He wanted the NPC to say the players name.

For a fix just set up your event like this:

U162T2p.png
You all weren't understanding what he was asking for

He wanted the NPC to say the players name.
I'm completely aware what he was asking for. Optimum and I were showing the easiest way to do so. Having switches, multiple actors and conditional branches is completely unnecessary.
Actually completely necessary if you want to the to have more functionality,

The way you gave there is no way to tell the player's gender in the future without switches:

Also, what if he wanted to give girl's different stats than boys?
You can assign different stats via different classes, which is easier to manipulate than different actor ID's across the board.

He wanted a way to display the name without having to conditionally branch each choice.  I gave him that, and the follow up, which is also displaying selected faces in a text box.  Everything after that is conjecture, and we can't waste our time anticipating the needs of people we don't know.  It's simply impossible.

If he wants NPCs to react differently to a character due to gender, there are no easy tricks.  It's either conditional branches or scripts from this point, and I've learned long ago that it's better not to overstep.
He wanted a way to display the name without having to conditionally branch each choice.
I think he just wants to display the player name, if they choose boy or girl, he did not ask for all that,

He wanted someone to fix his "\n[n]" problem

Also by, not using switches or conditionals you are setting up easily avoidable limitations.
http://i.imgur.com/O7UiKJS.png

Well I tried that now Shaz... It doesn't work.
Just an intuition. Just a thought since nothing of all the above worked.

Try  \N[2]

You probably got a blank named hero in slot 1 in the database.

Michael is the second hero in the database right? 002 correct?

Go to the database. What is the ID of Michael?

The command \N[i] means "show the name of the hero in database that has ID equal to  i ".
I actually solved the problem after my second post... I was asleep. 🙁 Lock the topic. You guys are all 100% correct. 😀
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/name-problem.41307/