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

Simple Dual Screen System

664
Posts
16
Years
  • Try this:

    Code:
    class PokemonMenu_Scene
    def pbShowCommands(commands)
     ret=-1
     cmdwindow=@sprites["cmdwindow"]
     cmdwindow.viewport=Viewport.new(0, 0, 630, 320)
     cmdwindow.index=$PokemonTemp.menuLastChoice
     cmdwindow.resizeToFit(commands)
     cmdwindow.commands=commands
     cmdwindow.x=630-cmdwindow.width
     cmdwindow.y=0
     cmdwindow.visible=true
       loop do
        cmdwindow.update
        Graphics.update
        Input.update
        pbUpdateSceneMap
        if Input.trigger?(Input::B)
         ret=-1
         break
        end
        if Input.trigger?(Input::C)
         ret=cmdwindow.index
         $PokemonTemp.menuLastChoice=ret
         break
        end
       end
     return ret
    end
    
    def pbShowInfo(text)
      @sprites["infowindow"].resizeToFit(text,Graphics.height)
      @sprites["infowindow"].text=text
      @sprites["infowindow"].visible=true
      @infostate=true
    end
    
    def pbShowHelp(text)
      @sprites["helpwindow"].resizeToFit(text,Graphics.height)
      @sprites["helpwindow"].text=text
      @sprites["helpwindow"].visible=true
      @helpstate=true
      pbBottomLeft(@sprites["helpwindow"])
    end
    
    def pbStartScene
     @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
     @viewport.z=99999
     @sprites={}
     @sprites["cmdwindow"]=Window_CommandPokemon.new([])
     @sprites["infowindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
     @sprites["infowindow"].visible=false
     @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
     @sprites["helpwindow"].visible=false
     @sprites["cmdwindow"].visible=false
     @infostate=false
     @helpstate=false
     pbSEPlay("menu")
    end
    
    def pbHideMenu
     @sprites["cmdwindow"].visible=false
     @sprites["infowindow"].visible=false
     @sprites["helpwindow"].visible=false
    end
    
    def pbShowMenu
     @sprites["cmdwindow"].visible=true
     @sprites["infowindow"].visible=@infostate
     @sprites["helpwindow"].visible=@helpstate
    end
    
    def pbEndScene
     pbDisposeSpriteHash(@sprites)
     @viewport.dispose
    end
    
    def pbRefresh
    end
    
    end
    
    
    class PokemonMenu
    
    def initialize(scene)
     @scene=scene
    end
    
    def pbShowMenu
     @scene.pbRefresh
     @scene.pbShowMenu
    end
    
    def pbStartPokemonMenu
      @scene.pbStartScene
      endscene=true
      commands=[]
      cmdPokedex=-1
      cmdPokemon=-1
      cmdBag=-1
      cmdTrainer=-1
      cmdSave=-1
      cmdOption=-1
      cmdPokegear=-1
      cmdDebug=-1
      cmdQuit=-1
      if !$Trainer
       if $DEBUG
        Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
        Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
       end
       return
      end
      commands[cmdPokedex=commands.length]=_INTL("POKéDEX") if $Trainer.pokedex
      commands[cmdPokemon=commands.length]=_INTL("POKéMON") if $Trainer.party.length>0
      commands[cmdBag=commands.length]=_INTL("BAG") if !pbInBugContest?
      commands[cmdPokegear=commands.length]=_INTL("POKéGEAR") if $Trainer.pokegear
      commands[cmdTrainer=commands.length]=$Trainer.name
      if pbInSafari?
       @scene.pbShowInfo(_INTL("STEPS: {1}/600\nBALLS: {2}",pbSafariState.steps,pbSafariState.ballcount))
       commands[cmdQuit=commands.length]=_INTL("QUIT")
      elsif pbInBugContest?
       if pbBugContestState.lastPokemon
         @scene.pbShowInfo(_INTL("CAUGHT: {1}\nLEVEL: {2}\nBALLS: {3}",
              PBSpecies.getName(pbBugContestState.lastPokemon.species),
              pbBugContestState.lastPokemon.level,
              pbBugContestState.ballcount))
       else
         @scene.pbShowInfo(_INTL("CAUGHT: None\nBALLS: {1}",pbBugContestState.ballcount))
       end
       commands[cmdQuit=commands.length]=_INTL("QUIT")
      else
       commands[cmdSave=commands.length]=_INTL("SAVE") if !$game_system || !$game_system.save_disabled
      end
      commands[cmdOption=commands.length]=_INTL("OPTION")
      commands[cmdDebug=commands.length]=_INTL("DEBUG") if $DEBUG
      commands[commands.length]=_INTL("EXIT")
      loop do
       [email protected](commands)
       if cmdPokedex>=0 && command==cmdPokedex
        pbFadeOutIn(99999) {
        scene=PokemonPokedexScene.new
        screen=PokemonPokedex.new(scene)
        screen.pbStartScreen
        @scene.pbRefresh
        }
       elsif cmdPokegear>=0 && command==cmdPokegear
        pbLoadRpgxpScene(Scene_Pokegear.new)
       elsif cmdPokemon>=0 && command==cmdPokemon
         sscene=PokemonScreen_Scene.new
         sscreen=PokemonScreen.new(sscene,$Trainer.party)
         hiddenmove=nil
         pbFadeOutIn(99999) { 
          hiddenmove=sscreen.pbPokemonScreen
          if hiddenmove
           @scene.pbEndScene
          else
           @scene.pbRefresh
          end
         }
        if hiddenmove
         Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
         return
        end
       elsif cmdBag>=0 && command==cmdBag
        item=0
        scene=PokemonBag_Scene.new
        screen=PokemonBagScreen.new(scene,$PokemonBag)
        pbFadeOutIn(99999) { 
          item=screen.pbStartScreen 
          if item>0
           @scene.pbEndScene
          else
           @scene.pbRefresh
          end
        }
        if item>0
         Kernel.pbUseKeyItemInField(item)
         return
        end
       elsif cmdTrainer>=0 && command==cmdTrainer
        PBDebug.logonerr {
         scene=PokemonTrainerCardScene.new
         screen=PokemonTrainerCard.new(scene)
         pbFadeOutIn(99999) { 
          screen.pbStartScreen
          @scene.pbRefresh
         }
        }
       elsif cmdQuit>=0 && command==cmdQuit
         @scene.pbHideMenu
         if pbInSafari?
           if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
            @scene.pbEndScene
            pbSafariState.decision=1
            pbSafariState.pbGoToStart
            return
           else
            pbShowMenu
           end
         else
           if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
            @scene.pbEndScene
            pbBugContestState.pbStartJudging
            return
           else
            pbShowMenu
           end
         end
       elsif cmdSave>=0 && command==cmdSave
         @scene.pbHideMenu
         scene=PokemonSaveScene.new
         screen=PokemonSave.new(scene)
         if screen.pbSaveScreen
          @scene.pbEndScene
          endscene=false
          break
         else
          pbShowMenu
         end
       elsif cmdDebug>=0 && command==cmdDebug
        pbFadeOutIn(99999) { 
         pbDebugMenu
         @scene.pbRefresh
        }
       elsif cmdOption>=0 && command==cmdOption
         scene=PokemonOptionScene.new
         screen=PokemonOption.new(scene)
         pbFadeOutIn(99999) {
          screen.pbStartScreen
          pbUpdateSceneMap
          @scene.pbRefresh
         }
       else
        break
       end
      end
      @scene.pbEndScene if endscene
    end
    end
     

    Pichuichu

    Creator Of (Insert Here)
    271
    Posts
    14
    Years
  • NO

    Didn't Work Um It Ask's Me To Delete EVERY line In Pokemenu

    BIG ERROR :Can't Show You Replaced Script.
    Will Try Again... Video?
     

    Nyu~♥!

    Pokémon Opal Producer
    478
    Posts
    14
    Years
  • That's a Pokemon Essentials error, and unless you edited anything other than the PokemonMenu script it's probably to do with that.

    Basically it's saying that in PBS/Trainers.txt it's expecting a pokemon name somewhere, and you have it blank.

    Just go through the trainers.txt file until you find a blank space, if you dont find one then just try pasting a clean version over the top.

    oh, -fail-
    still a problem, though.. I can't play.. at all. Ever since I tried your script.. When I try to start a new game.
    Code:
    Exception: NoMethodError
    Message: private method `gsub' called for nil:NilClass
    PokemonEditor:32:in `get'
    PokemonEditor:71:in `pbGetSpeciesConst'
    PokemonEditor:507:in `pbSaveTrainerBattles'
    PokemonEditor:505:in `each'
    PokemonEditor:505:in `pbSaveTrainerBattles'
    PokemonEditor:489:in `each'
    PokemonEditor:489:in `pbSaveTrainerBattles'
    PokemonEditor:486:in `open'
    PokemonEditor:486:in `pbSaveTrainerBattles'
    PokemonTrainers:67:in `pbConvertTrainerData'
    I'm so confused..


    right now i seems like people are ignoring me on purpose. i posted on two different threads with the same error code, and everyone's gone for 2 days? hurr. Quite annoying..
    I don't need the dual script anymore, it'll probably just make things more confusing anyway so I'm not using it. Works, but i'm not using it.
    Good luck, cng.
     
    Last edited:
    2
    Posts
    14
    Years
    • Seen Aug 29, 2010
    Sorry CNG, I found it on the web, so I thought it was public (I've just deleted it)
    About the script you posted, I get a similar error, the "button" appears when I push "X" and the picture appears, but the error too... In addition, the mouse doesn't show above the game's window (that's my biggest problem, because I put the Mouse.update)
    Any suggestion?

    Thanks for your attention
     

    zingzags

    PokemonGDX creator
    536
    Posts
    15
    Years
  • Here i am going to post my script for help

    Code:
    class PokemonMenu_Scene
    def pbShowCommands(commands)
     ret=-1
     cmdwindow=@sprites["cmdwindow"]
     cmdwindow.viewport=Viewport.new(0, 0, 480, 320)
     cmdwindow.index=$PokemonTemp.menuLastChoice
     cmdwindow.resizeToFit(commands)
     cmdwindow.commands=commands
     cmdwindow.x=480-cmdwindow.width
     cmdwindow.y=0
     cmdwindow.visible=true
       loop do
        cmdwindow.update
        Graphics.update
        Input.update
            Mouse.update
    $mouse.x = Mouse.pos_x
    $mouse.y = Mouse.pos_y
        pbUpdateSceneMap
        if Input.trigger?(Input::B)
         ret=-1
         break
        end
        if Input.trigger?(Input::C)
         ret=cmdwindow.index
         $PokemonTemp.menuLastChoice=ret
         break
        end
       end
     return ret
    end
    
    def pbShowInfo(text)
      @sprites["infowindow"].resizeToFit(text,Graphics.height)
      @sprites["infowindow"].text=text
      @sprites["infowindow"].visible=true
      @infostate=true
    end
    
    def pbShowHelp(text)
      @sprites["helpwindow"].resizeToFit(text,Graphics.height)
      @sprites["helpwindow"].text=text
      @sprites["helpwindow"].visible=true
      @helpstate=true
      pbBottomLeft(@sprites["helpwindow"])
    end
    
    def pbStartScene
     @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
     @viewport.z=99999
     @sprites={}
     @sprites["cmdwindow"]=Window_CommandPokemon.new([])
     @sprites["infowindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
     @sprites["infowindow"].visible=false
     @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
     @sprites["helpwindow"].visible=false
     @sprites["cmdwindow"].visible=false
     @sprites["button"]=IconSprite.new(0, 340)
     @sprites["button"].setBitmap("Graphics/Pictures/Menu_bg")
     @sprites["button1"]=IconSprite.new(20, 370)
     @sprites["button1"].setBitmap("Graphics/Pictures/dexter")
     @infostate=false
     @helpstate=false
     pbSEPlay("menu")
     end
    
    def pbHideMenu
     @sprites["cmdwindow"].visible=false
     @sprites["infowindow"].visible=false
     @sprites["helpwindow"].visible=false
    end
    
    def pbShowMenu
     @sprites["cmdwindow"].visible=true
     @sprites["infowindow"].visible=@infostate
     @sprites["helpwindow"].visible=@helpstate
    end
    
    def pbEndScene
     pbDisposeSpriteHash(@sprites)
     @viewport.dispose
    end
    
    def pbRefresh
    end
    
    end
    
    
    class PokemonMenu
    
    def initialize(scene)
     @scene=scene
    end
    
    def pbShowMenu
     @scene.pbRefresh
     @scene.pbShowMenu
    end
    
    def pbStartPokemonMenu
      @scene.pbStartScene
      endscene=true
      commands=[]
      cmdPokedex=-1
      cmdPokemon=-1
      cmdBag=-1
      cmdTrainer=-1
      cmdSave=-1
      cmdOption=-1
      cmdPokegear=-1
      cmdDebug=-1
      cmdQuit=-1
      if !$Trainer
       if $DEBUG
        Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
        Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
       end
       return
      end
      commands[cmdPokedex=commands.length]=_INTL("POKéDEX") if $Trainer.pokedex
      commands[cmdPokemon=commands.length]=_INTL("POKéMON") if $Trainer.party.length>0
      commands[cmdBag=commands.length]=_INTL("BAG") if !pbInBugContest?
      commands[cmdPokegear=commands.length]=_INTL("POKéGEAR") if $Trainer.pokegear
      commands[cmdTrainer=commands.length]=$Trainer.name
      if pbInSafari?
       @scene.pbShowInfo(_INTL("STEPS: {1}/600\nBALLS: {2}",pbSafariState.steps,pbSafariState.ballcount))
       commands[cmdQuit=commands.length]=_INTL("QUIT")
      elsif pbInBugContest?
       if pbBugContestState.lastPokemon
         @scene.pbShowInfo(_INTL("CAUGHT: {1}\nLEVEL: {2}\nBALLS: {3}",
              PBSpecies.getName(pbBugContestState.lastPokemon.species),
              pbBugContestState.lastPokemon.level,
              pbBugContestState.ballcount))
       else
         @scene.pbShowInfo(_INTL("CAUGHT: None\nBALLS: {1}",pbBugContestState.ballcount))
       end
       commands[cmdQuit=commands.length]=_INTL("QUIT")
      else
       commands[cmdSave=commands.length]=_INTL("SAVE") if !$game_system || !$game_system.save_disabled
      end
      commands[cmdOption=commands.length]=_INTL("OPTION")
      commands[cmdDebug=commands.length]=_INTL("DEBUG") if $DEBUG
      commands[commands.length]=_INTL("EXIT")
      loop do
        
        if Mouse.mouse_in_area?(20, 370, 65, 43)
          if Mouse.click?(1)
            pbFadeOutIn(99999) {
        scene=PokemonPokedexScene.new
        screen=PokemonPokedex.new(scene)
        screen.pbStartScreen
        @scene.pbRefresh
        }
          end
        end
       [email protected](commands)
       if cmdPokedex>=0 && command==cmdPokedex
        pbFadeOutIn(99999) {
        scene=PokemonPokedexScene.new
        screen=PokemonPokedex.new(scene)
        screen.pbStartScreen
        @scene.pbRefresh
        }
       elsif cmdPokegear>=0 && command==cmdPokegear
        pbLoadRpgxpScene(Scene_Pokegear.new)
       elsif cmdPokemon>=0 && command==cmdPokemon
         sscene=PokemonScreen_Scene.new
         sscreen=PokemonScreen.new(sscene,$Trainer.party)
         hiddenmove=nil
         pbFadeOutIn(99999) { 
          hiddenmove=sscreen.pbPokemonScreen
          if hiddenmove
           @scene.pbEndScene
          else
           @scene.pbRefresh
          end
         }
        if hiddenmove
         Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
         return
        end
       elsif cmdBag>=0 && command==cmdBag
        item=0
        scene=PokemonBag_Scene.new
        screen=PokemonBagScreen.new(scene,$PokemonBag)
        pbFadeOutIn(99999) { 
          item=screen.pbStartScreen 
          if item>0
           @scene.pbEndScene
          else
           @scene.pbRefresh
          end
        }
        if item>0
         Kernel.pbUseKeyItemInField(item)
         return
        end
       elsif cmdTrainer>=0 && command==cmdTrainer
        PBDebug.logonerr {
         scene=PokemonTrainerCardScene.new
         screen=PokemonTrainerCard.new(scene)
         pbFadeOutIn(99999) { 
          screen.pbStartScreen
          @scene.pbRefresh
         }
        }
       elsif cmdQuit>=0 && command==cmdQuit
         @scene.pbHideMenu
         if pbInSafari?
           if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
            @scene.pbEndScene
            pbSafariState.decision=1
            pbSafariState.pbGoToStart
            return
           else
            pbShowMenu
           end
         else
           if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
            @scene.pbEndScene
            pbBugContestState.pbStartJudging
            return
           else
            pbShowMenu
           end
         end
       elsif cmdSave>=0 && command==cmdSave
         @scene.pbHideMenu
         scene=PokemonSaveScene.new
         screen=PokemonSave.new(scene)
         if screen.pbSaveScreen
          @scene.pbEndScene
          endscene=false
          break
         else
          pbShowMenu
         end
       elsif cmdDebug>=0 && command==cmdDebug
        pbFadeOutIn(99999) { 
         pbDebugMenu
         @scene.pbRefresh
        }
       elsif cmdOption>=0 && command==cmdOption
         scene=PokemonOptionScene.new
         screen=PokemonOption.new(scene)
         pbFadeOutIn(99999) {
          screen.pbStartScreen
          pbUpdateSceneMap
          @scene.pbRefresh
         }
       else
        break
       end
      end
      @scene.pbEndScene if endscene
    end
    end
     
    73
    Posts
    17
    Years
    • Age 34
    • Seen Dec 7, 2023
    Useful. I haven't scripted anything in RGSS in ages, but between what I remember and the button tutorial...yes, very useful indeed. °m°
     

    nmorr

    Takin a brake. -_-
    214
    Posts
    15
    Years
  • Here i am going to post my script for help

    Code:
    class PokemonMenu_Scene
    def pbShowCommands(commands)
     ret=-1
     cmdwindow=@sprites["cmdwindow"]
     cmdwindow.viewport=Viewport.new(0, 0, 480, 320)
     cmdwindow.index=$PokemonTemp.menuLastChoice
     cmdwindow.resizeToFit(commands)
     cmdwindow.commands=commands
     cmdwindow.x=480-cmdwindow.width
     cmdwindow.y=0
     cmdwindow.visible=true
       loop do
        cmdwindow.update
        Graphics.update
        Input.update
            Mouse.update
    $mouse.x = Mouse.pos_x
    $mouse.y = Mouse.pos_y
        pbUpdateSceneMap
        if Input.trigger?(Input::B)
         ret=-1
         break
        end
        if Input.trigger?(Input::C)
         ret=cmdwindow.index
         $PokemonTemp.menuLastChoice=ret
         break
        end
       end
     return ret
    end
    
    def pbShowInfo(text)
      @sprites["infowindow"].resizeToFit(text,Graphics.height)
      @sprites["infowindow"].text=text
      @sprites["infowindow"].visible=true
      @infostate=true
    end
    
    def pbShowHelp(text)
      @sprites["helpwindow"].resizeToFit(text,Graphics.height)
      @sprites["helpwindow"].text=text
      @sprites["helpwindow"].visible=true
      @helpstate=true
      pbBottomLeft(@sprites["helpwindow"])
    end
    
    def pbStartScene
     @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
     @viewport.z=99999
     @sprites={}
     @sprites["cmdwindow"]=Window_CommandPokemon.new([])
     @sprites["infowindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
     @sprites["infowindow"].visible=false
     @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
     @sprites["helpwindow"].visible=false
     @sprites["cmdwindow"].visible=false
     @sprites["button"]=IconSprite.new(0, 340)
     @sprites["button"].setBitmap("Graphics/Pictures/Menu_bg")
     @sprites["button1"]=IconSprite.new(20, 370)
     @sprites["button1"].setBitmap("Graphics/Pictures/dexter")
     @infostate=false
     @helpstate=false
     pbSEPlay("menu")
     end
    
    def pbHideMenu
     @sprites["cmdwindow"].visible=false
     @sprites["infowindow"].visible=false
     @sprites["helpwindow"].visible=false
    end
    
    def pbShowMenu
     @sprites["cmdwindow"].visible=true
     @sprites["infowindow"].visible=@infostate
     @sprites["helpwindow"].visible=@helpstate
    end
    
    def pbEndScene
     pbDisposeSpriteHash(@sprites)
     @viewport.dispose
    end
    
    def pbRefresh
    end
    
    end
    
    
    class PokemonMenu
    
    def initialize(scene)
     @scene=scene
    end
    
    def pbShowMenu
     @scene.pbRefresh
     @scene.pbShowMenu
    end
    
    def pbStartPokemonMenu
      @scene.pbStartScene
      endscene=true
      commands=[]
      cmdPokedex=-1
      cmdPokemon=-1
      cmdBag=-1
      cmdTrainer=-1
      cmdSave=-1
      cmdOption=-1
      cmdPokegear=-1
      cmdDebug=-1
      cmdQuit=-1
      if !$Trainer
       if $DEBUG
        Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
        Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
       end
       return
      end
      commands[cmdPokedex=commands.length]=_INTL("POKéDEX") if $Trainer.pokedex
      commands[cmdPokemon=commands.length]=_INTL("POKéMON") if $Trainer.party.length>0
      commands[cmdBag=commands.length]=_INTL("BAG") if !pbInBugContest?
      commands[cmdPokegear=commands.length]=_INTL("POKéGEAR") if $Trainer.pokegear
      commands[cmdTrainer=commands.length]=$Trainer.name
      if pbInSafari?
       @scene.pbShowInfo(_INTL("STEPS: {1}/600\nBALLS: {2}",pbSafariState.steps,pbSafariState.ballcount))
       commands[cmdQuit=commands.length]=_INTL("QUIT")
      elsif pbInBugContest?
       if pbBugContestState.lastPokemon
         @scene.pbShowInfo(_INTL("CAUGHT: {1}\nLEVEL: {2}\nBALLS: {3}",
              PBSpecies.getName(pbBugContestState.lastPokemon.species),
              pbBugContestState.lastPokemon.level,
              pbBugContestState.ballcount))
       else
         @scene.pbShowInfo(_INTL("CAUGHT: None\nBALLS: {1}",pbBugContestState.ballcount))
       end
       commands[cmdQuit=commands.length]=_INTL("QUIT")
      else
       commands[cmdSave=commands.length]=_INTL("SAVE") if !$game_system || !$game_system.save_disabled
      end
      commands[cmdOption=commands.length]=_INTL("OPTION")
      commands[cmdDebug=commands.length]=_INTL("DEBUG") if $DEBUG
      commands[commands.length]=_INTL("EXIT")
      loop do
        
        if Mouse.mouse_in_area?(20, 370, 65, 43)
          if Mouse.click?(1)
            pbFadeOutIn(99999) {
        scene=PokemonPokedexScene.new
        screen=PokemonPokedex.new(scene)
        screen.pbStartScreen
        @scene.pbRefresh
        }
          end
        end
       [email protected](commands)
       if cmdPokedex>=0 && command==cmdPokedex
        pbFadeOutIn(99999) {
        scene=PokemonPokedexScene.new
        screen=PokemonPokedex.new(scene)
        screen.pbStartScreen
        @scene.pbRefresh
        }
       elsif cmdPokegear>=0 && command==cmdPokegear
        pbLoadRpgxpScene(Scene_Pokegear.new)
       elsif cmdPokemon>=0 && command==cmdPokemon
         sscene=PokemonScreen_Scene.new
         sscreen=PokemonScreen.new(sscene,$Trainer.party)
         hiddenmove=nil
         pbFadeOutIn(99999) { 
          hiddenmove=sscreen.pbPokemonScreen
          if hiddenmove
           @scene.pbEndScene
          else
           @scene.pbRefresh
          end
         }
        if hiddenmove
         Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
         return
        end
       elsif cmdBag>=0 && command==cmdBag
        item=0
        scene=PokemonBag_Scene.new
        screen=PokemonBagScreen.new(scene,$PokemonBag)
        pbFadeOutIn(99999) { 
          item=screen.pbStartScreen 
          if item>0
           @scene.pbEndScene
          else
           @scene.pbRefresh
          end
        }
        if item>0
         Kernel.pbUseKeyItemInField(item)
         return
        end
       elsif cmdTrainer>=0 && command==cmdTrainer
        PBDebug.logonerr {
         scene=PokemonTrainerCardScene.new
         screen=PokemonTrainerCard.new(scene)
         pbFadeOutIn(99999) { 
          screen.pbStartScreen
          @scene.pbRefresh
         }
        }
       elsif cmdQuit>=0 && command==cmdQuit
         @scene.pbHideMenu
         if pbInSafari?
           if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
            @scene.pbEndScene
            pbSafariState.decision=1
            pbSafariState.pbGoToStart
            return
           else
            pbShowMenu
           end
         else
           if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
            @scene.pbEndScene
            pbBugContestState.pbStartJudging
            return
           else
            pbShowMenu
           end
         end
       elsif cmdSave>=0 && command==cmdSave
         @scene.pbHideMenu
         scene=PokemonSaveScene.new
         screen=PokemonSave.new(scene)
         if screen.pbSaveScreen
          @scene.pbEndScene
          endscene=false
          break
         else
          pbShowMenu
         end
       elsif cmdDebug>=0 && command==cmdDebug
        pbFadeOutIn(99999) { 
         pbDebugMenu
         @scene.pbRefresh
        }
       elsif cmdOption>=0 && command==cmdOption
         scene=PokemonOptionScene.new
         screen=PokemonOption.new(scene)
         pbFadeOutIn(99999) {
          screen.pbStartScreen
          pbUpdateSceneMap
          @scene.pbRefresh
         }
       else
        break
       end
      end
      @scene.pbEndScene if endscene
    end
    end

    I used your script, (renamed stuff and everything) but an error came up when I pressed X to summon the menu.


    Exception: NoMethodError
    Message: undefined method `x=' for nil:NilClass
    PokemonMenu:17:in `pbShowCommands'
    PokemonMenu:12:in `loop'
    PokemonMenu:29:in `pbShowCommands'
    PokemonMenu:157:in `pbStartPokemonMenu'
    PokemonMenu:145:in `loop'
    PokemonMenu:255:in `pbStartPokemonMenu'
    Scene_Map:180:in `call_menu'
    Scene_Map:153:in `update'
    Scene_Map:63:in `main'
    Scene_Map:60:in `loop'
     
    73
    Posts
    17
    Years
    • Age 34
    • Seen Dec 7, 2023
    Tried it...veeeery good. 8D

    Just one question: is there one superclass, in which you can put the mouse update so that it shows everywhere else, or the update has to be copypasted in every script? °A°
     

    zingzags

    PokemonGDX creator
    536
    Posts
    15
    Years
  • I used your script, (renamed stuff and everything) but an error came up when I pressed X to summon the menu.


    I posted my script so i can get help not help someone else o.o.
    Maybe i should have reworded it.


    srry 4 the confusion bro
     

    nmorr

    Takin a brake. -_-
    214
    Posts
    15
    Years
  • Originally Posted by nmorr
    I used your script, (renamed stuff and everything) but an error came up when I pressed X to summon the menu.

    I posted my script so i can get help not help someone else o.o.
    Maybe i should have reworded it.


    srry 4 the confusion bro

    Oh, kk, no problem. I'll try and find what the problem is too.
     

    Rassalon

    Epic One
    144
    Posts
    15
    Years
  • You only need the mouse module if you intend to add mouse controls to your game. So unless you are adding said controls there really is no need for the mouse module.
     

    nmorr

    Takin a brake. -_-
    214
    Posts
    15
    Years
  • Yes I Do Want Mouse Capibilite Touch Screen = Mouse Module.
    lol, I found it in one of my previous posts.


    #===============================================================================
    # * Mouse Input Module by Dervvulfman
    # * Mouse.mouse_in_area? added by Crazyninjaguy
    #===============================================================================

    # Left-Clicking Control---
    # 0 = single click action
    # 1 = double-click action
    MOUSE_LEFT_ACTION = 0

    # Right-Clicking Control--
    # 0 = Menu / 'B' pressed
    # 1 = Stop Movement
    MOUSE_RIGHT_ACTION = 0

    module Mouse
    @cursor_pos_get = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
    @cursor_pos_set = Win32API.new('user32', 'SetCursorPos', 'ii', 'i')
    @cursor_show = Win32API.new('user32', 'ShowCursor', 'L', 'i')
    @window_find = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
    @window_c_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
    @window_scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
    @readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
    @key = Win32API.new("user32", "GetAsyncKeyState", 'i', 'i')
    Left_Click = 1
    Right_Click = 2
    Middle_Click = 4
    MOUSE_BUTTONS = { Left_Click => 1,
    Right_Click => 2,
    Middle_Click => 4 }
    MOUSE_REPEAT = MOUSE_BUTTONS.clone
    MOUSE_REPEAT.keys.each { |k| MOUSE_REPEAT[k] = [false, false, 10]}
    @game_window = nil # Set game handle to nil
    @cursor_show.call(0) # Turn off system mouse
    def Mouse.click?(button)
    MOUSE_REPEAT[button][1] >= 1
    end
    def Mouse.dbclick?(button)
    MOUSE_REPEAT[button][1] == 2
    end
    def Mouse.pos(catch_anywhere = true)
    x, y = screen_to_client(screen_x, screen_y)
    width, height = client_size
    if catch_anywhere or (x >= 0 and y >= 0 and x < width and y < height)
    return x, y
    else
    return 0, 0
    end
    end
    def Mouse.pos_set(x, y)
    x = [[x, 0].max, 640].min
    y = [[y, 0].max, 480].min
    x, y = client_to_screen(x, y)
    @cursor_pos_set.call(x, y)
    end
    def Mouse.pos_x
    x, y = pos
    return x
    end
    def Mouse.pos_y
    x, y = pos
    return y
    end
    def Mouse.screen
    pos = [0, 0].pack('ll')
    @cursor_pos_get.call(pos)
    return pos.unpack('ll')
    end
    def Mouse.screen_x
    pos = [0, 0].pack('ll')
    @cursor_pos_get.call(pos)
    return pos.unpack('ll')[0]
    end
    def Mouse.screen_y
    pos = [0, 0].pack('ll')
    @cursor_pos_get.call(pos)
    return pos.unpack('ll')[1]
    end
    def Mouse.client_size
    rect = [0, 0, 0, 0].pack('l4')
    @window_c_rect.call(Mouse.hwnd, rect)
    right, bottom = rect.unpack('l4')[2..3]
    return right, bottom
    end
    def Mouse.hwnd
    if @game_window.nil?
    game_name = "\0" * 256
    @readini.call('Game','Title','',game_name,255,".\\Game.ini")
    game_name.delete!("\0")
    @game_window = @window_find.call('RGSS Player',game_name)
    end
    return @game_window
    end
    def Mouse.screen_to_client(x, y)
    return nil unless x and y
    pos = [x, y].pack('ll')
    if @window_scr2cli.call(hwnd, pos) != 0
    return pos.unpack('ll')
    else
    return nil
    end
    end
    def Mouse.update
    MOUSE_BUTTONS.keys.each do |key|
    temp = MOUSE_REPEAT[key][0]
    key_pres = @key.call(MOUSE_BUTTONS[key]) != 0
    key_trig = temp == key_pres ? 0 : (key_pres ? (MOUSE_REPEAT[key][2].between?(1, 9) ? 2 : 1) : -1)
    count = key_trig > 0 ? 0 : [MOUSE_REPEAT[key][2]+1, 20].min
    MOUSE_REPEAT[key] = [key_pres, key_trig, count]
    end
    end
    def Mouse.visible?(visible=true)
    if visible
    @cursor_show.call(-1)
    else
    @cursor_show.call(0)
    end
    end
    def Mouse.mouse_in_area?(*args)
    return false if Mouse.pos_x.nil?
    if args[0].is_a?(Rect)
    Mouse.pos_x >= args[0].x and
    Mouse.pos_y >= args[0].y and
    Mouse.pos_x <= args[0].x + args[0].width and
    Mouse.pos_y <= args[0].y + args[0].height
    else
    Mouse.pos_x >= args[0] and
    Mouse.pos_y >= args[1] and
    Mouse.pos_x <= args[0] + args[2] and
    Mouse.pos_y <= args[1] + args[3]
    end
    end
    end

    $mouse=IconSprite.new
    $mouse.setBitmap("Graphics/Icons/Arrow")
    $mouse.z = 999999999
     

    Pichuichu

    Creator Of (Insert Here)
    271
    Posts
    14
    Years
  • Doesn't Work.

    Doesn't Work CNG Here's The Error Code.

    Spoiler:


    By The Way this happen's every time i start up the game.
     
    Back
    Top