Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RESOLVED] Same name

Started by Linko550, August 29, 2009, 08:45:22 PM

0 Members and 1 Guest are viewing this topic.

Linko550

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

dricc

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 .
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :

modern algebra

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.

Linko550

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.