• 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 maps with different forms

155
Posts
10
Years
    • Seen Jun 11, 2021
    I'm trying to get certain forms of Pokemon to appear on certain maps, much like Shellos. It seemed easy enough, but I have more than two forms of a Pokemon. I tried to get it to work with the code below, but instead, the regular form of Grimer always shows up on the map:
    Code:
    MultipleForms.register(:GRIMER,{
    "getFormOnCreation"=>proc{|pokemon|
       maps=[[],         # Map IDs for Alola form
             [47,252]]   # Map IDs for Chion form
       for i in 0...maps.length
         if $game_map && maps[i].include?($game_map.map_id)
           next i+1
         end
       end
       next 0
    },
    I'm not sure what I'm doing wrong. Can anyone help me, please?
     
    Last edited by a moderator:
    18
    Posts
    7
    Years
  • I'm trying to get certain forms of Pokemon to appear on certain maps, much like Shellos. It seemed easy enough, but I have more than two forms of a Pokemon. I tried to get it to work with the code below, but instead, the regular form of Grimer always shows up on the map:
    Code:
    MultipleForms.register(:GRIMER,{
    "getFormOnCreation"=>proc{|pokemon|
       maps=[[],         # Map IDs for Alola form
             [47,252]]   # Map IDs for Chion form
       for i in 0...maps.length
         if $game_map && maps[i].include?($game_map.map_id)
           next i+1
         end
       end
       next 0
    },
    I'm not sure what I'm doing wrong. Can anyone help me, please?

    Try this, since it seems that no matter what,next 0 is forcing the grimer to have its form set to 0

    Code:
    MultipleForms.register(:GRIMER,{
    "getFormOnCreation"=>proc{|pokemon|
       maps=[[],         # Map IDs for Alola form
             [47,252]]   # Map IDs for Chion form
       for i in 0...maps.length
         if $game_map && maps[i].include?($game_map.map_id)
           next i+1
         elsif i==maps.length-1 
           next 0
         end
       end
    },
     
    Last edited:
    155
    Posts
    10
    Years
    • Seen Jun 11, 2021
    Gave it a shot. When encountering a Grimer on the map, it just gave me this error and crashed:
    Code:
    Exception: TypeError
    Message: cannot convert Range into Integer
    PSystem_Utilities:1512:in `sprintf'
    PSystem_Utilities:1512:in `pbCryFile'
    PSystem_Utilities:1495:in `pbPlayCry'
    PokeBattle_Scene:2508:in `pbStartBattle'
    *PokeBattle_Battle:2666:in `pbStartBattleCore'
    *PokeBattle_Battle:2633:in `pbStartBattle'
    InverseSkyBattles:49:in `pbWildBattle'
    InverseSkyBattles:48:in `pbSceneStandby'
    InverseSkyBattles:50:in `pbWildBattle'
    InverseSkyBattles:47:in `pbBattleAnimation'
     
    220
    Posts
    13
    Years
    • Seen Nov 29, 2021
    Have you had a look at Shellos?
    Because I never had this problem by c+ping that code and changing the map references.

    Edit: And with a bit of splicing from Bumary or whatever it's called.
     
    Last edited:
    Back
    Top