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.

Name Changing (RESOLVED)

I know this has already been covered, somewhere, but I'm having a difficult time using the forum Search. I apologize again since I'm sure I'm probably the hundredth person to ask this, but,

"How can I give players the option to change an Actor's name (e.i., name a character whatever they want). Is there a script for this?"

I'm sure there is, but I've looked and can't seem to find it.

SubQuestion: My game quickly disposes Actor 1 and introduces a new Actor to be the "leader" based on what class the player wishes to be (a sloppy way to allow class choice for the "main character", and by class I mean class as in Fighter, Rogue, Mage, etc). When I set an event to allow a name change with this script (whatever it is), is there a way to change all 3 Actors (the "potential" leaders) to this same name, or do I have to redo it for each potential character.

Sorry if this sounds stupid. I'm still learning Ruby.

Basically the game starts with a dumby character (a baby) that picks one of three potential "grown up" versions. The events are scripted so that after a dialog with one of them and a confirmation by the player, you "fast forward" to being that character (the chosen class is added to the party and the baby is instantly dumped, making the chosen class the new party leader, e.i. your class). I have an event soon after that asks what your name is, and can't figure out how to let players do that (spell out and pick their own names).

My sub question was just a way to make sure that no matter which Actor the leader was (no matter what class the baby chose) the name chosen applies to all 3 possibilities. It might not be necessary to do this (depending on the name-changing code, as in if it only pertained to the relevant actor and not an actor specified in the code), but I was just trying to cover all my bases.

Again, I apologize for the mish-mashed wording of this request. If I could actually see a "name-changer" code I could probably make more sense.

I know it's out there and old, I see it all the time in peoples' projects, but for the life of me I can't seem to get a shred of traction from any Search. I feel very dumb for this.
 
I'm afraid that you may not like the answer.

Uh...

Event processing. Third page. Left column. Third command down. "Name Input Processing" lets you pick a character's name, no script required.

Moreover, the other commands in this column include Change Actor Name (which you shouldn't need), Change Actor Class, and Change Actor Graphic.

Or, to put it another way, you don't need a script for any of this. Or all of those other actors.

All that you need to do is use Name Input Processing to pick a name, Change Actor Class to pick a class, and Change Actor Graphic to reflect that class, if you feel that it is necessary.
 

Fusty

Sponsor

Event processing. Third page. Left column. Third command down. "Name Input Processing" lets you pick a character's name, no script required.

And to show the actors name type this in the message window: \n[001] the number is the ID of the actor in the database.
To show the names of other actors use their ID's.
 
Unka Josh":1d9svkzp said:
I'm afraid that you may not like the answer.
Event processing. Third page. Left column. Third command down. "Name Input Processing" lets you pick a character's name, no script required.

Hurray! My first glaring oversight as a n00b! I look forward to many more such learning experiences. Thanks.

Dunno how I missed that.

Commodore Whynot":1d9svkzp said:
For the second part, do "call script" then do:

Code:
$game_party.actors[0].name = $data_actors[1].name

and thanks for that too.
 
Commodore's code is simple, yet I'm not sure how to use the arrays. I keep getting errors that crash the game.

I need Actors 2,3, and 4 to have the same name as Actor 1 after the Name Change Processing script.

Even though the Name Change Processing function goes through, Commodore's script just makes the Actor's name whatever the original Actor's name it points at was (for instance, even though Actor 1 had his name changed via Name Change Processing, the script he gave turns whatever Actor it's pointed at to Actor 1's original name, which I'm trying to overwrite).
 
Name Input Processing doesn't affect data files, which is why Wyatt's code changes back to the original name. Try this code instead:
Code:
$game_actors[2].name = $game_actors[1].name

And you can do the same for actors 3 and 4.
 
Again, thanks.

I originally tried something like this and got an error, so I dismissed it early, but it was my fault for not being careful with how the tiny Script window handles line returns and word wrapping (I can't understand why they built the in-Event Script editor that way; it's really punishing).

Anyway, everything works fine. Thanks to everyone.
 

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