• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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] Need Help with v17 scripting.

  • 30
    Posts
    7
    Years
    undefined method error

    Hi there. I was wondering if someone can maybe help me with this error.
    Im using pokemon essentials v17.2.
    busy working on a PokeMount script and bumped into this error whenever im changing a setting from one of Ulithium_Dragon's settings.

    [PokeCommunity.com] Need Help with v17 scripting.

    If someone can help pls reply so I can elaborate.

    Thanks.
     
    Basically you have an object that is not defined or a variable that is unassigned somewhere. So when the script pbHasSpecies tries to run the method pokemonParty on this object, instead of running that method on the appropriate class, it tries to run it in nil class (because that's where all undefined objects go) and there's no pokemonParty method defined there.
    So, how to fix? Look in the script pbHasSpecies for where it calls something.pokemonParty. the problem is with whatever something turns out to be. It might be an argument that was never received or something father back that was defined wrong. You'll have to follow the breadcrumbs.
     
    Hi,Im gonna make this short.

    If anybody can help, i will be more then happy.
    Im using PE v17.2

    Im creating a piece of code to register a pokemon to a device but only when it is in the pokemon party.
    I dont want to edit in the maker's scripts and rather do plug and play.


    Ive tried codes like this to check if the species exists.

    CODE IE:

    ---------------------------------------------
    class Party_map < Game_Map
    alias check_party update
    def update

    check_party

    if pbHasSpecies?(:TAUROS)... .... ....
    #my code
    end

    end #for def
    end #for class
    ---------------------------------------------

    for some reason my code does not execute.

    and if I use class Game_Map instead of a subclass.
    I get this error.
    [PokeCommunity.com] Need Help with v17 scripting.

    Any Help and guidance will be appreciated.
     
    Last edited by a moderator:
    moved to the correct forum; gl~
     
    I think that using Game_Map instead of a subclass is probably correct (but maybe there's some sensible way to make your subclass get used by the rest of the code?). In any case I have no idea what pbHasSpecies? calls pokemonParty on, but as the error says that value is nil (which probably means it's not initialized since this is code you didn't write—in your own code it normally means that you didn't define the variable at all); presumably it's the player so you might need to check that a $Trainer object actually exists?
     
    Last edited:
    So, try to change 'pbHasSpecies?(:TAUROS)' to 'if isConst?(pokemon.species,PBSpecies,:TAUROS)' and check what 'pokemon' could be inside the code.
    To 'Pokemon_Sprites' script is '@pokemon', to Day_Care is '$PokemonGlobal.daycare[index][0]'.
    Find its 'pokemon' definition to that.

    Thanks buddy, will give it a go later on.
    Should i call a class with that?
     
    Back
    Top