How to Store player name in a script variable?

xChikyx

Regular
Regular
Joined
Aug 7, 2019
Messages
43
Reaction score
12
First Language
English
Primarily Uses
RMXP
What i'm trying to do is really symple but i can't make it work...
Basically, i want to store the player's name in a variable.
I'm using:

name = $game_actor(1).name

but it gives me an error. I don't know how to call the right $game_actor thing to make it work... Can someone help me please? thank you
 

Spaske

Regular
Regular
Joined
Nov 6, 2021
Messages
276
Reaction score
144
First Language
German
Primarily Uses
RMMZ
What i'm trying to do is really symple but i can't make it work...
Basically, i want to store the player's name in a variable.
I'm using:

name = $game_actor(1).name

but it gives me an error. I don't know how to call the right $game_actor thing to make it work... Can someone help me please? thank you
Did you try " control variable - script - $game_actors[1].name ? "
 

Spaske

Regular
Regular
Joined
Nov 6, 2021
Messages
276
Reaction score
144
First Language
German
Primarily Uses
RMMZ
Oh, you go to control variable and chose a variable, and as operand you make the script call from above. It should look something like this: 1641177963080.png

I got no rpg maker XP so i cant really test it. oh and btw, dont use the skript command from my picture since its for MZ and not xp, try using this one:
$game_actors[1].name (but im not sure if this is for xp)
 

xChikyx

Regular
Regular
Joined
Aug 7, 2019
Messages
43
Reaction score
12
First Language
English
Primarily Uses
RMXP
Oh, you go to control variable and chose a variable, and as operand you make the script call from above. It should look something like this: View attachment 211537

I got no rpg maker XP so i cant really test it. oh and btw, dont use the skript command from my picture since its for MZ and not xp, try using this one:
$game_actors[1].name
mmmm rmxp doesnt have that to add an script option... and the options don't include the name, i suppose because they are just for numbers...
 

Spaske

Regular
Regular
Joined
Nov 6, 2021
Messages
276
Reaction score
144
First Language
German
Primarily Uses
RMMZ
mmmm rmxp doesnt have that to add an script option... and the options don't include the name, i suppose because they are just for numbers...
Oh ok, its over 15 years since i used the xp, asumed it got such options.
Then your only bet is for someone to make you a script or so, even if there was an option with the xp maker, i wouldnt know. sry

What for do you need it anyway, maybe there is another way to achieve the same result???
 

xChikyx

Regular
Regular
Joined
Aug 7, 2019
Messages
43
Reaction score
12
First Language
English
Primarily Uses
RMXP
Oh ok, its over 15 years since i used the xp, asumed it got such options.
Then your only bet is for someone to make you a script or so, even if there was an option with the xp maker, i wouldnt know. sry

What for do you need it anyway, maybe there is another way to achieve the same result???
in summary, I need the game to create a file, and in one of the lines of that file, the encrypted name of the player should be in... I can make everything already, except the part in which i get the name the player inputs and store it in a variable hahaha
 

Spaske

Regular
Regular
Joined
Nov 6, 2021
Messages
276
Reaction score
144
First Language
German
Primarily Uses
RMMZ
Sry i did not get the first part you said, create a file and encrypted name?

But another way to store names (not as variable) would be to make a dummy character and just rename him / her, that way the name you want will be stored as the name of that dummy char.
You can show the name in texts via \N[n] command.
 

xChikyx

Regular
Regular
Joined
Aug 7, 2019
Messages
43
Reaction score
12
First Language
English
Primarily Uses
RMXP
Sry i did not get the first part you said, create a file and encrypted name?

But another way to store names (not as variable) would be to make a dummy character and just rename him / her, that way the name you want will be stored as the name of that dummy char.
You can show the name in texts via \N[n] command.
sooo... name = $game_actors[1].name works... I tried it using the same without the "s" and when i tried the "s" i think i used () instead of []

and the thing is that the game creates a file. which is a very complex system of "cheat codes" for the game, and something the game uses to learn about you and your gameplay. 25 or more lines of code that can be changed and the game changes... One of those lines need to be the character name, so when a player starts a new game, if it has the same name as the previous one, it rememebers it was you who played... that's basically the premise
 

Spaske

Regular
Regular
Joined
Nov 6, 2021
Messages
276
Reaction score
144
First Language
German
Primarily Uses
RMMZ
sooo... name = $game_actors[1].name works... I tried it using the same without the "s" and when i tried the "s" i think i used () instead of []

and the thing is that the game creates a file. which is a very complex system of "cheat codes" for the game, and something the game uses to learn about you and your gameplay. 25 or more lines of code that can be changed and the game changes... One of those lines need to be the character name, so when a player starts a new game, if it has the same name as the previous one, it rememebers it was you who played... that's basically the premise
Oh, sounds interesting. ^^
Well, glad it worked in the end.
 

Latest Threads

Latest Profile Posts

Ringing in Halloween Month by watching a new-to-me movie! Yay! 'Tis the season!
Skill Tutor Scene is all but done!


1696133612827.png
HawkZombie wrote on Slaughty's profile.
SLAUGHTY!
I remember hearing some guy playing Warhammer Fantasy Battle and getting his butt kicked by a girl who painted all her dwarves pink. She kept calling them her 'Little Gimli's.
Every JRPG needs a mandatory cliff scene.

Forum statistics

Threads
134,954
Messages
1,252,315
Members
177,808
Latest member
BREAKOUTHILL999
Top