Scripts, Tutorials & Tools This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Ad Content
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old October 6th, 2018 (3:11 AM). Edited October 6th, 2018 by rekman.
rekman's Avatar
rekman rekman is offline
    Join Date: Jan 2018
    Posts: 20
    Hello everyone!
    Today I will treat an important feature of Pokemon Fan games: EVs of Trainers' Pokémon.
    For those who doesn't know, the formula provided by the standard Essentials engine lacks of flexibility due to the fact that it must be applied to every pokémon and it's not easy to adapt different EV builds based on the specific species. It already exists a script to manually build the EVs of each pokémon. It can be a bit tedious but it provides an useful feature. For those interested, I will link it at the bottom of the post.

    Now I will describe the features of the formula:
    • Applies AUTOMATICALLY to every trainer's pokémon to set EVs (and IVs) based on the Base Stats of the pokémon;
    • The levelcap parameter denotes the level from where all the 510 EVs will be distributed and all IVs will be equal to 31; The use of a quadratic ratio helps to smooth the proportion of the total 510 in the level below levelcap. Note: that levelcap is set at level 50 now, you can change as you prefer, basing your choice on the difficulty curve you desire for your game.
      e.g. Consider a pokémon at level 10 with levelcap=50. Then the total EVs that will be distributed among the stats will be: 510*(10/50)^2=20;
      Other examples:
      level 20 and levelcap=50 -> Total Evs=82
      level 30 and levelcap=50 -> Total Evs=184
      level 40 and levelcap=50 -> Total Evs=326
      level 50 and levelcap=50 -> Total Evs=510
      level 60 and levelcap=50 -> Total Evs=510
      (changing the levelcap we could have:
      level 65 and levelcap=70 -> Total EVs= 440)
    • There is the possibility to have builds with EVs more concentrated in less Stats ( think about a sweeper with most EVs on Attack and Speed). To use this feature, just set to true a game switch XXX and use the number of the switch that you prefer and insert that number in the appropriate spot inside the formula instead of XXX. In the formula the exact place is :if $game_switches[XXX]==true
    • In case your game features EVs greater than 510 ( the standard value of every pokémon series), change the parameter remaining_ev

    Find in PTrainer_NPCTrainers the following code (around line 82, right after pokemon.setNature(poke[TPNATURE]) )
          for i in 0...6
    And replace it with:
    #EV IV Formula by Rekman. Credit Pokémon Winter Memories ONLY if you want. 
    #No credit needed. Enjoy :)
    for i in 0...6
    if $game_switches[XXX]==true    #insert here the number of the switch instead of XXX
            if bs[1]> 2*bs[4]
            elsif bs[4]> 2*bs[1]
            if bs[0]> 2*bs[3]
            else           #elsif bs[3]> 2*bs[0]
    for i in 0...6
    for i in 0...6
            reserve_ev+=pokemon.ev[i] % 4
            pokemon.ev[i]-=pokemon.ev[i] % 4
            if pokemon.ev[i]==4
    So, everything nice, but how does it actually work? Let's see some examples: (results will be proportionated based on level and levelcap, but for sake of simplicity and comparability matters, all of the following example will be at level equal or greater than levelcap, and with the dedicated Switch set to TRUE)
    • Starmie, level 50 or more with levelcap=50: (Special attacker)
      EV: hp=0,atk=0,def=76,speed=182,sp.atk=172,sp.def=80 (IVs= all 31)
    • Excadrill (Physical attacker)
      EV: hp=0,atk=204,def=24,speed=246,sp.atk=0,sp.def=36
    • Salamence (Mixed attacker)
      EV: hp=0,atk=242,def=0,speed=144,sp.atk=124,sp.def=0
    • Shuckle (Defensive)
      EV: hp=16,atk=0,def=252,speed=0,sp.atk=0,sp.def=240
    • Nidoqueen (all stats are similar)
      EV: hp=140,atk=154,def=108,speed=8,sp.atk=8,sp.def=92

    I hope everything is alright, let me know and report potential errors!
    COMPATIBLE WITH 17.2! (can't ensure it works for other versions)
    Thanks to mgriffin and WolfPP for the support :)
    The MANUAL alternative to this script by
    P.S. If someone is enough able with coding, a great idea would be using my formula to set EVs and IVs in case the parameter of DoesntKnowHowToPlay's Script are not specified. (I am not that able ahaha)
    Pokemon Winter Memories ~ Developing..
    Defining trainers' EV through formula:
    Reply With Quote
      #2   Link to this post, but load the entire thread.  
    Old October 6th, 2018 (5:36 AM).
    WolfPP's Avatar
    WolfPP WolfPP is offline
      Join Date: Aug 2018
      Location: Brazil
      Gender: Male
      Nature: Jolly
      Posts: 166
      I've been waiting for this. Thanks for sharing!
      Reply With Quote

      Quick Reply

      Join the conversation!

      Create an account to post a reply in this thread, participate in other discussions, and more!

      Create a PokéCommunity Account
      Ad Content
      Thread Tools

      Posting Rules
      You may not post new threads
      You may not post replies
      You may not post attachments
      You may not edit your posts

      BB code is On
      Smilies are On
      [IMG] code is On
      HTML code is Off

      Forum Jump

      All times are GMT -8. The time now is 5:58 PM.