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 Input Script, effects more than one actor

Necrus

Member

Hello, I am looking for a script that when the player inputs a name for his/her character, it will change the name of several other actors to the same inputted name

See, in the project I am working on, the player wil allowed to change his or her class, however in order to have the player's stats change to match that class (since they won't change on their own) I made 7 other actors that use the same sprite and animations as the orginal actor, giving the lluison that the player is playing the same person but in another class with different stats that fit the class. I also did this so their level can be 'saved' so when they switch back to one of their previous classes, they will resume the level they left off at

However, when the player changes or sets the name for the current class he or she has, the other actor's name won't change with it, forcing the player to re-name him or herself everytime they select a class never before used...

I want to make it so when the player inputs the name for the first time, it changes the name of the other actors to the same
 
You dont need a seperate script you can use the built in scriptcall to change their name;

Put this code in the event after the player has selected their name and it will change then name of the other party memebers remember dont put the last line of code if you only have 4 actors

$game_actors[2].name = $game_actors[1].name
$game_actors[3].name = $game_actors[1].name
$game_actors[4].name = $game_actors[1].name
$game_actors[5].name = $game_actors[1].name
 

Necrus

Member

Darksector26":341w5psd said:
You dont need a seperate script you can use the built in scriptcall to change their name;

Put this code in the event after the player has selected their name and it will change then name of the other party memebers remember dont put the last line of code if you only have 4 actors

$game_actors[2].name = $game_actors[1].name
$game_actors[3].name = $game_actors[1].name
$game_actors[4].name = $game_actors[1].name
$game_actors[5].name = $game_actors[1].name

Ah, thank you, I knew it seemed too simple to need a script, I'll give that a try
I'm pretty new with this Ruby langauge, seems easy enough, I just need to study more

Edit: it works, thanks again
 

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