• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
    7
    Years
    • Seen May 18, 2024
    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?
     
  • 277
    Posts
    15
    Years
    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:

    Ego13

    hollow_ego
  • 311
    Posts
    6
    Years
    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