• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

[Scripting Question] Need help making Input call Common Event

Rinkoou

Awful-Pun Master
  • 54
    Posts
    8
    Years
    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!
     
    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?
     
    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?
     
    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
     
    Thank you so much! The "unless" part wouldn't allow the thing to work, but without it its perfect!
     
    Back
    Top