• 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] How to modify menu options?

220
Posts
14
Years
    • Seen Nov 29, 2021
    For instance, I want the Pokegear to boot straight to the PC. But I can't find where the Pokegear's functions are defined.

    I also want add the option to heal the party to the PC Menu, and would appreciate help with that.
     
    10
    Posts
    7
    Years
  • i dont think it would good healing pokemon in the pc as u c u cant change some things pokemon are healed in pokemon centre only but ill try if i get something about what u want
     
    1,682
    Posts
    8
    Years
    • Seen today
    Here I am to help, since it's more productive than watching Youtube.
    To make the pokegear instead load up the PC, we'll need to go to PScreen_PauseMenu in def pbStartPokemonMenu. (v16.2)
    There are 2 lines you'll be interested in.
    Line 118 is the text of the option, as well as the conditons required to unlock it.
    Code:
    commands[cmdPokegear=commands.length]=_INTL("Pokégear") if $Trainer.pokegear
    And lines 167-168 are what happens when you select that option.
    Code:
    elsif cmdPokegear>=0 && command==cmdPokegear
            pbLoadRpgxpScene(Scene_Pokegear.new)
    If you just want it to be a portable PokeCenter PC, replace it with this:
    Code:
    elsif cmdPokegear>=0 && command==cmdPokegear
            pbPokeCenterPC

    Now to add the option to heal from the PC, that's a bit of extra coding. (Yay!)
    First we need to make a new class that has 3 specific methods as module PokemonPCList checks this.
    Here's a bare-boned BlankPC class that we must fill (The name follows the convetion of TrainerPC and StoragePC.
    Code:
    class BlankPC
      def shouldShow? # This is when should this option be added to the Pokecenter PC list
        return true         # Must be a boolean 
      end
    
      def name # Self explanatory
        return _INTL("Blank") # must be a string
      end
    
      def access # This is a procedure that runs and does what ever you wanted your option to do
        Kernel.pbMessage(_INTL("\\se[accesspc]Beep Boop, I do nothing"))
      end
    end

    You can fill the other two sections however you like, but for def access, it will probably be something like this, which copies a lot from the pokemon center proper.
    Code:
      def access
        Kernel.pbMessage(_INTL("\\se[accesspc]Healing Pokémon"))
        pbHealAll()
        count=$Trainer.pokemonCount
        for i in 1..count
          pbSet(6,i)
          pbSEPlay("ballshake")
          pbWait(16)
        end
        pbMEPlay("Pokemon Healing")
        Kernel.pbMessage(_INTL("Your pokemon are all healed"))
      end

    Finally, you'll need to add in a section, not in a method or class or anything:
    Code:
    PokemonPCList.registerPC(WhateverPC.new)
    For an example of what I'm trying to say, go to the end of PScreen_Storage.
     
    220
    Posts
    14
    Years
    • Seen Nov 29, 2021
    Thanks! I managed to figure out adding the healing option by myself (although registering it tripped me up), but pbStartPokemonMenu was eluding me.
     
    Back
    Top