• 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!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Event plays twice and key item can be tossed?

  • 69
    Posts
    10
    Years
    So, in my game, there is an event that prevents the player from leaving Pallet Town without a Pokémon. This is the event:
    Code:
    Script: pbExclaim($game_player)
    Text:It's dangerous to go alone! You need to take a 
    Pokémon!
    Set Move Route: Player (Ignore if Can't Move)
    -Move Down
    -Move Down
    The player moves down accordingly, but then the event plays again and the player moves down again, dialogue and all. What's causing this.
    Also, I have an item registered as a Key Item, but it can be tossed. But how? Is it not registered correctly? Here's its entry in items.txt
    Code:
    526,GBSOUNDS,GB Sounds,8,0,A music player that allows you to listen to nostalgic songs. It's operated with the flip of a single switch.,2,0,6,
    And here's its two PokemonItemEffects entries:
    Code:
    ItemHandlers::UseFromBag.add(:GBSOUNDS,proc{|item|
       $game_switches[59]=true  if $game_switches[59]== false
       $game_switches[59]=false if $game_switches[59]== true
       pbBGMStop()
       $game_system.setDefaultBGM(nil)
       next 1 # Continue
    })
    ItemHandlers::UseInField.add(:GBSOUNDS,proc{|item|
       $game_switches[59]=true  if $game_switches[59]== false
       $game_switches[59]=false if $game_switches[59]== true
       pbBGMStop()
       $game_system.setDefaultBGM(nil)
       next 1 # Continue
    })
    Have any help?
     
    So, in my game, there is an event that prevents the player from leaving Pallet Town without a Pokémon. This is the event:
    Code:
    Script: pbExclaim($game_player)
    Text:It's dangerous to go alone! You need to take a 
    Pokémon!
    Set Move Route: Player (Ignore if Can't Move)
    -Move Down
    -Move Down
    The player moves down accordingly, but then the event plays again and the player moves down again, dialogue and all. What's causing this.
    Also, I have an item registered as a Key Item, but it can be tossed. But how? Is it not registered correctly? Here's its entry in items.txt
    Code:
    526,GBSOUNDS,GB Sounds,8,0,A music player that allows you to listen to nostalgic songs. It's operated with the flip of a single switch.,2,0,6,
    And here's its two PokemonItemEffects entries:
    Code:
    ItemHandlers::UseFromBag.add(:GBSOUNDS,proc{|item|
       $game_switches[59]=true  if $game_switches[59]== false
       $game_switches[59]=false if $game_switches[59]== true
       pbBGMStop()
       $game_system.setDefaultBGM(nil)
       next 1 # Continue
    })
    ItemHandlers::UseInField.add(:GBSOUNDS,proc{|item|
       $game_switches[59]=true  if $game_switches[59]== false
       $game_switches[59]=false if $game_switches[59]== true
       pbBGMStop()
       $game_system.setDefaultBGM(nil)
       next 1 # Continue
    })
    Have any help?
    I don't have a solution for your actual problem but this

    Code:
    $game_switches[59]=true  if $game_switches[59]== false
       $game_switches[59]=false if $game_switches[59]== true
    should be this
    Code:
    $game_switches[59] = !$game_switches[59]
    As is it would switch it to true, then back to false, so it wouldn't work.
     
    You must be testing it in RMXP, where you can toss the item, try it by loading the actual game and seeing if its the same.
    As for the event problem, is it on autorun? or something like that? It should be on player touch. If that's not it, try testing the one from Essentials and if it works copy it.
    Thanks for your help. Doing this right away.
     
    Back
    Top