• 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!
  • Dawn, Gloria, Juliana, or Summer - 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.

[Scripting Question] Editing the Compiler to check for additional parameters from pokemon.txt

  • 14
    Posts
    8
    Years
    • Seen Apr 15, 2025
    This may be a stupid question, but I was trying to implement intrinsic levitation in Pokemon Essentials (basically, if a Pokemon could levitate without needing an ability) and decided to make a new parameter in pokemon.txt to determine this.

    Unfortunately, I have no idea how to edit the compiler so it actually acknowledges that I've added a new parameter to pokemon.txt.

    As far as I can tell, I have to edit pbCompilePokemonData in the compiler; would anybody be able to help me figure out how to implement this?
     
    How about adding the Pokemon to the list of airborne exceptions?
    I can't quite seem to get it to work, but I believe it would be a lot easier than trying to edit the compiler.

    Code:
    def isAirborne?(ignoreability=false)
        return false if self.hasWorkingItem(:IRONBALL)
        return false if @effects[PBEffects::Ingrain]
        return false if @effects[PBEffects::SmackDown]
        return false if @battle.field.effects[PBEffects::Gravity]>0
        return true if self.pbHasType?(:FLYING) && !@effects[PBEffects::Roost]
        return true if self.hasWorkingAbility(:LEVITATE) && !ignoreability
        return true if self.hasWorkingItem(:AIRBALLOON)
        return true if @effects[PBEffects::MagnetRise]>0
        return true if @effects[PBEffects::Telekinesis]>0
        [COLOR="Red"]return true if isConst?(pokemon.species,PBSpecies,:MAGNEMITE)[/COLOR]
        return false
      end
     
    Last edited:
    I agree, that it is easier to add all the Pokemon in the code as an array and checking against it. The compiler is a lot harder to modify and probably would result in more errors. Plus I think it is also easy to just create the array instead of editing the PBS.

    I recommend a setup like this (untested):
    Code:
    $levitatingPokemon=[:MAGNEMITE,:HAUNTER,:CASTFORM]
    def isAirborne?(ignoreability=false)
        return false if self.hasWorkingItem(:IRONBALL)
        return false if @effects[PBEffects::Ingrain]
        return false if @effects[PBEffects::SmackDown]
        return false if @battle.field.effects[PBEffects::Gravity]>0
        return true if self.pbHasType?(:FLYING) && !@effects[PBEffects::Roost]
        return true if self.hasWorkingAbility(:LEVITATE) && !ignoreability
        return true if self.hasWorkingItem(:AIRBALLOON)
        return true if @effects[PBEffects::MagnetRise]>0
        return true if @effects[PBEffects::Telekinesis]>0
        return true if $levitatingPokemon.include?(self.species)
        return false
      end
     
    Back
    Top