< >
Hello, guest! Please log in or register.

The PokéCommunity

Go Back     The PokéCommunity Forums > Create & Discover > Game Development > Pokémon Essentials undefined method `pbGetPokemon'

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

Reply Post Reply
 
Thread Tools
  #1    
Old January 29th, 2013 (8:24 AM).
desbrina's Avatar
desbrina desbrina is offline
Lightning Yellow Creator
 
Join Date: Feb 2011
Location: UK
Gender: Female
Nature: Quiet
Posts: 561
I'm getting the following error

Message: Section157:115:in `pbGTS'undefined method `pbGetPokemon' for #<GTSScene:0xa515200>

Within a custom script i'm trying to make

This is the code i've got

Code:
pbChoosePokemon(1,3)
          if $game_variables[1] < 0
            break
          end
          if (pbGetPokemon(1).species == 25) && (pbGetPokemon(1).form == 1)
            Kernel.pbMessage("This Pokemon cannot currently be offered")
            break
          end
Creator of


A Pokemon Yellow remake, using HGSS Tiles, and the ability to obtain all Kanto Pokemon as well as their previous/later evolutions.

Reply With Quote

Relevant Advertising!

  #2    
Old January 29th, 2013 (8:59 AM).
macrpg's Avatar
macrpg macrpg is offline
 
Join Date: Jan 2011
Gender: Male
Posts: 12
I'm not sure, but I think the code should be:
Spoiler:

pbChoosePokemon(1,3)
if $gamevariable[1] < 0
break
end
poke=PbGetPokemon(1)
If (poke.species ==25) && (poke.form==1)
Kernel.pbMessage ("This Pokémon can't be offered")
break
end

But again, I'm not sure
Reply With Quote
  #3    
Old January 29th, 2013 (2:38 PM).
desbrina's Avatar
desbrina desbrina is offline
Lightning Yellow Creator
 
Join Date: Feb 2011
Location: UK
Gender: Female
Nature: Quiet
Posts: 561
nope, still gives the undefined method
Creator of


A Pokemon Yellow remake, using HGSS Tiles, and the ability to obtain all Kanto Pokemon as well as their previous/later evolutions.

Reply With Quote
  #4    
Old January 29th, 2013 (3:36 PM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,949
That method is only usable from within events.

You could use this instead:

Code:
pbChoosePokemon(1,3,proc {|poke|
   !(isConst?(poke,PBSpecies,:PIKACHU) && poke.form==1)
})
break if pbGet(1)<0
It won't let the player choose a form 1 Pikachu in the first place.
Reply With Quote
  #5    
Old January 29th, 2013 (3:44 PM).
desbrina's Avatar
desbrina desbrina is offline
Lightning Yellow Creator
 
Join Date: Feb 2011
Location: UK
Gender: Female
Nature: Quiet
Posts: 561
Thats not erroring but it is allowing me to select a form 1 pikachu
Creator of


A Pokemon Yellow remake, using HGSS Tiles, and the ability to obtain all Kanto Pokemon as well as their previous/later evolutions.

Reply With Quote
  #6    
Old January 29th, 2013 (3:59 PM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,949
This, then.
Code:
pbChoosePokemon(1,3,proc {|poke|
   !(isConst?(poke.species,PBSpecies,:PIKACHU) && poke.form==1)
})
break if pbGet(1)<0
Reply With Quote
Reply Post Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


  All times are GMT -8. The time now is 2:46 PM.


Contact Us Archive Privacy Statement Terms of Service Top