RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RMXP] Duplicate player-inputted name across multiple actors[SOLVED]

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 55
Game Maker
I have a situation where the player gets to choose between two different actors at the beginning of the game ID9 and ID14.  Shortly afterwards the player uses name input processing to decide the name for whichever actor they chose, either 9 or 14.

If the player chooses actor 9 and names it 'Martin' I need a script that will then rename ID14 to 'Martin' or 'Martin's Evil Twin'

If someone can tell me how to find '$actor_id_variable' or whatever it's called then I could probably write the rest of it myself.  I tried looking in Game_actor in the script editor but couldn't figure out what I needed.

Thank you.
« Last Edit: September 11, 2012, 03:45:23 AM by Michus »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Code: [Select]
$game_actors[14].name = $game_actors[9].name + "'s Evil Twin"
Would work for VX and Ace, not sure about XP. I bet it would be very similar.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 55
Game Maker
Unfortunately that gives me an error:

"NoMethodError occured while running the script.

undefined method 'name' for [14]:Array"

All I'm using for the script is:

"$game_actors[9].name = $game_actors[14].name"

with the inverse:

$game_actors[14].name = $game_actors[9].name

for when the other situation is true.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
It's probably because the expression doesn't fit on one line. Change it to:

Code: [Select]
$game_actors[14].name =
  $game_actors[9].name

and it should probably be fine.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
That's a script call too, so call it from the 'Script' command in the event editor when actor 9 is named. Do not put it in the script editor.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 55
Game Maker
Thank you both,

The issue was that the script needed two lines, I didn't understand that the script command split lines like that.

It works 100% now, I am super thrilled.