Advertiser Content

Cony

Empress

Female
Germany
Seen 54 Minutes Ago
Posted 4 Weeks Ago
5 posts
3.5 Years
Hello !

I tried to edit my storage system a bit, but it seems I don't get a few things in the code.. sio I'd love to get some help !

This is the more or less standard code:
#===============================================================================
# PC menus
#===============================================================================
def Kernel.pbGetStorageCreator
  creator=pbStorageCreator
  creator=_INTL("Rafic") if !creator || creator==""
  return creator
end

class StorageSystemPC
  def shouldShow?
    return true
  end

  def name
    if $PokemonGlobal.seenStorageCreator
      return _INTL("{1}'s PC",Kernel.pbGetStorageCreator)
    else
      return _INTL("Someone's PC")
    end
  end

def access
    Kernel.pbMessage(_INTL("\\se[PC access]The Pokémon Storage System was opened."))
    loop do
      command=Kernel.pbShowCommandsWithHelp(nil,
         [_INTL("Organize Boxes"),
         _INTL("Withdraw Pokémon"),
         _INTL("Deposit Pokémon"),
         _INTL("See ya!")],
         [_INTL("Organize the Pokémon in Boxes and in your party."),
         _INTL("Move Pokémon stored in Boxes to your party."),
         _INTL("Store Pokémon in your party in Boxes."),
         _INTL("Return to the previous menu.")],-1
      )
      if command>=0 && command<3
        if command==1   # Withdraw
          if $PokemonStorage.party.length>=6
            Kernel.pbMessage(_INTL("Your party is full!"))
            next
          end
        elsif command==2   # Deposit
          count=0
          for p in $PokemonStorage.party
            count+=1 if p && !p.isEgg? && p.hp>0
          end
          if count<=1
            Kernel.pbMessage(_INTL("Can't deposit the last Pokémon!"))
            next
          end
        end
        pbFadeOutIn(99999){
          scene = PokemonStorageScene.new
          screen = PokemonStorageScreen.new(scene,$PokemonStorage)
          screen.pbStartScreen(command)
        }
      else
        break
      end
    end
  end
end


def pbPokeCenterPC
  Kernel.pbMessage(_INTL("\\se[PC open]{1} booted up the PC.",$Trainer.name))
  loop do
    commands=PokemonPCList.getCommandList
    command=Kernel.pbMessage(_INTL("Which PC should be accessed?"),commands,commands.length)
    break if !PokemonPCList.callCommand(command)
  end
  pbSEPlay("PC close")
end

module PokemonPCList
  @@pclist=[]

  def self.registerPC(pc)
    @@pclist.push(pc)
  end

  def self.getCommandList()
    commands=[]
    for pc in @@pclist
      if pc.shouldShow?
        commands.push(pc.name)
      end
    end
    commands.push(_INTL("Log Off"))
    return commands
  end

  def self.callCommand(cmd)
    if cmd<0 || cmd>=@@pclist.length
      return false
    end
    i=0
    for pc in @@pclist
      if pc.shouldShow?
        if i==cmd
           pc.access()
           return true
        end
        i+=1
      end
    end
    return false
  end
end

PokemonPCList.registerPC(StorageSystemPC.new)
Atm there are these steps to pass until I get to the storage boxes:
-"[1] booted up the PC."
- Choose PC
- "The Pokémon Storage System was opened"
- Choose how to move Pokémon
- Box opened

And I want it like this:
- "Text"
- Box opened (Organize Boxes)

Sounds simple, but I really don't get what to edit to skip those steps..
I don't need a personal PC in the protagonist's room and also no mail storage, just the Pokémon box system opening up immediately when talking to the PC.

Male
Seen 4 Hours Ago
Posted May 8th, 2019
24 posts
3.1 Years
--------------
pbFadeOutIn(99999){
scene = PokemonStorageScene.new
screen = PokemonStorageScreen.new(scene,$PokemonStorage)
screen.pbStartScreen(0)
}
---------

try running that code as a script. I havent tested it but I just copied the last bit of code that actually opens the organize box screen. It should be something with that snippet of code although you might have to do some tinkering with it.
Advertiser Content