• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Gaining experience outside of battle?

453
Posts
10
Years
    • Seen Apr 17, 2024
    Hello! I searched the forums and I googled, but I couldn't find anything about it.

    I'd like to know what would be the most painless way of implementing Pokemon gaining experience outside of battle, complete with leveling up and learning moves. For example, I want to have exp. gain as a reward from an NPC for clearing a task/quest.

    I've looked around the code and from what I gathered, the experience gain and leveling is strongly tied with the battle scene, and cannot be easily adjusted to achieve this. I could be wrong. Any help would be greatly appreciated.

    Thanks!
     
    56
    Posts
    10
    Years
    • Seen Jun 12, 2018
    Why don't you give rarecandies as reward?

    Or better yet, try modifiying the RareCandy code and create new candies, for example one that give you half the exp and/or another one that doubles it, I don't think it will be too difficult to do.
     

    Worldslayer608

    ಥдಥ
    894
    Posts
    16
    Years
  • Why don't you give rarecandies as reward?

    Or better yet, try modifiying the RareCandy code and create new candies, for example one that give you half the exp and/or another one that doubles it, I don't think it will be too difficult to do.

    EXP outside of a battle will still help players increase effort values.

    Different candies is probably the way I would go with this. I did this a while back and had the candies boost certain stats, but ultimately it came down to still wanting to have better EV stats and leveling through exp to have them remain maxed across the board. I don't really see that being a problem if you do not have a competitive battle structure though (meaning no multiplayer) and your trainers are not too difficult to beat.
     

    thor348

    That's Oak to You
    137
    Posts
    11
    Years
  • Solved

    This is actually quite simple!

    So for the NPC giving the Exp, set up a script with the following:

    Code:
    pbChoosePokemon(1,2,
    proc {|poke|
     !poke.egg? &&
     !(poke.isShadow? rescue false)
    })

    This has the Player choose a Pokémon that can't be an Egg or Shadow Pokémon.

    Then set up a Conditional Branch that is set equal to Variable 0001 or whatever your 'Temp Pokémon Choice' is. (Should be the very first...) Also check the box the says something like "Set handling when conditions don't apply" or something.

    This means that if they cancel the choice scene, you can do something like have the NPC say something and go back to the choice scene. (You can do that with the Labels command...)

    Then, under the 'Else' section, paste this script:

    Code:
    poke=pbGetPokemon(1)
    poke.exp+=[COLOR="Red"]100[/COLOR]
    poke.calcStats

    The red number (100) is the Exp given to the Pokémon chosen by the Player. (It's stored in Variable 1!) Also, Variable 2 has the Pokémon's name so you can have the NPC say something like "Your 'pokémons name here' looks so much happier!" or something like that...

    Hope this helps. Let me know if you want/need a screen shot of the event!
     
    453
    Posts
    10
    Years
    • Seen Apr 17, 2024
    @AlexTCGPro
    Great idea! I've looked at the rare candy code and now I see there's a function that does exactly what I need (pbChangeLevel). I can tweak it so that it gives EVs too, or I can make the NPC give special rare candies that also give EVs. Thank you!

    @ЩѻƦḽᶑʂḽдƴƹƦ™
    Great! I like the idea of having different candies for different EVs. I actually forgot about EVs, so this might be a great way of dealing with them. Thanks!

    @thor348
    Thanks for the detailed answer, it'll come in handy! But, beside gaining raw experience, I need to show the "stats increased" window and the pokemon needs to be able to learn new moves after leveling, so it's a bit more involved. Luckily, I've found the function in the code that does all of these things.
     
    Back
    Top