The PokéCommunity Forums Fan Games Game Development Pokémon Essentials
Custom Scripts Question Need help making Input call Common Event

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 February 12th, 2018 (6:01 PM).
Rinkoou's Avatar
Rinkoou Rinkoou is offline
Awful-Pun Master
     
    Join Date: Sep 2016
    Location: the Internet
    Gender: Male
    Nature: Naughty
    Posts: 54
    Hi! I suck at coding and I'm trying to make it where if you pressed the V button, the game would call common event 5. Here is my code:
    Code:
    def pbAllowPneuma
      $CanToggle = true
    end
    
    def pbDisallowPneuma
      $CanToggle = false
    end
    
    def pbPneuma
      if $CanToggle && Input.trigger?(Input::V)
        pbCommonEvent(PNEUMA)
      end
    end
    I tried pbCommonEvent(5) and pbCommonEvent(PNEUMA), Pneuma being the common event name in Settings. Also, I did define V properly. If anybody could help, I'd appreciate it!
    __________________
    I ask stupid questions because my brain is nonexistant.
    Reply With Quote

    Relevant Advertising!

      #2    
    Old February 13th, 2018 (4:31 AM).
    Ego13's Avatar
    Ego13 Ego13 is offline
       
      Join Date: Jul 2017
      Location: Larua Region
      Gender: Male
      Nature: Calm
      Posts: 196
      Where did you place "def pbPneuma"?
      The way it's set up now it won't check for input in field. It checks when call pbPneuma

      Anything else happening?
      __________________
      Looking for spriters to help with

      Pokemon Hollow on pokecommunity.com
      Reply With Quote
        #3    
      Old February 13th, 2018 (1:45 PM).
      Rinkoou's Avatar
      Rinkoou Rinkoou is offline
      Awful-Pun Master
         
        Join Date: Sep 2016
        Location: the Internet
        Gender: Male
        Nature: Naughty
        Posts: 54
        I don't know where I should place it. I tried changing which button activates it, but it still doesn't work. Can you please help?
        __________________
        I ask stupid questions because my brain is nonexistant.
        Reply With Quote
          #4    
        Old February 14th, 2018 (8:37 AM).
        Ego13's Avatar
        Ego13 Ego13 is offline
           
          Join Date: Jul 2017
          Location: Larua Region
          Gender: Male
          Nature: Calm
          Posts: 196
          In the script section Scene_Map find
          Code:
           if Input.trigger?(Input::B)
                unless pbMapInterpreterRunning? or $game_system.menu_disabled or $game_player.moving?
                  startMenu
                  #$game_temp.menu_calling = true
                  #$game_temp.menu_beep = true
                end
              end
              if Input.trigger?(Input::F5)
                unless pbMapInterpreterRunning? or $game_player.moving?
                  $PokemonTemp.keyItemCalling = true if $PokemonTemp
                end
              end
          and before
          Code:
           if Input.trigger?(Input::B)
          add this
          Code:
           if Input.trigger?(Input::V) && $CanToggle
                unless pbMapInterpreterRunning? or $game_player.moving?  #remove this line if it can be toggled  while walking/running
          pbCommonEvent(5)
          end
          end
          __________________
          Looking for spriters to help with

          Pokemon Hollow on pokecommunity.com
          Reply With Quote
            #5    
          Old February 14th, 2018 (6:46 PM).
          Rinkoou's Avatar
          Rinkoou Rinkoou is offline
          Awful-Pun Master
             
            Join Date: Sep 2016
            Location: the Internet
            Gender: Male
            Nature: Naughty
            Posts: 54
            Thank you so much! The "unless" part wouldn't allow the thing to work, but without it its perfect!
            __________________
            I ask stupid questions because my brain is nonexistant.
            Reply With Quote
              #6    
            Old February 14th, 2018 (9:27 PM).
            Ego13's Avatar
            Ego13 Ego13 is offline
               
              Join Date: Jul 2017
              Location: Larua Region
              Gender: Male
              Nature: Calm
              Posts: 196
              Quote:
              Originally Posted by Rinkoou View Post
              Thank you so much! The "unless" part wouldn't allow the thing to work, but without it its perfect!
              Kinda guessed that :D but glad it works
              __________________
              Looking for spriters to help with

              Pokemon Hollow on pokecommunity.com
              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

              Sponsored Links
              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 5:50 PM.