The PokéCommunity Forums Fan Games Game Development Pokémon Essentials
General Coding Question Modular Menu entry switch

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.

Reply
 
Thread Tools
  #1    
Old May 18th, 2018 (1:03 AM).
Seedonator's Avatar
Seedonator Seedonator is offline
     
    Join Date: Apr 2018
    Posts: 66
    This is a pretty dumb question but I have Luka S.J's modular menu script and I want to know how you make it so that an entry for the menu only appears once a switch is activated.
    This is my entry that I made:
    Code:
    # Global Trade Station
    MenuHandlers.addEntry(:GTS,"GTS","menuGts",proc{|menu|
      scene = PokemonSave_Scene.new
      screen = PokemonSaveScreen.new(scene)
      menu.pbEndScene
      menu.endscene = false
      if screen.pbSaveScreen
        menu.close = true
        pbBGMPlay("Trade Resort - Brick Bronze OST")
        GTS.open
      else
        menu.pbStartScene
        menu.pbShowMenu
        menu.close = false
      end
    },proc{ return true })
    __________________
    Lookin' for a team to help me with Pokémon Brick Bronze Remake
    Reply With Quote
      #2    
    Old May 18th, 2018 (2:01 AM). Edited May 18th, 2018 by Ego13.
    Ego13's Avatar
    Ego13 Ego13 is offline
       
      Join Date: Jul 2017
      Location: Larua Region
      Gender: Male
      Nature: Calm
      Posts: 204
      Depending on how the rest of the script looks you could suround that part with an if statement
      example

      Code:
      # Global Trade Station
      if $game_switches[99]
      MenuHandlers.addEntry(:GTS,"GTS","menuGts",proc{|menu|
        scene = PokemonSave_Scene.new
        screen = PokemonSaveScreen.new(scene)
        menu.pbEndScene
        menu.endscene = false
        if screen.pbSaveScreen
          menu.close = true
          pbBGMPlay("Trade Resort - Brick Bronze OST")
          GTS.open
        else
          menu.pbStartScene
          menu.pbShowMenu
          menu.close = false
        end
      },proc{ return true })
      end
      EDIT: Actually nevermind that. i checked the script and there already is a method

      Code:
      MenuHandlers.addEntry(:NAME,"Text displayed","icon name",proc{|menu|
        # your lines of code go here
        # keep in mind that the 'proc{|menu| ' part always has to be like this
        # for every entry in your menu, when you go about defining the actual
        # functionality that is run when the player selects that menu element
        }
      },proc{
        # block of code that checks if the player has access to the menu element
        # MUST ALWAYS return a boolean expression
        # or if you want the player to always be able to trigger this:
        return true
      })
      __________________
      Looking for spriters to help with

      Pokemon Hollow on pokecommunity.com
      Reply With Quote
        #3    
      Old May 18th, 2018 (7:54 PM).
      Seedonator's Avatar
      Seedonator Seedonator is offline
         
        Join Date: Apr 2018
        Posts: 66
        Oh thanks!
        __________________
        Lookin' for a team to help me with Pokémon Brick Bronze Remake
        Reply With Quote
        Reply

        Quick Reply

        Join the conversation!

        Create an account to post a reply in this thread, participate in other discussions, and more!

        Create a PokéCommunity Account
        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

        Forum Jump


        All times are GMT -8. The time now is 4:00 AM.