[Solved]Variable to Character Name

taco_god

Villager
Member
Joined
Feb 10, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Hello community.


Just got back into the game making mind set and I'm working with RPG Maker MV now have upgraded from RPG Maker VC/Ace/XP. It's interesting seeing the maker using JS plugins instead of Ruby scripts. For the game I'm working on now, I'm stuck at changing a game characters name to the value of a game variable. The plugin I'm using to set the variable first is, Darkkitten's plugin CmdInp.


This works great for setting a Variable to text, but now I want that text to be used as a character name. I tried doing a script of "$gameActors.actor(1).setName(n, $gameVariables(2))" , "$gameVariables(2) = $gameActors.actor(1)", and a few other ways with no success. What script formula would I need to use to get it so that "Variable(2) becomes Actors(1)'s name". Thanks in advance for any advice, or guidance.
 
Last edited by a moderator:

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
969
Reaction score
807
First Language
English
Primarily Uses
N/A
By setting "a game characters name to the value of a game variable" would the game character end up being named "1" or "42" or something? In that case, it may not work because the integer might need to be converted to a string first.
 

taco_god

Villager
Member
Joined
Feb 10, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
With Darkkitten's plugin it allows for a game variable to be set to a sting and not a number so gameVariable(2) can be "Thomas" and not "42". I can then just call the variable back later in a textbox \v[2] and it returns "Thomas" with no problems.
 

Corrupted Ralph

The World Breaker
Veteran
Joined
May 24, 2015
Messages
197
Reaction score
51
First Language
English
Primarily Uses
With Darkkitten's plugin it allows for a game variable to be set to a sting and not a number so gameVariable(2) can be "Thomas" and not "42". I can then just call the variable back later in a textbox \v[2] and it returns "Thomas" with no problems.
You don't need the plugin to do that. Just do set variable ## to:


Script = "Text"
 
Last edited by a moderator:

taco_god

Villager
Member
Joined
Feb 10, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
What my end goal is I'm making a character select system where the player chooses Male, or Female, then from there they can choose one of eleven classes to be with a different Face, Sprite, and Battler depending on the sex and class they choose. I've made a different character to reflect all twenty-two options (eleven male, eleven female) and that's how they choose what their character looks like. So as it is the questions that are asked of the player before they ask are in this order, " Are you male, or female?" "What is your name?" "What class would you like to be?"


Now granted I can swap the second and third question but in my head they doesn't make sense. So I'm using Darkkitten's CmdInp plugin to handle making a call window for the player to input the name they want their character to be that is outside of the default "Name Input Process" as the "character" that will be named will be determined after question three (What class would you like to be?).  So to have the name stored to a variable and then applied to the chosen character is what I'm looking for.


Example:

KEY - "What the player sees.  Pre-player interaction. Player interaction. Post Player Interaction. "


"Are you male or female? (Multi-choice pops up with Male/Female options. Player selects Female)


Female

  • (Game jumps to the conditional branch for the Female selection after turning switch[3] on to signal the gender of Female has been selected)

What is your name? (CmdInp pops up text input screen simular to Name Input screen. Player inputs "name".)


DOTCreeper

  • (Game stores DOTCreeper as variable[2])

What is your class DOTCreeper? (Game has pulled the name from variable[2] and processes Soulpour777's Character_Select.js plugin pulling up the eleven characters to choose from for Female. Player chooses Spellthief.)


Spellthief

  • (Game sets actor[39] as party leader then applies variable[2] to the Name of actor[39])



I know there was a way to set the player's name to that of the string value of a variable in RMVX/Ace and I think XP too. But can't figure out the way to do it in RMMV.
 

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
677
Reaction score
271
First Language
English
Primarily Uses
RMMV
Couldn't the text code for calling a name work?


\n[x]


x = actor id
 

taco_god

Villager
Member
Joined
Feb 10, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
I'm not using the same Name Processor as your would normally so that won't work.
 

Raystorm7

Villager
Member
Joined
Aug 14, 2014
Messages
29
Reaction score
0
First Language
Italian,English
Primarily Uses
Hi, @taco_god, i've solved with this code:


$gameActors.actor(3).setName($gameVariables.value(5))


Hope it helps :)
 

taco_god

Villager
Member
Joined
Feb 10, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
There we go, that solved it. Thank you Raystorm7. :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top