• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - 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.

Invincible trainer?

  • 575
    Posts
    12
    Years
    • Seen Feb 7, 2017
    Okay, it's a bit unusual, but is it possible to create a trainer that is invincible? In the game I'm making, I want to add an ultimate trainer, who will defeat the player once they engage into battle. Is it possible, and how do I do it?

    And, just to clarify, when I say invincible, I don't mean indescribably strong, but possible to defeat. I really mean undefeatable.
     
    It really depends on what you want to do to make the trainer invincible.

    You could make his Pokemon have an ability that makes them take 0 damage from everything(but not say anything).
     
    It really depends on what you want to do to make the trainer invincible.

    You could make his Pokemon have an ability that makes them take 0 damage from everything(but not say anything).
    This is a great idea. But I'm not a programmer. I don't even know in which script the abilities are defined. Any help in doing this would be greatly appreciated.

    You could have moves that are unobtainable, but let that trainer have them, that are like common ones, such as megavolt, just being a powerful thunderbolt, but have the same accuracy and pp for example, and things like that, and then have OP stats and OP abilities
    This was my initial idea, but it'd still be possible to beat the trainer. Hard, yes, but possible. I want the trainer to be absolutely invincible.
     
    Go to abilities.txt and define a new ability (name it whatever you want).

    Then, go to the script section "PokeBattle_Battler" and right under this:

    Code:
    if target.effects[PBEffects::Telekinesis]>0
    @battle.pbDisplay(_INTL("{1} makes Ground moves miss with Telekinesis!",target.pbThis))
    return false
    end
    end

    Add this:

    Code:
    return false if isConst?(target.ability,PBAbilities,:YOURABILITYNAME)

    And that's all. Give him powerful moves if you want so he can also kill players quickly, this ability just makes him inmune to all damage.

    Edit: Also, go to PokeBattle_Move and right under Minus/Plus code add this:

    Code:
    basedmg=(basedmg*2000.0).floor if isConst?(attacker.ability,PBAbilities,:YOURABILITYNAME)

    That makes the Pokémon with that ability deal massive damage with any move.
     
    Code:
    if target.effects[PBEffects::Telekinesis]>0
    @battle.pbDisplay(_INTL("{1} makes Ground moves miss with Telekinesis!",target.pbThis))
    return false
    end
    end
    There's only one "end" in the script. I've tried adding the line you wrote, but the game freezes every time the battle starts. Then it displays the message "The script is taking too long. The game will restart".
     
    Yeah, that was completely my fault. Put the code below this:

    Code:
    if isConst?(target.item,PBItems,:AIRBALLOON)
    @battle.pbDisplay(_INTL("{1}'s Air Balloon makes Ground moves miss!",target.pbThis))
    return false
    end
    end

    Now there should be 2 ends, so right after the second end should be your code. Sorry =P
     
    Okay, yeah, so I've added the code you wrote down, in the place you said, and now the game doesn't freeze. However, I'm not sure what I'm doing wrong, but the Pokemon is taking damage normally.
     
    It might be a typo. Are you sure that you put the exact internal name here?

    Code:
    return false if isConst?(target.ability,PBAbilities,:YOURABILITYNAME)

    Also, are you sure that your Pokémon has that ability? (this seems like a dumb question, but we have to discard all the possibilities)
     
    Yeah, I am. I've checked multiple times if the ability name in the scripts matches the one I've defined, and it does.

    As for the second question, yeah, I am pretty sure. I've edited the Pokemon in pokemon.txt to have the ability as its hidden ability, and then just defined the ability as "2" in trainers.txt. I hope I'm not doing something incredibly stupid here :\

    Just to be sure, is there any way to check what ability the opposing Pokemon has?
     
    I don't know dude, I'm pretty sure that this is a ridiculous error, I just can't figure out what it is. Try with this:

    Code:
    if isConst?(target.ability,PBAbilities,:YOURABILITY)
            return false 
          end

    It's literally the code for WonderGuard modified to fit the situation. I hope that works.
     
    As for the second question, yeah, I am pretty sure. I've edited the Pokemon in pokemon.txt to have the ability as its hidden ability, and then just defined the ability as "2" in trainers.txt.
    How? Did you edit the txt file directly, or did you use the Editor? Because there's a known bug where Essentials won't put Hidden Abilities into pokemon.txt when it edits it.
     
    I don't know dude, I'm pretty sure that this is a ridiculous error, I just can't figure out what it is. Try with this:

    Code:
    if isConst?(target.ability,PBAbilities,:YOURABILITY)
            return false 
          end

    It's literally the code for WonderGuard modified to fit the situation. I hope that works.
    Yeah, this one works :D !

    How? Did you edit the txt file directly, or did you use the Editor? Because there's a known bug where Essentials won't put Hidden Abilities into pokemon.txt when it edits it.
    You were right. I edited the file directly, and now I tried using the editor.

    It works now, thank you both so much :D
     
    Back
    Top