Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Reload this Page undefined method `pbGetPokemon'

Notices
For all updates, view the main page.

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
 
Thread Tools
  #1    
Old January 29th, 2013 (08:24 AM).
desbrina's Avatar
desbrina desbrina is offline
Lightning Yellow Creator
 
Join Date: Feb 2011
Location: UK
Age: 26
Gender: Female
Nature: Quiet
Posts: 545
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
  #2    
Old January 29th, 2013 (08: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 (02:38 PM).
desbrina's Avatar
desbrina desbrina is offline
Lightning Yellow Creator
 
Join Date: Feb 2011
Location: UK
Age: 26
Gender: Female
Nature: Quiet
Posts: 545
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 (03:36 PM).
Maruno's Avatar
Maruno Maruno is online now
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,152
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 (03:44 PM).
desbrina's Avatar
desbrina desbrina is offline
Lightning Yellow Creator
 
Join Date: Feb 2011
Location: UK
Age: 26
Gender: Female
Nature: Quiet
Posts: 545
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 (03:59 PM).
Maruno's Avatar
Maruno Maruno is online now
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,152
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
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 UTC -8. The time now is 06:44 AM.