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

Contextual button that changes depending on a global variable?

  • 7
    Posts
    9
    Years
    • Seen May 23, 2023
    Is it possible? I want a key on the keyboard to do stuff like have a message box with hints, and maybe do actions in other places.

    Like in Megaman Battle Network and Megaman Star Force, the L button would tell you what you needed to do in case you forgot.
     
  • 1,224
    Posts
    10
    Years
    You need to add this button (I'll use Tab for an example) into your list of Inputs, so in PokemonControls, under module Input, add

    Code:
    TAB    =XX
    XX being the next available number.

    Then right below, under def self.buttontoKey(button)

    you're going to add
    Code:
      when Input::TAB
              return [0x09] # TAB
    to the list of inputs. 09 is the ASCII code for horizontal tab

    Now Tab can be used as an input. So lets add it to SceneMap under def update, and make it actually do something. Make sure to put it in the loop, add

    Code:
    if Input.trigger?(Input::TAB)
      pbYourMethod($game_map.name)  #this is a method you will have to make up
    end

    Start a new section, and make your method there. I'd use something like
    Code:
    def pbYourMethod(mapname,othervariable=nil)
    This way you can take into account both what map you are on, as well as any other factors you might want to put into this. I've never played either game you mentioned, so I don't know exactly what you want it to do. But I'd start trying to make it, and then come ask the board for any specific problems. You'll find that you're actually able to solve a lot of things on your own if you know where to look.
     
    • Like
    Reactions: FL
    Back
    Top