Help - Search - Members - Calendar
Full Version: need help with player evolving
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
vincent329
ok so in a game im trying to make i need a little help i cant find any codes or anything to where when my player hits a set lvl it evolves kind of like in pokemon can someone help pleaes
Moonpearl
This could be done through script but since you're new I'm going to offer you a solution which works through events. First reserve two game variables, name them respectively "Actor Level" and "Previous Actor Level", and note down their ID.
Example:
Var [0005] : Actor Level
Var [0006] : Previous Actor Level

Then open the script log and insert a new script in which you'll past the following:
CODE
class Scene_Map
  alias mp_levelup_update update
  def update
    mp_levelup_update
    $game_variables[X] = $game_actor[1].level
  end
end


This piece of code will constantly store the first actor's level in the variable you set as Actor Level (while on the map). As you can guess, you should replace the X with the variable's ID (in my example, 5).

Then create a new common event called Check Level Up. Set it as parallel, triggered by a new switch we'll call Allow Check Level Up. Then put in the following commands:
CODE
Loop
  Condition: if variable Actor Level != (different than) variable Previous Actor Level
    Comment: insert here whatever you want to happen when the first actor levels up
    Set variable Previous Actor Level to variable Actor Level
  End condition
  Wait 1 frame
End loop


This will check each frame whether the actor's level has changed since the last time. If so, then the new level is saved into the variable Previous Actor Level for future comparisons. When the comparison fails, it means the level has changed and thus something happens (e.g. change the actor's name, apperance, stats, skills, whatever). Attention: you will need to turn the switch Allow Check Level Up on at some point in the game (the best if you want it to always be active is to set it on when the game starts and then never touch it again).

Of course you can do that for each actor, but you'll have to set two new variables (Actor #X Level and Previous Actor #X Level) for each,
add a new line for each in the script, changing the variable ID and the actor ID as well, and finally input a condition for each of them into your common event.

Hope this does the trick for you.
vincent329
QUOTE (Moonpearl @ Jun 24 2011, 03:51 AM) *
This could be done through script but since you're new I'm going to offer you a solution which works through events. First reserve two game variables, name them respectively "Actor Level" and "Previous Actor Level", and note down their ID.
Example:
Var [0005] : Actor Level
Var [0006] : Previous Actor Level

Then open the script log and insert a new script in which you'll past the following:
CODE
class Scene_Map
  alias mp_levelup_update update
  def update
    mp_levelup_update
    $game_variables[X] = $game_actor[1].level
  end
end


This piece of code will constantly store the first actor's level in the variable you set as Actor Level (while on the map). As you can guess, you should replace the X with the variable's ID (in my example, 5).

Then create a new common event called Check Level Up. Set it as parallel, triggered by a new switch we'll call Allow Check Level Up. Then put in the following commands:
CODE
Loop
  Condition: if variable Actor Level != (different than) variable Previous Actor Level
    Comment: insert here whatever you want to happen when the first actor levels up
    Set variable Previous Actor Level to variable Actor Level
  End condition
  Wait 1 frame
End loop


This will check each frame whether the actor's level has changed since the last time. If so, then the new level is saved into the variable Previous Actor Level for future comparisons. When the comparison fails, it means the level has changed and thus something happens (e.g. change the actor's name, apperance, stats, skills, whatever). Attention: you will need to turn the switch Allow Check Level Up on at some point in the game (the best if you want it to always be active is to set it on when the game starts and then never touch it again).

Of course you can do that for each actor, but you'll have to set two new variables (Actor #X Level and Previous Actor #X Level) for each,
add a new line for each in the script, changing the variable ID and the actor ID as well, and finally input a condition for each of them into your common event.

Hope this does the trick for you.

ok wait do i make a commen event a new player a new scripte then place the scripte as actor level i dont understand that part the rest i understand pretty easy
Moonpearl
QUOTE (vincent329 @ Jun 24 2011, 02:11 AM) *
ok wait do i make a commen event a new player a new scripte then place the scripte as actor level i dont understand that part the rest i understand pretty easy

I don't understand that part either. sweat.gif

Let me summarize:
1. you choose your variables IDs
2. you open the script log using F11 and create a new entry above Main, which you may name whatever you like, and insert the script there
3. you write your common event

And you're all set.
vincent329
QUOTE (Moonpearl @ Jun 24 2011, 06:13 AM) *
QUOTE (vincent329 @ Jun 24 2011, 02:11 AM) *
ok wait do i make a commen event a new player a new scripte then place the scripte as actor level i dont understand that part the rest i understand pretty easy

I don't understand that part either. sweat.gif

Let me summarize:
1. you choose your variables IDs
2. you open the script log using F11 and create a new entry above Main, which you may name whatever you like, and insert the script there
3. you write your common event

And you're all set.

i think im beon help at this point as far as getting this to work.
keep hitting problem here is the problem text.
SyntaxError occurred while running scripte
Moonpearl
This means you've messed up somewhere while entering the commands. What bothers me is that the message error you got only occurs when you manually insert some script inside events command, which you shouldn't have if you followed my instructions. So my best guess is that we have been misunderstanding each other at some point.

The best you can do is maybe to take screenshots of your inputs, so that I can see if you've entered them properly.
ksblade
Using only events, here is how I do it: First, make a skill. No name, no anything. For every class (monster type) have them learn this skill at the level you want them to evolve. On all of your maps, have a paralell process event with a conditional branch for whether or not actor "X" knows the skill "the one mentioned above". If they do, then show whatever text and image you want, then remove them from the party and put in the next type instead. for the new character, set their starting level to whatever level the other evolves at. In the else part, do the same thing for the next one, then the next, etc. copy and paste this event on every map. put it in a corner or somewhere out of the way. I'll edit this post with an image soon.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.