• 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!
  • 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] Prevent Player from Capturing Pokémon!

  • 33
    Posts
    7
    Years
    Prevent Player from Capturing Pok?mon!

    How can I prevent the player from capturing or using Pokeballs on certain maps?
     
    In the PokeBattle_Battle script, find this piece of code (lines 61 - 64 in a clean project if I'm not mistaken)
    Code:
        if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else

    Change it to this:
    Code:
        if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        elsif MAPSCANNOTUSEPOKEBALLS.include?($game_map.map_id)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("You cannot use Poké Balls here!"))
        else


    In your Settings script at the very top, add this:
    Code:
    MAPSCANNOTUSEPOKEBALLS = [1,2,3,4]

    These numbers, 1,2,3,4 are the Map IDs on which you cannot use Poké Balls.
     
    Back
    Top