The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.


Advertise here

Reply
 
Thread Tools
  #1    
Old July 26th, 2013, 03:16 AM
Kaito123
 
Join Date: Jul 2012
Gender: Male

Advertise here
Hello! I have a question.

In the Pokemon Essentials DS, you can activate the menu with the script:

Spoiler:
Code:
$Trainer.menu=true


How Can I activate/deactivate the menu, if i pressed the B-Button?

the script of the menu (a little bit modified by me, but only a few, because of graphics):
Spoiler:
Code:
#===============================================================================
# ** Modified Scene_Map class for Pokémon.
#-------------------------------------------------------------------------------
#  
#===============================================================================
class Scene_Map
  def spriteset
    for i in @spritesets.values
      return i if i.map==$game_map
    end
    return @spritesets.values[0]
  end

  def disposeSpritesets
   return if !@spritesets
    for i in @spritesets.keys
      if @spritesets[i]
        @spritesets[i].dispose
        @spritesets[i]=nil
      end
    end
    @spritesets.clear
    @spritesets={}
  end

  def createSpritesets
    @spritesets={}
    for map in $MapFactory.maps
      @spritesets[map.map_id]=Spriteset_Map.new(map)
    end
    $MapFactory.setSceneStarted(self)
    updateSpritesets
  end

  def updateMaps
    for map in $MapFactory.maps
      map.update
    end
    $MapFactory.updateMaps(self)
  end

  def updateSpritesets
    @spritesets={} if !@spritesets
    keys=@spritesets.keys.clone
    for i in keys
     if !$MapFactory.hasMap?(i)
       @spritesets[i].dispose if @spritesets[i]
       @spritesets[i]=nil
       @spritesets.delete(i)
     else
       @spritesets[i].update
     end
    end
    for map in $MapFactory.maps
      if !@spritesets[map.map_id]
        @spritesets[map.map_id]=Spriteset_Map.new(map)
      end
    end
    Events.onMapUpdate.trigger(self)
  end

  def main
    createSpritesets
    Graphics.transition
     facingEvent=$game_player.pbFacingEvent
     
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
 @viewport.z=99999
 @sprites={}
 
 @sprites["background"]=IconSprite.new(0,400,@viewport)
 @sprites["background"].setBitmap("Graphics/Menu/MenuOverlay")
 @sprites["background"].z=9999
 @sprites["background"].visible=false
 
 @sprites["bgback"]=IconSprite.new(0,400,@viewport)
 @sprites["bgback"].setBitmap("Graphics/Menu/MenuBW")
 @sprites["bgback"].visible=false
 
 @sprites["dex"]=IconSprite.new(0,400,@viewport)#-4
 @sprites["dex"].setBitmap("Graphics/Menu/MenuBW_Dex")
 @sprites["dex"].visible=false
 
 @sprites["pokemon"]=IconSprite.new(0,400,@viewport)#-4
 @sprites["pokemon"].setBitmap("Graphics/Menu/MenuBW_Poke")
 @sprites["pokemon"].visible=false
 
 @sprites["gear"]=IconSprite.new(-8,400,@viewport)
 @sprites["gear"].setBitmap("Graphics/Menu/MenuHGSS3_green")
 @sprites["gear"].visible=false
 
 @sprites["debug"]=IconSprite.new(0,736,@viewport)#202,690
 @sprites["debug"].setBitmap("Graphics/Menu/MenuHGSS2debug")
 @sprites["debug"].visible=false
 
 @sprites["item_box"]=IconSprite.new(0,400,@viewport)
 @sprites["item_box"].setBitmap("Graphics/menu/Kopia menuHGSS")
 @sprites["item_box"].visible=false
 
 @sprites["item_box"]=IconSprite.new(0,400,@viewport)
 @sprites["item_box"].setBitmap("Graphics/menu/Kopia menuHGSS")
 @sprites["item_box"].visible=false
 
 #@sprites["talk"]=IconSprite.new(350,656,@viewport)
 #@sprites["talk"].setBitmap("Graphics/menu/MenuHGSStalk")
 
 @sprites["item_registered"]=IconSprite.new(446,432,@viewport)
 @sprites["item_registered"].visible=false  
 

#@shoes=Sprite.new(@viewport)
[email protected]=BitmapCache.load_bitmap("Graphics/Menu/MenuHGSS2buty.png")
[email protected] = 9999 
[email protected] = 384
[email protected] = 568
[email protected]=false
#@shoesoff=Sprite.new(@viewport)
[email protected]=BitmapCache.load_bitmap("Graphics/Menu/MenuHGSS2butyoff.png")
[email protected] = 9999 
[email protected] = 384
[email protected] = 568
[email protected]=false
 
    loop do
      Graphics.update
      Input.update
      update
      if $Trainer
      #  if $PokemonGlobal.runningShoes==true
      #  if $PokemonGlobal.Running==true
      #  @shoes.visible=true 
      #  @shoesoff.visible=false
      #else
      #  @shoes.visible=false
      #  @shoesoff.visible=true 
      #  end
      #  end

        @sprites["bgback"].visible=true if $Trainer.menu
        @sprites["gear"].visible=true if $Trainer.pokegear
        @sprites["dex"].visible=true if $Trainer.pokedex && $Trainer.menu
        @sprites["pokemon"].visible=true if $Trainer.party.length>0 && $Trainer.menu
        @sprites["debug"].visible=true if $DEBUG
         if $PokemonBag.registeredItem==0
       @sprites["item_registered"].visible=false
       @sprites["item_box"].visible=false
     else
       @sprites["item_box"].visible
       @sprites["item_registered"].visible=true
       @sprites["item_registered"].bitmap=BitmapCache.load_bitmap(sprintf("Graphics/Icons/item%03d.png",$PokemonBag.registeredItem))
     end
        if pbMapInterpreterRunning? || $tallking==true
        @sprites["bgback"].opacity=160 if $Trainer.menu
        @sprites["gear"].opacity=160 if $Trainer.pokegear
        @sprites["dex"].opacity=160 if $Trainer.pokedex && $Trainer.menu
        @sprites["pokemon"].opacity=160 if $Trainer.party.length>0 && $Trainer.menu
         if $PokemonBag.registeredItem==0
             else
       @sprites["item_box"].opacity=160
       @sprites["item_registered"].opacity=160
     end
   else
      @sprites["bgback"].opacity=255 if $Trainer.menu
        @sprites["gear"].opacity=255 if $Trainer.pokegear
        @sprites["dex"].opacity=255 if $Trainer.pokedex && $Trainer.menu
        @sprites["pokemon"].opacity=255 if $Trainer.party.length>0 && $Trainer.menu
         if $PokemonBag.registeredItem==0
             else
       @sprites["item_box"].opacity=255
       @sprites["item_registered"].opacity=255
     end
        end
      end
      if $scene != self
        break
      end
    end
    Graphics.freeze
    disposeSpritesets
    if $game_temp.to_title
      Graphics.transition
      Graphics.freeze
    end
  end

  def miniupdate
    $PokemonTemp.miniupdate=true if $PokemonTemp
    loop do
      updateMaps
      $game_player.update
      $game_system.update
      $game_screen.update
      unless $game_temp.player_transferring
        break
      end
      transfer_player
      if $game_temp.transition_processing
        break
      end
    end
    updateSpritesets
    $PokemonTemp.miniupdate=false if $PokemonTemp
  end

  def update
    loop do
      updateMaps
      pbMapInterpreter.update
      $game_player.update
      $game_system.update
      $game_screen.update
      unless $game_temp.player_transferring
        break
      end
      transfer_player
      if $game_temp.transition_processing
        break
      end
    end
    updateSpritesets
    if $game_temp.to_title
      $scene = pbCallTitle
      return
    end
    if $game_temp.transition_processing
      $game_temp.transition_processing = false
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
           $game_temp.transition_name)
      end
    end
    if $game_temp.message_window_showing
      return
    end

    if $Trainer and $Trainer.menu
       if $PokemonBag.registeredItem==0
        else
       if pbMouseInAreaLeft?(400, 422, 112, 64)  
        pbWait(6)
       unless pbMapInterpreterRunning?
        $PokemonTemp.keyItemCalling = true if $PokemonTemp
      end
    end
  end
  
#      if Input.trigger?(Input::B) # von hier
#      if $Trainer.menu
#        $Trainer.menu=false
#      else
#        $Trainer.menu=true
#        end
#      else
#        end # bis hier

    if Input.trigger?(Input::B)
      unless pbMapInterpreterRunning? or $Trainer.menu=true
       $Trainer.menu=false
      end
    end
 
    if $PokemonGlobal.runningShoes==true
 #  if pbMouseLeftClick?(@shoes)
    if Input.trigger?(Input::A)
      if $PokemonGlobal.Running==true
        $PokemonGlobal.Running=false
        pbWait(6)
      else
        $PokemonGlobal.Running=true
        pbWait(6)
        end
      end
    end
      if $DEBUG
      if pbMouseInAreaLeft?(0, 736, 80, 52)
            pbFadeOutIn(99999) { 
           pbDebugMenu
        }
      end
      end
   if not pbMapInterpreterRunning?
     if pbMouseInAreaLeft?(262, 542, 246, 86)   #(202, 444, 81, 52) 
      pbPlayDecisionSE()
          scene=PokemonTrainerCardScene.new
          screen=PokemonTrainerCard.new(scene)
          pbFadeOutIn(99999) { 
          screen.pbStartScreen
          }
        end
 if $Trainer.pokegear
    if pbMouseInAreaLeft?(48,690,80,52)
 pbFadeOutIn(99999) {
  pbLoadRpgxpScene(Scene_Pokegear.new)
      }
    end
end
   if pbMouseInAreaLeft?(6, 638, 246, 86)    #(202, 524, 81, 52) 
     pbPlayDecisionSE()
         scene=PokemonSaveScene.new
         screen=PokemonSave.new(scene)
         if screen.pbSaveScreen
        
    end
  end
  
  if pbMouseInAreaLeft?(262, 638, 246, 86)     #(202, 604, 81, 52)
     pbPlayDecisionSE()
       pbFadeOutIn(99999) {
           scene=PokemonOptionScene.new
           screen=PokemonOption.new(scene)
           screen.pbStartScreen
           }
    end
    

  if pbMouseInAreaLeft?(6, 542, 246, 86)   #(42, 604, 81, 52) 
     pbPlayDecisionSE()
      item=0
             scene=PokemonBag_Scene.new
             screen=PokemonBagScreen.new(scene,$PokemonBag)
             pbFadeOutIn(99999) { 
             item=screen.pbStartScreen 
           if item>0
           break
             end
                }
            if item>0
           Kernel.pbUseKeyItemInField(item)
           return
          end
        end
    
    
  if $Trainer.pokedex   
   if pbMouseInAreaLeft?(262, 447, 246, 86)     #(42, 444, 81, 52)    
     pbPlayDecisionSE()
      pbFadeOutIn(99999) {
       scene=PokemonPokedexScene.new
       screen=PokemonPokedex.new(scene)
       screen.pbStartScreen
       }
     end
  end      
   
  if $Trainer && $Trainer.party.length>0
    if pbMouseInAreaLeft?(6, 447, 246, 86)    #(42, 522, 81, 52)
     pbPlayDecisionSE()
      sscene=PokemonScreen_Scene.new
      sscreen=PokemonScreen.new(sscene,$Trainer.party)
      hiddenmove=nil
      pbFadeOutIn(99999) { 
      hiddenmove=sscreen.pbPokemonScreen
      if hiddenmove
       @scene.pbEndScene
      end
     }
     end    
   end     
   end
end
    if Input.trigger?(Input::C) #|| pbMouseLeftClick?(@sprites["talk"])
      unless pbMapInterpreterRunning?
        $PokemonTemp.hiddenMoveEventCalling=true
      end
    end      
#    if Input.trigger?(Input::B) # von hier
#      unless pbMapInterpreterRunning? or $game_system.menu_disabled
#        $game_temp.menu_calling = true
#        $game_temp.menu_beep = true
#      end
#    end # bis hier

    if Input.trigger?(Input::F5)
      unless pbMapInterpreterRunning?
        $PokemonTemp.keyItemCalling = true if $PokemonTemp
      end
    end
    if $DEBUG and Input.press?(Input::F9)
      $game_temp.debug_calling = true
    end
    unless $game_player.moving?
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      elsif $PokemonTemp && $PokemonTemp.keyItemCalling
        $PokemonTemp.keyItemCalling=false
        $game_player.straighten
        Kernel.pbUseKeyItem
      elsif $PokemonTemp && $PokemonTemp.hiddenMoveEventCalling
        $PokemonTemp.hiddenMoveEventCalling=false
        $game_player.straighten
        Events.onAction.trigger(self)
      end
    end
  end

  def call_name
    $game_temp.name_calling = false
    $game_player.straighten
    $game_map.update
  end

  def call_menu
    $game_temp.menu_calling = false
    $game_player.straighten
    $game_map.update
    sscene=PokemonMenu_Scene.new
    sscreen=PokemonMenu.new(sscene) 
    sscreen.pbStartPokemonMenu
  end

  def call_debug
    $game_temp.debug_calling = false
    pbPlayDecisionSE()
    $game_player.straighten
    $scene = Scene_Debug.new
  end

  def autofade(mapid)
    playingBGM=$game_system.playing_bgm
    playingBGS=$game_system.playing_bgs
    return if !playingBGM && !playingBGS
    map=pbLoadRxData(sprintf("Data/Map%03d", mapid))
    if playingBGM && map.autoplay_bgm
      if playingBGM.name!=map.bgm.name
        pbBGMFade(0.8)
      end
    end
    if playingBGS && map.autoplay_bgs
      if playingBGS.name!=map.bgs.name
        pbBGMFade(0.8)
      end
    end
    Graphics.frame_reset
  end

  def transfer_player(cancelVehicles=true)
    $game_temp.player_transferring = false
    if cancelVehicles
      Kernel.pbCancelVehicles($game_temp.player_new_map_id)
    end
    autofade($game_temp.player_new_map_id)
    if $game_map.map_id != $game_temp.player_new_map_id
      $MapFactory.setup($game_temp.player_new_map_id)
    end
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    case $game_temp.player_new_direction
      when 2
        $game_player.turn_down
      when 4
        $game_player.turn_left
      when 6
        $game_player.turn_right
      when 8
        $game_player.turn_up
    end
    $game_player.straighten
    $game_map.update
    disposeSpritesets
    GC.start
    createSpritesets
    if $game_temp.transition_processing
      $game_temp.transition_processing = false
      Graphics.transition(20)
    end
    $game_map.autoplay
    Graphics.frame_reset
    Input.update
  end
end
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 06:19 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.