Concatenation of 2 actor names

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
Is it possible using a script line to concatenate 2 character names into a 3rd character?
For instance \n[1] and \n[2] are concatenated to have character 3 named \n[1]+\n[2]
 

ozubon

surströmming?
Veteran
Joined
Oct 16, 2018
Messages
178
Reaction score
168
First Language
English
Primarily Uses
RMMV
Yes!
JavaScript:
$gameActors.actor(3)._name = $gameActors.actor(1).name() + $gameActors.actor(2).name()
But that will be case sensitive, so like, if actor 1 is named Steve and 2 Buscemi actor 3 will be named SteveBuscemi

If you want actor 3 to be named Stevebuscemi use this:
JavaScript:
$gameActors.actor(3)._name = $gameActors.actor(1).name() + $gameActors.actor(2).name().toLowerCase()
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
Thank you, and if I want a space between them?
Steve Buscemi
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
381
Reaction score
356
First Language
german
Primarily Uses
RMMZ
String concatenation is done with +, and with "" you can type any string, so you can concatenate like this

$gameActors.actor(3)._name = $gameActors.actor(1).name() + " " + $gameActors.actor(2).name().toLowerCase()
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
Awesome, one last question, is it possible to show the name of a variable, and to change it?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,709
Reaction score
1,127
First Language
Portuguese - Br
Primarily Uses
RMMZ
@Indinera you can store the name of a variable inside a variable and show with \v[].
To get the name, I think it is $dataVariables[Id] that will return the name of the variable you want.
But I'm not on my computer to double-check.
But change the name of the variable, I don't think so.
 

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,037
Messages
1,018,464
Members
137,821
Latest member
Capterson
Top