• 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.

[Scripting Question] Different Pokemon forms based on natures

4
Posts
6
Years
    • Seen Jan 14, 2019
    Is it possible to set a Pokemon's form based on it's nature (or vice versa set its nature based on its form) for wild pokemon

    For example, say I had 3 different forms for a Pokemon and wanted all natures that buff attack or special attack (Lonely, Brave, Adamant etc) to use form 0.
    All natures that buff defense or special defense (Bold, Relaxed, Lax etc) to use form 1.
    And all forms that buff speed or are neutral natures (Timid, Hasty, Serious etc) to use form 2.

    I know I can change their base stats based on form but that's not what I'm after.

    (if this is possible, is there also a way to make it work for a pokemon like shellos and have 6 forms, 3 for the natures of east and 3 for the natures of west.)
     
    Last edited:
    277
    Posts
    15
    Years
  • Something like this should work, though I haven't tested it yet.
    Code:
    [s]MultipleForms.register(:POKEMON-HERE,{
    "getFormOnCreation"=>proc{|pokemon|
       if naturename==PBNatures::BOLD || naturename==PBNatures::RELAXED || naturename==PBNatures::LAX
         next 1
       elsif naturename==PBNatures::TIMID || naturename==PBNatures::FASTY || 
         naturename==PBNatures::SERIOUS
         next 2
       else
         next 0
       end
    }
    })
    [/s]
    for a pokemon like Shellos it would look something like this
    Code:
    [s]MultipleForms.register(:SHELLOS,{
    "getFormOnCreation"=>proc{|pokemon|
       maps=[2,5,39,41,44,69] 
       if $game_map && maps.include?($game_map.map_id)
         if naturename==PBNatures::BOLD || naturename==PBNatures::RELAXED || naturename==PBNatures::LAX
         next 4
       elsif naturename==PBNatures::TIMID || naturename==PBNatures::FASTY || 
         naturename==PBNatures::SERIOUS
         next 5
       else
         next 3
       end
     else
        if naturename==PBNatures::BOLD || naturename==PBNatures::RELAXED || naturename==PBNatures::LAX
         next 1
       elsif naturename==PBNatures::TIMID || naturename==PBNatures::FASTY || 
         naturename==PBNatures::SERIOUS
         next 2
       else
         next 0
       end
       end
    }
    })
    [/s]

    again completely untested so you might get errors, I will review it more tomorrow. Hope it helps =D

    Note: if a pokemon is none of the listed natures it will default to form 0 or in shellos case form 0 or 3 depending on the map it was created on.

    Edit: after some testing I could only a pokemon to appear in form 1, you may need to check the pokemon if self.nature but I am not sure how to go about that. sorry >.<
     
    Last edited:
    4
    Posts
    6
    Years
    • Seen Jan 14, 2019
    Thanks for the help GT-Baka, helped me to figure it out, just had to find out the correct scripting, I'll post it here if anyone out there is curious:
    Code:
    MultipleForms.register(:RATTATA,{
    "getFormOnCreation"=>proc{|pokemon|
    if pokemon.nature==PBNatures::MODEST || pokemon.nature==PBNatures::MILD || 
    pokemon.nature==PBNatures::QUIET || pokemon.nature==PBNatures::BASHFUL || 
    pokemon.nature==PBNatures::RASH
    next 1
    elsif pokemon.nature==PBNatures::HARDY || pokemon.nature==PBNatures::LONELY || 
    pokemon.nature==PBNatures::BRAVE || pokemon.nature==PBNatures::ADAMANT || 
    pokemon.nature==PBNatures::NAUGHTY
    next 2
    elsif pokemon.nature==PBNatures::CALM || pokemon.nature==PBNatures::GENTLE || 
    pokemon.nature==PBNatures::SASSY || pokemon.nature==PBNatures::CAREFUL || 
    pokemon.nature==PBNatures::QUIRKY
    next 3
    elsif pokemon.nature==PBNatures::TIMID || pokemon.nature==PBNatures::HASTY || 
    pokemon.nature==PBNatures::SERIOUS || pokemon.nature==PBNatures::JOLLY || 
    pokemon.nature==PBNatures::NAIVE
    next 4
    else
    next 0
    end
    }
    })
    It means instead of seeing the same sprite all the time, it adds a bit of variety, of course assuming you have the graphics for the other sprites too. It works on wild encounters, still have to test it on trainers.
     
    4
    Posts
    6
    Years
    • Seen Jan 14, 2019
    Although it worked, I have a new question. Is there a cleaner way to do this for Pokemon who already have multiple forms without restating all the above again.

    For example say basculin which is a coin flip between two forms, is there a way to state the above forms 0-4 based on nature like above, and then a random coin flip, and if r=1 it adds 5 to the form (to make 5-9, and therefore keeping the correct nature form too?)

    I ask this because some pokemon have a lot of forms already and it would get pretty cluttered to state everything multiple times for each already existing form.
    I hope that all made sense...
     

    Poq

    144
    Posts
    6
    Years
    • Seen Aug 28, 2021
    Although it worked, I have a new question. Is there a cleaner way to do this for Pokemon who already have multiple forms without restating all the above again.

    You could define a method for each of the groupings of natures you want to check and then just use those methods for each pokémon you want to set forms for in this way. There's still some repetition but not nearly as much.
     
    Back
    Top