Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
[RMXP] Duplicate player-inputted name across multiple actors[SOLVED]
Main Menu

[RMXP] Duplicate player-inputted name across multiple actors[SOLVED]

Started by Michus, September 06, 2012, 05:38:07 PM

0 Members and 1 Guest are viewing this topic.

Michus

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.

pacdiggity

$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

Michus

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.

modern algebra

It's probably because the expression doesn't fit on one line. Change it to:


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


and it should probably be fine.

pacdiggity

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

Michus

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.