How can I record players exp?

Discussion in 'RPG Maker VX Ace' started by Ech0es, Apr 23, 2014.

Thread Status:
Not open for further replies.
    Tags:
  1. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    What I want to do is record all the experience gained by a player gained from battles, then transfer that experience gained to a different actor after several battles. How do I set up the variable for this? Any help is appreciated, thanks!
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    27,083
    Likes Received:
    5,937
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    control variables - game data - actor - exp


    This stores the current EXP into a variable, compare it before and after battle to get the difference.
     
    #2
  3. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    Thanks. I just don't know how to set it up. Player1 is level 20, but goes through a few battles and gains exp. I want to only record the exp gained from battles. So how can I record only the exp gained in battles and transfer it to Player2 (who is only level 1)?  I don't want to record all the exp from Player1 making player2 level 20+.
     
    #3
  4. Andar

    Andar Veteran Veteran

    Messages:
    27,083
    Likes Received:
    5,937
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    you'll need three variables to check everything, and it depends on how your game's experience is given.


    Does the actor get XP from events and from battles, and you want only the events from the battles be recorded?


    If that is the case, AND you can event the specific cases where he gets non-battle-XP, then the best way would be to set it up with negatives:


    1) Record the XP of the actor when the effects start in a variable - this is the number that will have to be substracted from the final value.


    2) Every event that give non-battle-XP, add that XP not only to the actor, but also to the variable defined in 1)


    3) when the new actor is supposed to get that XP, then define a second variable with the actor's current XP (NOT the same variable as the first)


    4) substract the value of the first variable from the second variable - the remaining difference should be the battle XP, unless there is some other event-XP that you have forgotten to check.


    If your game has more complex handling, or if you can't change the existing non-battle-XP-events, then you'll need a more tricky approach with a parallel common event, one troop event per troop in the database and three variables plus one switch, that only records the real battle-XP.


    If that's the case, give a bit more info how your battles work and I'll try to describe that.
     
    #4
  5. Kes

    Kes Global Moderators Global Mod

    Messages:
    19,162
    Likes Received:
    9,823
    First Language:
    English
    Primarily Uses:
    RMVXA
    Err, maybe this is too simple, but why not bring the new character in at, say, level 8 or level 10 or whatever, and so avoid having to do this complicated process?
     
    #5
  6. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    There is no exp gained from any events. The only exp gained at this point in the game is from battles. I read your post but still uncertain how I would go about setting it, meaning, where do I put the certain variables at, how do I make the exp transfer to the other player, etc. Do I put a variable in each battle troop to record the exp gained in that session?

    ksjp17, thanks, that would be the easier solution, but I want the player to be the approiate level from the amount of exp gained.
     
    #6
  7. Kes

    Kes Global Moderators Global Mod

    Messages:
    19,162
    Likes Received:
    9,823
    First Language:
    English
    Primarily Uses:
    RMVXA
    Then why not grab the actual level of actor one at the time actor two joins, make any adjustment you think appropriate, and go with that? Actor one's level will, by definition, be a reflection of exp gained, so it meets your criterion.
     
    #7
  8. Dark_Metamorphosis

    Dark_Metamorphosis What a horrible night to have a curse. Veteran

    Messages:
    2,194
    Likes Received:
    382
    Location:
    Sweden
    First Language:
    Swedish
    Hopefully I can try and help you with this because I use the same process in my own game.

    First off make a variable for each actor's exp value, Example: [variable 20: Actor1 exp value] and make sure that you choose 'set' -> go down to Game data -> Pick actor and select Actor 1's EXP.

    You will then have a variable that looks like this: [Variable 20: Actor 1 exp value] = [Actor 1]'s EXP

    Now choose the new actor (let's call it Actor 2) and select the 'change exp' command.

    Put actor 2 inside the fixed Actor and set it to increase -> And then in the operand, choose the variable that we created above.

    Now the exp value that is stored for Actor 1 will be transfered to the new actor and give her the exact same value. You can do this for any of the actors.

    Hope this is what you wanted :)

    Edit: Nevermind I should have read the previous posts, I'm sorry.
     
    Last edited by a moderator: Apr 24, 2014
    #8
  9. Andar

    Andar Veteran Veteran

    Messages:
    27,083
    Likes Received:
    5,937
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Then I assume that you play a while with the L20 actor before the L1 actor joins?
    In this case it's very simple.


    On your starting map, make an autorun event with two pages and two commands on the first page:


    1) control variables: actor1's XP into a new variable (for example 001 since it's your first variable


    2) control self-switch A = ON.


    The second page will have NO command, just the condition self-switch A = ON (left half of the event.


    Then go to the event that adds actor 2. After the command that adds the member at L1, add the following commands:


    1) control variable for a new variable (example 002), actor1's XP (storing the current XP of Actor 1)


    2) control variable 002: substract number stored in variable 001


    3) change EXP for actor 2, add the value stored in variable 002


    Finished


    And I suggest that you work through some tutorials because that are basic commands and functions - perhaps go to the link in my signature as a starter
     
    #9
  10. Mouser

    Mouser Veteran Veteran

    Messages:
    1,246
    Likes Received:
    259
    First Language:
    English
    Ok, you've got me confused.

    If the only exp gained at this point is from battles, then you could just set the new players XP equal to the old players, no? This only becomes problematic if Player 1 (Actor 1, I'm assuming you mean) had gained XP from other means that you don't want included. Let's go with Actor 1 having gained a bunch of XP from events and other stuff (quests, conversations, opening chests, whatever...).

    I can think of at least three or four different ways to do this, each of which has their pros and cons.

    1) The direct approach: Go into into the scripts (gain_exp in BattleManager would be the easiest place) and set up a variable that keeps track of all XP gained in battles.

    The pro to this is it's crisp, clean, and concise.

    The con is you need to go into the scripts to make it work.

    2) The 'negative' approach: The only place the game 'naturally' gives XP is through battles, so if an Actor is getting any more, it's from someplace where you're giving it to him, probably via an event. Create a common event that adds XP gained to an XP counter (this is why they are called 'common' events, by the way - several other events/maps/etc... hold it in common). Every place you give an Actor non-combat XP, call the common event and add the amount to that variable. When the time comes for Actor 2 to start, Actor 1's current XP minus the common event variable will give you the XP Actor 1 gained in battle.

    The pro here is you don't need any scripting.

    The con is you need to find every place you give out XP to be sure it calls the common event.

    3) The 'Why am I doing this, anyway?' approach.  What's your real goal with all of this? If it's just to be sure Actor 2 doesn't start at too high a level, simply look at Actor 1's level and set Actor 2's level equal to the lower of Actor 1's level or the level you've decided as the 'cap'.

    The pro is it's incredibly simple, direct, and probably solves what you're trying to do better than either of the above.

    The con is it doesn't allow the player to 'power-level' Actor 2 by grinding out battles with Actor 1 before she joins.
     
    Last edited by a moderator: Apr 24, 2014
    #10
  11. Andar

    Andar Veteran Veteran

    Messages:
    27,083
    Likes Received:
    5,937
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    No, he can't do that because he doesn't want the actor two have the same level as actor one.
    He has a "mentor" actor that is level 20 with several thousand XP, and a "pupil" actor that will appear later, having zero EXP.


    And when the player has played at the beginning of the game with only the first actor and gained perhaps 2000 XP, going to level 21 with that actor, he wants the actor two only gain those 2000 XP (perhaps going to level 4 or 5), NOT the entire XP from the first actor.


    It is a bit strange as an approach because it will create a lot of balancing problems, but that's what the OP asked - and that's why my solutions are neccessary, because the XP that will give the L20 actor perhaps one or less levels will give an L1 actor several levels, so they can't even check the level difference...
     
    #11
  12. Mouser

    Mouser Veteran Veteran

    Messages:
    1,246
    Likes Received:
    259
    First Language:
    English
    Ok, in that case write down the amount of XP Actor 1 needed to reach level 20 (viewable in the database graph thing) and subtract that from Actor 1's total XP. Assign that amount to Actor 2. It could be done in one line in the event where Actor 2 joins.
     
    Last edited by a moderator: Apr 24, 2014
    #12
  13. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    Thank you! This worked for me. And thank you everyone else for the replies.

    I know it may seem strange but I was vague on how I am using this, there won't be random battles, just planned battles where the exp is being recorded.

    Again, thanks for all the help. This can be locked now.
     
    #13
  14. Andar

    Andar Veteran Veteran

    Messages:
    27,083
    Likes Received:
    5,937
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
     
    #14
Thread Status:
Not open for further replies.

Share This Page