• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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] Uncatchable Pokemon

Yusshin

♪ Yggdrasil ♪
  • 2,414
    Posts
    15
    Years
    Uncatchable Pokemon / PokemonEncounterModifier Error

    Spent about an hour using Search and going through the Wiki, using terms like "Uncatchable Pokemon," "Force Pokemon Battle," etc. and finally landed on "Event Encounters."

    Now I look through the Wiki and I've searched here, terms such as "can't catch," "can't capture," "prohibit capture," etc. and nothing pops up, so I shall ask:

    https://pokemonessentials.wikia.com/wiki/Event_encounters

    Invent certain battle conditions that depend on a Global Switch being ON (e.g. all Poké Balls used will always fail, or the weather randomly changes every turn), and turn that Switch ON just before the battle (and OFF again afterwards, of course). In this way, you can customise certain wild encounters to make them unique/harder.

    How do I make a switch like that, where you are prohibited from using PokeBalls? I don't want the player to be able to capture a Pokemon; just defeat it.

    A quick ALT+F search for "Pokeball" here:

    https://pokemonessentials.wikia.com/wiki/Events

    Indicates it's a customized switch and not a pre-implemented one.

    Thanks.
     
    Last edited by a moderator:
    Basically, within the script section on RPGMaker, you need to put a switch-script in there.

    So first things first, find where you will edit... The script that already does this, exists already, so we'll use that as a base and a place to start:

    Code:
    [COLOR="Blue"]    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else[/COLOR]

    That there is an already working script that we can use... To find it, press CTRL+SHIFT+F, type "don't be a thief", viola.

    Now we'll want to add our "own" script to make our battles do what we want:

    Code:
    [COLOR="blue"]    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else[/COLOR]
    [COLOR="Red"]    if $game_switches[227]==true
        @scene.pbThrowAndDeflect(ball,1)
        pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
        return
        end[/COLOR]

    So we'll enter our own script directly underneath the already working script... Now within the event you want to use this new script, turn switch 227, on before the battle.

    You can also do this with wild Pokémon such as legendaries that you don't want to be caught at a certain time:

    Code:
    [COLOR="blue"]    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else[/COLOR]
    [COLOR="red"]    if $game_switches[450]==true
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("Seems \n{1} doesn't want to be caught!",[/COLOR][COLOR="DarkGreen"]wildpoke.name[/COLOR][COLOR="red"]))
          return
        end[/COLOR]

    Notice the green part, that will call the opposing Pokémons name where {1} exists... Again, turn switch 450, on before the battle.

    There is no limit to how many you can use, just keep adding them directly under the original and/or after your new "script".

    Have fun.
     
    Hey Nick, I really appreciate you answering me on this :D but it's a lot of information to apply, and I'm still a bit confused.

    Spoiler:


    I misunderstood what a Global Switch meant! I just call them Switch and Self-Switch so I figured Global Switch was an internal Pokemon Essentials thing.

    Thanks Nick :D
     
    Last edited:
    I have a new issue now.

    The reason the Pokemon is uncatchable is because of its moveset.

    I'm trying to edit in in PokemonEncounterModifiers, as per the Wiki, into this:

    Events.onWildPokemonCreate+=proc {|sender,e|
    pokemon=e[0]
    if $game_switches[79]
    pbAutoLearnMove(poke,PBMoves::BUBBLEBEAM)
    pbAutoLearnMove(poke,PBMoves::THUNDERWAVE)
    pbAutoLearnMove(poke,PBMoves::EMBER)
    pbAutoLearnMove(poke,PBMoves::THUNDERSHOCK)
    end
    }

    But I get an error in-game that says:

    Spoiler:


    What's wrong? I know it can learn moves outside its set, because it tried to add these to my Oshawott when I added poke=$Trainer.party[0]

    I tried adding these inside the script (after the game switch is turned on):

    poke=$Trainer.party[0]
    poke=pbFirstAblePokemon
    poke=pbGetPokemon(1)
    * Tried the third one as poke=pbGetPokemon(PIKACHU) and it did not work either

    The first one edits MY Pokemon; the other two turn up as Run-Time errors when initiating the battle.
     
    Last edited:
    Use this:

    Events.onWildPokemonCreate+=proc {|sender,e|
    pokemon=e[0]
    if $game_switches[79]
    pbAutoLearnMove(pokemon,PBMoves::BUBBLEBEAM)
    pbAutoLearnMove(pokemon,PBMoves::THUNDERWAVE)
    pbAutoLearnMove(pokemon,PBMoves::EMBER)
    pbAutoLearnMove(pokemon,PBMoves::THUNDERSHOCK)
    end
    }
     
    Basically, within the script section on RPGMaker, you need to put a switch-script in there.

    So first things first, find where you will edit... The script that already does this, exists already, so we'll use that as a base and a place to start:

    Code:
    [COLOR=Blue]    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else[/COLOR]
    That there is an already working script that we can use... To find it, press CTRL+SHIFT+F, type "don't be a thief", viola.

    Now we'll want to add our "own" script to make our battles do what we want:

    Code:
    [COLOR=blue]    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else[/COLOR]
    [COLOR=Red]    if $game_switches[227]==true
        @scene.pbThrowAndDeflect(ball,1)
        pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
        return
        end[/COLOR]
    So we'll enter our own script directly underneath the already working script... Now within the event you want to use this new script, turn switch 227, on before the battle.

    You can also do this with wild Pokémon such as legendaries that you don't want to be caught at a certain time:

    Code:
    [COLOR=blue]    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else[/COLOR]
    [COLOR=red]    if $game_switches[450]==true
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("Seems \n{1} doesn't want to be caught!",[/COLOR][COLOR=DarkGreen]wildpoke.name[/COLOR][COLOR=red]))
          return
        end[/COLOR]
    Notice the green part, that will call the opposing Pokémons name where {1} exists... Again, turn switch 450, on before the battle.

    There is no limit to how many you can use, just keep adding them directly under the original and/or after your new "script".

    Have fun.
    If there if no limit, then I'm doing something wrong.

    Here's my code:
    Code:
        if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else
        if $game_switches[59]==true
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("This GDF Mech cannot be caught!"))
        else
        if $game_switches[60]==true
          @scene.pbThrowAndDeflect(ball,1)
        pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
        return
      end
    The first code I entered (the one with GDF mech, underneath "don't be a thief") gives me no problems.

    However, when I added a second code.....
    I get an error that reads "Script 'PokeBattle_Battle' line 4089: SyntaxError occured".
    I would also like to note that I have switches configured.

    What could I possibly be doing wrong?
     
    Code:
        if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
          return
        [COLOR="Red"]elsif[/COLOR] $game_switches[59]==true
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("This GDF Mech cannot be caught!"))
          return
        [COLOR="Red"]elsif[/COLOR] $game_switches[60]==true
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
          return
        end

    Else/if means you'd need two "end"s. "elsif" is else and if in a single command, and counts as an extension of the existing "if" tree.

    @Vendily: The indents aren't actually important; if I remember correctly, the compiler completely removes them. They're only there for human legibility.
     
    Code:
        if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
          return
        [COLOR=Red]elsif[/COLOR] $game_switches[59]==true
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("This GDF Mech cannot be caught!"))
          return
        [COLOR=Red]elsif[/COLOR] $game_switches[60]==true
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
          return
        end
    Else/if means you'd need two "end"s. "elsif" is else and if in a single command, and counts as an extension of the existing "if" tree.

    @Vendily: The indents aren't actually important; if I remember correctly, the compiler completely removes them. They're only there for human legibility.
    It worked! Thanks!
     
    Is this post still active? xd
    How could I prevent the pokeball from being used if it couldn't be thrown? I mean, it has worked that I cannot capture it, however the pokeball is still spent in inventory.
    How could I make the pokaball not use up if it is not catchable?

    Thanks. :D
     
    So i tried to add it in v19.1 but tell me does that format still stay like that I'm not so familiar with the "end"
     
    Back
    Top