Preset Character Names if the Input Screen is Left Blank

Pittoo

Certifiable Nerd
Member
Joined
Sep 17, 2017
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
Okay, so, I'm wanting to allow a name character screen, but if the player doesn't name the character, then a default name will appear.

An example of this I can think of is the Pokémon games and how, if the name field is left empty, the game will then choose from a list of presets per gender such as Red, Fire, or Ash for the male and Leaf or Green for the female.

I can't seem to figure out how to code this, exactly... Can someone explain how to code this, please?
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
338
Reaction score
200
First Language
Portuguese
Primarily Uses
RMVXA
I think you can make that work with conditions.

Set a condition where it checks if the actor has a blank name - do that for how many spaces you can set in the name input. For example, if you set that the character can have a name up to 6 letters, put the names in the condition boxes as " ", " " and so on.

Then you can set a random variable to pick a random name to the character.

Something like this:



Unfortunately I don't have XP, so I don't know if it can work like this.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,253
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
add your preset names into an array:
Code:
ary = ["name", "name", "name", "name", "name"]
then, pick a random number, based on the array's own length, and return the result, and use *it* to have *the array* pick the name.
Code:
rnd = rand(ary.length)
name = ary[rnd]
you can also save the name to a global variable and use the editor commands to pass it to the character.
Code:
$game_variables[ID] = ary[rnd]
you can fit all that into one single script block.
if you need to operate between script and condition blocks, set the variables to global
Code:
@ary = [ ]
@rnd = rand(@ary.length)
so they can be accessed outside of the script block, by the editor
 

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

Latest Threads

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,189
Members
137,771
Latest member
evoque
Top