• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

Form Changing Items

  • 465
    Posts
    8
    Years
    • Seen Jun 17, 2024
    So kinda stuck here, been spending a day trying to work out a multiple form that changes due to an item (like shaymin and hoopa with the gracidea and prison bottle) and it just wont work, i added the multiple form in the multiple form script, added the item in item effects script and the items.pbs and just dunno how to make it work (in the bag its in key items but has no "use" option like the gracidea and prison bottle)

    Anyone care to help me sort this out? or tell me more precisely how to do it than what the fandom wiki did.
     
    update! its now able to be used, it was just a simple spelling mistake. now there is still an issue, it wont change forme at all. i use the item on it and it says no effect if its has more than 0hp or is fainted

    why is this happening? i tested to see if forms work with shaymin and it does and i've used the form change information (in multiple forms script and item effects script) but still nothing
     
    oh that would be the smart thing to do xD

    Pokemon_MultipleForms:
    MultipleForms.register(:ALTARIA,{
    "type1"=>proc{|pokemon|
    next if pokemon.form==0 # Normal Forme
    next if pokemon.form==2 # Mega Evo
    next getID(PBTypes,:DRAGON) # Nimbus Forme
    },
    "type2"=>proc{|pokemon|
    next if pokemon.form==0 # Normal Forme
    next if pokemon.form==2 # Mega Evo
    next getID(PBTypes,:ELECTRIC) # Nimbus Forme
    },
    "getAbilityList"=>proc{|pokemon|
    next if pokemon.form==0 # Normal Forme
    next if pokemon.form==2 # Mega Evo
    next [[getID(PBAbilities,:LIGHTNINGROD),0]] # Nimbus Forme
    },
    "height"=>proc{|pokemon|
    next if pokemon.form==0 # Normal Forme
    next if pokemon.form==2 # Mega Evolution
    next 69 # Nimbus Forme
    },
    "getBaseStats"=>proc{|pokemon|
    next if pokemon.form==0 # Normal Forme
    next if pokemon.form==2 # Mega Evo
    next [100,103,75,127,120,75] # Sky Forme
    }
    })

    PItem_ItemEffects:
    ItemHandlers::UseOnPokemon.add(:NIMBUSRING,proc{|item,pokemon,scene|
    if isConst?(pokemon.species,PBSpecies,:AlTARIA)
    if pokemon.hp>0
    pokemon.form=(pokemon.form==0) ? 1 : 0
    scene.pbRefresh
    scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
    next true
    else
    scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
    end
    else
    scene.pbDisplay(_INTL("It had no effect."))
    next false
    end
    })

    here's the two bits of code I've added so far
     
    omg i thank you for making me post this as the different font made me see the error!
    its right here
    if isConst?(pokemon.species,PBSpecies,:AlTARIA)
    its AlTARIA here, not ALTARIA. i changed it and it worked :D
     
    well seems it likes breaking, it changes form (as in sprite wise) but keeps its original typing, ability and stats
     
    since there are no replies since yesterday, could it be (with my example) its altaria as it has a mega? see the mega is always defined as form 1 for some reason even if i change the values and the different form is meant to be 2 but as it ma not check the mega script it makes itself 1 as well even though the item makes it 2?

    Would really love some help as nowhere on the internet i can find a fix for this
     
    I think, and I stress that this is a guess, that this is the culprit line:
    Code:
    pokemon.form=(pokemon.form==0) ? 1 : 0
    If I'm right you're checking if the form is its base (0), and then if it is (1), setting it to its base form (0).
    Try playing around with it.
     
    ahhh i see well checking now, i've got it as just:
    pokemon.form=2

    not what is was before but it still breaks, the only way to fix this is making the form a mega it seems (Tested and that works)

    so i can just have that if thats the only way of having it
     
    im confused too, i thought that but it just wont get the new ability, stats and typing :/
     
    I think, and I stress that this is a guess, that this is the culprit line:
    Code:
    pokemon.form=(pokemon.form==0) ? 1 : 0
    If I'm right you're checking if the form is its base (0), and then if it is (1), setting it to its base form (0).
    Try playing around with it.
    What that code does is as follows:

    Code:
    x=(y==z) ? 1 : 0
    Translation: if y is equal to z, set x to 1 otherwise set x to 0.
     
    To follow up on the translation of x=(y==z) ? 1 : 0, you can and will, depending on who made the script, see it in this fashion down below.
    Code:
    if y == z
      x = 1
    else
      x = 0
    end
    And the problem is that you're defining the second alternate form for your Pokémon in Multiple_Forms, because you're saying "if pokemon.form == 2". Where's 1? I assume this will fix your problem.
     
    Back
    Top