The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Create & Discover > Game Development > Pokémon Essentials
Reload this Page Pokedex Check
Sign Up Rules/FAQ Daily Battle Blogs Mark Forums Read

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.

Thread Tools
Old November 8th, 2012 (5:13 AM).
thor348's Avatar
thor348 thor348 is offline
That's Oak to You
Join Date: Nov 2012
Location: Albion
Gender: Male
Nature: Calm
Posts: 135
I've been coding with C++ for years but can't seem to figure this out cause Ruby is different. My question is, how would I make professor Oaks Assistant check how many pokemon you've caught so he can give you an egg? or HM?
Reply With Quote

Relevant Advertising!

Old November 8th, 2012 (9:26 AM).
Umbra's Avatar
Umbra Umbra is online now
Platinum Tier
Join Date: Aug 2009
Location: Nearby my feet.
Age: 19
Gender: Female
Nature: Calm
Posts: 1,739
Not really teh best then, usually in c++ when I handle arrays I do something like this:

bool seen[649];
int seen_amt=-1; // This could be 0 depending on how you build up you program.
now you can do the same for caught, and every time the play catches a pokemon just add 1 to caught_amt. OR you could use the longer (in terms of processing) way:

int pokemon_caught()
  int i, amt=0;
  for (i=0; i<649; i++){
    if (caught[i] == true){
  return amt;
Well anyways, depending on what your situation is, the one is better than the other.

NOTE: the 649 is just what I used because of regions 1-5 have 649 in total, you may obviously change this if you want to.
Reply With Quote
Old November 8th, 2012 (10:01 AM). Edited November 8th, 2012 by DaSpirit.
DaSpirit's Avatar
DaSpirit DaSpirit is offline
Mad Programmer
Join Date: Jul 2007
Location: New York City
Gender: Male
Nature: Quiet
Posts: 240
Originally Posted by hansiec View Post
Not really the best then, usually in c++ when I handle arrays I do something like this:

bool seen[649];
int seen_amt=-1; // This could be 0 depending on how you build up you program.
Not the best C++.

Using booleans are a bad choice for something like this. Because you're using many booleans at once, it is better to use a bitset. You can just use 64bit variables, and use bitwise operations to set whether a Pokemon has been caught or not. Then, instead of looping through your variables, you can simply test whether they have reached the maximum amount (all bits are equal to 1) with a simple equal sign. Because you're using 64bits and you want to test for 649 Pokemon, you need 11 64bit variables.

It's a lot faster and uses less memory. 11 64 bit variables is equal to 88 bytes, compared to 649 bytes if you use a bool. I wouldn't know the implementation in Ruby, but that was sort of a pseudo-code for you.

Check out the Wikia, it shows how you can mark a Pokemon as seen in Essentials:
Check the Pokedex script, as it lists how many Pokemon have been seen. Just copy that script.
Reply With Quote
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 6:43 AM.

Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2016 The PokéCommunity™,
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / Poké
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2016.