The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Tenkle on June 05, 2008, 09:51:16 PM

Title: how do I have a character level up whenever another character levels up.
Post by: Tenkle on June 05, 2008, 09:51:16 PM
Could anyone tell me how to have it so when a character levels up another character does also.

For isntance say that I want a character to leave the party and come back later in the game. I would want to have the character at a similar level to the main character. So I would want to set it so when the main character gains a level the other character does too.

I've tried a few things but I cannot get it to work. Does anyone know how to do something like this?
Title: Re: how do I have a character level up whenever another character levels up.
Post by: Fr00bs on June 05, 2008, 09:56:08 PM
Make the character that leaves twice, and guess the starting level, or play through a couple of times until they get to that part and find the levels you need.
Title: Re: how do I have a character level up whenever another character levels up.
Post by: Tsunokiette on June 05, 2008, 11:15:28 PM
Add this method to Game_Actor

  def level=(n)
    @level = n
  end


Then, in the event, have the person join, and add this in the "Script" even function -

a = $game_party.members
$game_party.members[3].level = a[0].level


The first number is the number of the person who just joined.
0 being first slot, 1 being second slot, et cetera.
The second number is the number of the person who has the level you're referencing.
Same stuff as before.

I'm trying to find a way find the average level of a party, but until then this is your best bet. (I keep getting errors because the level isn't based off the integer class. I'm assuming it's a float, but meh, I'll figure it out. [/end programmer talk])

EDIT : Don't forget to heal the person.
Title: Re: how do I have a character level up whenever another character levels up.
Post by: Tenkle on June 06, 2008, 10:10:36 PM
Thank you for the help, Ill give it a try :D
Title: Re: how do I have a character level up whenever another character levels up.
Post by: Tsunokiette on June 09, 2008, 12:31:58 AM
I feel like an idiot. I forget like, 5 letters lol -

a = $game_party.members
a[3].level = a[0].level


Same thing as before. I forgot to add ".level" -_- my bad