• 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!
  • 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.

[Error] Trying to have a wild pokemon hold an item.

  • 11
    Posts
    6
    Years
    • Seen Aug 27, 2019
    I have made a custom form for swampert and an item to transform swampert into this form then made a script to have wild pokemon hold a specific item. I get the error when starting the encounter.
    This is the error message:
    ---------------------------
    Pokemon Essentials
    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: RuntimeError

    Message: Script error within event 3 (coords 22,4), map 142 (Eltheosis Swamp):

    Exception: NameError

    Message: PField_EncounterModifiers:19undefined local variable or method `poke' for nil:NilClass

    ***Full script:

    pbWildBattle(:SWAMPERT,70,1)


    Interpreter:243:in `pbExecuteScript'

    PField_EncounterModifiers:16:in `call'

    EventHandlers:54:in `trigger'

    EventHandlers:49:in `each'

    EventHandlers:49:in `trigger'

    PField_Encounters:389:in `pbGenerateWildPokemon'

    PField_Battles:88:in `pbWildBattle'

    (eval):1:in `pbExecuteScript'

    Interpreter:1606:in `eval'

    Interpreter:243:in `pbExecuteScript'



    Interpreter:276:in `pbExecuteScript'

    Interpreter:1606:in `command_355'

    Interpreter:494:in `execute_command'

    Interpreter:193:in `update'

    Interpreter:106:in `loop'

    Interpreter:198:in `update'

    Scene_Map:163:in `update'

    Scene_Map:161:in `loop'

    Scene_Map:170:in `update'

    Scene_Map:234:in `main'
     
    Message: PField_EncounterModifiers:19undefined local variable or method `poke' for nil:NilClass
    Your code is trying to use "poke" but it doesn't exist on the object. I can't give a better explanation without seeing the code, but maybe someone else has a good idea? I'm sure there's a wiki page that could explain this one to you.
     
    I have made a custom form for swampert and an item to transform swampert into this form then made a script to have wild pokemon hold a specific item. I get the error when starting the encounter.

    Exception: RuntimeError

    Message: Script error within event 3 (coords 22,4), map 142 (Eltheosis Swamp):

    Exception: NameError

    Message: PField_EncounterModifiers:19undefined local variable or method `poke' for nil:NilClass

    Your code is trying to use "poke" but it doesn't exist on the object. I can't give a better explanation without seeing the code, but maybe someone else has a good idea? I'm sure there's a wiki page that could explain this one to you.

    PField_EncounterModifiers dont recognize 'poke' yet. Try to change 'poke' to 'pokemon'.

    Code:
    pokemon.form
    (i.e.)
     
    Last edited:
    Back
    Top