The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: Linko550 on August 29, 2009, 08:45:22 PM

Title: [RESOLVED] Same name
Post by: Linko550 on August 29, 2009, 08:45:22 PM
Hi, I'm terrible with scripting, and don't really understand it, and was also told that I could ask here.

My question is; is it possible for some one to make a script in which I can have 2 characters named at once, after using the "Name Input" event.

Example; the name input even is used, then with this 2 characters are named at the same time, for something such as, the main character is named, and later in the game, his future self comes back in time and meets him. Both of which are playable characters, sharing the same name...

If this is possible, thanks in advance. If not, thanks anyways. :D
Title: Re: [REQUEST] Same name
Post by: dricc on August 31, 2009, 09:46:02 AM
doesn't seem difficult :


class Scene_Name < Scene_Base
alias dricc_terminate terminate

  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    if $game_temp.name_actor_id == 1
        @actor1 = $game_actors[$game_temp.name_actor_id]
        @actor2 = $game_actors[2]
        @actor2.name = @actor1.name
    end
     dricc_terminate
  end
end

change the "1" and "2" , if it is not correct .
you have nothing more to do .
Title: Re: [REQUEST] Same name
Post by: modern algebra on August 31, 2009, 01:51:33 PM
That looks right to me. Good job dricc.

The only thing I would say is that it's a little more elegant not to set $game_actors[2] to an instance variable since it won't be accessed again.

Instead of:


        @actor2 = $game_actors[2]
        @actor2.name = @actor1.name



        $game_actors[2].name = @actor1.name


But obviously that's nothing important. Nice work dricc.
Title: Re: [RESOLVED] Same name
Post by: Linko550 on August 31, 2009, 02:52:28 PM
Thank you, Dricc, and Modern algebra. :D

And thanks for putting in the resolved thing on the first post, Modern Algebra, I was away for the day.