• 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] What PKMN is fighting?

163
Posts
7
Years
    • Seen yesterday
    Maybe it's a bit basic question ... Maybe it's a question nobody has answered yet ...

    Is there any way in a script to check which Species is in battle at that time?
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • We need to know why you want to use it. We have Charjabug's abilities, Pusle and Minus.
    Anyway, are you tryibg to make a move, ability or item to trigger or use into the battle?
     
    163
    Posts
    7
    Years
    • Seen yesterday
    I am trying to check on the EBS when a specific Pokemon is defeated, happen X thing, for example, put a specific message.
     
    163
    Posts
    7
    Years
    • Seen yesterday
    Check how Battle Bond works and edit for what you want:
    https://www.pokecommunity.com/showthread.php?t=417208

    I am trying this on EBS, for example

    if isConst?(species,PBSpecies,:PIKACHU)
    @battle.pbDisplay(_INTL("¡Pikachu no!",pbThis))
    end

    And I get this error

    ---------------------------
    Pokemon Anthology
    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: NameError

    Message: undefined local variable or method `species' for #<PokeBattle_Scene:0xec83120>

    EliteBattle_1:688:in `pbFainted'

    PokeBattle_Battler:790:in `pbFaint'

    PokeBattle_Battler:3370:in `pbProcessMoveAgainstTarget_ebs'

    EliteBattle_0:475:in `pbProcessMoveAgainstTarget'

    PokeBattle_Battler:3830:in `pbUseMove_ebs'

    PokeBattle_Battler:3810:in `loop'

    PokeBattle_Battler:3833:in `pbUseMove_ebs'

    EliteBattle_0:510:in `pbUseMove'

    PokeBattle_Battler:4042:in `pbProcessTurn'

    PokeBattle_Battler:4041:in `logonerr'
     
    Last edited:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Read your error "undefined local variable or method `species'". Check where you put that code and search other code that use 'species' and copy.
    You need to put something before, like self.species or battler.species or user.species. Anyway, trial and errors!
     
    Back
    Top