• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

[Discussion] How Pokémon data is defined

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
This is a technical discussion about how particular aspects of a Pokémon (in particular, gender, nature, etc.) are defined.

As we all know (ahem), a Pokémon's personal ID number defines its gender, nature, ability and shininess. And frankly, it's irritating. There's no way to set all four for a Pokémon at the same time. The nearest we've got is something that sets gender plus nature, and abilityflag which means it doesn't need to be worried about quite as much. There's still shininess, though.

As mentioned, abilityflag exists, which is an override for the ability. It's very convenient.

What I was wondering is this: Could/should Essentials have similar override flags for gender, nature and shininess?

Pros:
# It'd be easy to change one flag without affecting the other things that depend on the personal ID number, thus making many lives easier.
# abilityflag already does it, and no one's complaining (I don't think such a thing exists in the official games).
# Considering trading and all that, compatibility isn't a problem, because a game will tend to only be compatible with itself.

Cons:
# It's not how the official games do it.
# There are still other things that depend on the personal ID number (e.g. Hidden Power), so it can't just be removed.
# If for some strange reason the flags are ignored, things go screwy (but why would they be ignored?).

Taking the flag idea to the extreme, they could even replace the personal ID-based calculations, i.e. have nature be rand(25) when the Pokémon is generated, nothing more. As mentioned, the personal ID couldn't be removed completely, but what it is used for could at least be lessened to make lives easier (because who really cares about setting a Pokémon's Hidden Power?).

Whether it's left as it is, or more flags are added (to whatever extent), Pokémon would look just the same to the player. It's just a matter of how it works in the background.

Basically, it's a question of convenience versus keeping things working like the official games.

Thoughts?
 

Ho-oh 112

Advance Scripter
311
Posts
13
Years
  • Age 28
  • Seen Mar 8, 2014
Could/should Essentials have similar override flags for gender, nature and shininess?


pokemon.nature = setNature(nature)
pokemon.abilityflag = ability
pokemon.makeShiny
pokemon.gender = gender

yet for some reason the pIDs are different,
you can write a pokemon's internal data by doing this:
define the pokemon, then do this:

p pokemon

It'll print you a fixnum of the pokemon which can be converted to a string by putting it into a ".txt" file and from a string to fixnum and added again by using "pokemon.flatten!"

Not sure if this is really what you meant by other ways to define pokemon, but here's a small thing for ya.

EDIT:
Setting the pID then the other stats would be a high chance of the same pID, I'm not sure that's why I used "high chance"
and not will

EDIT2:
No, I just tested it....

EDIT3:
How does this small code skip the process of changing the pID?:
Code:
  def abilityflag
    return @abilityflag if @abilityflag
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,@species,29)
    ret1=dexdata.fgetb
    ret2=dexdata.fgetb
    dexdata.close
    if ret1==ret2 || ret2==0
      return 0
    end
    return (@personalID&1)
  end
 
Last edited:

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
pokemon.nature = setNature(nature)
pokemon.abilityflag = ability
pokemon.makeShiny
pokemon.gender = gender

yet for some reason the pIDs are different,
you can write a pokemon's internal data by doing this:
define the pokemon, then do this:

p pokemon

It'll print you a fixnum of the pokemon which can be converted to a string by putting it into a ".txt" file and from a string to fixnum and added again by using "pokemon.flatten!"

Not sure if this is really what you meant by other ways to define pokemon, but here's a small thing for ya.

EDIT:
Setting the pID then the other stats would be a high chance of the same pID, I'm not sure that's why I used "high chance"
and not will

EDIT2:
No, I just tested it....

EDIT3:
How does this small code skip the process of changing the pID?:
Code:
  def abilityflag
    [COLOR=Red]return @abilityflag if @abilityflag[/COLOR]
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,@species,29)
    ret1=dexdata.fgetb
    ret2=dexdata.fgetb
    dexdata.close
    if ret1==ret2 || ret2==0
      return 0
    end
    return (@personalID&1)
  end
I don't think you get what I'm on about. Incidentally, the nature and gender lines at the top of your post are wrong - they simply can't be defined like that (although the point of this thread is to ask: why not?).

If you change a Pokémon's gender, what it actually does is change the personal ID until it comes up with one that's the required gender. Changing the personal ID will also affect nature, ability and shininess, since they all depend on it.

The line I put in red is what skips the personal ID when looking at the ability. It's pretty simple code, compared to what you've been churning out recently.
 

Ho-oh 112

Advance Scripter
311
Posts
13
Years
  • Age 28
  • Seen Mar 8, 2014
I don't think you get what I'm on about. Incidentally, the nature and gender lines at the top of your post are wrong - they simply can't be defined like that (although the point of this thread is to ask: why not?).

If you change a Pokémon's gender, what it actually does is change the personal ID until it comes up with one that's the required gender. Changing the personal ID will also affect nature, ability and shininess, since they all depend on it.

The line I put in red is what skips the personal ID when looking at the ability. It's pretty simple code, compared to what you've been churning out recently.


Why not remove it, oh yeah the hidden power....

Why not make the hidden power reliable on something else, or atleast remove the shininess/gender/nature from it.... really it doesn't bother me rightnow, but if you think you should then.... why not just make hidden power based of another atribute.....

EDIT:
Yeah sorry 'bout the error, I was getting tired....
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
In addition to the four properties I've mentioned, the personal ID also determines where Spinda's spots are, how Wurmple evolves and Unown's form. Interestingly, in Gen 4 and 5, Unown's form is just another variable, and doesn't depend on the personal ID. Oh, it turns out I was wrong about Hidden Power - it depends on IVs instead.

I could change the system in an afternoon; that's not the problem. My question is whether I should. I know people like Essentials to work just like the official games, which makes sense for things that the player actually sees, but this is solely the background system. Would people care if it was changed?
 

Ho-oh 112

Advance Scripter
311
Posts
13
Years
  • Age 28
  • Seen Mar 8, 2014
In addition to the four properties I've mentioned, the personal ID also determines where Spinda's spots are, how Wurmple evolves and Unown's form. Interestingly, in Gen 4 and 5, Unown's form is just another variable, and doesn't depend on the personal ID. Oh, it turns out I was wrong about Hidden Power - it depends on IVs instead.

I could change the system in an afternoon; that's not the problem. My question is whether I should. I know people like Essentials to work just like the official games, which makes sense for things that the player actually sees, but this is solely the background system. Would people care if it was changed?


You can change the unown forms easily by using the form function right?

Spinda spots I knew was random but.... WHO REALLY CARES ABOUT EM!?!?! Ok, that's good that hidden power doesn't rely on the pID, so.... er yeah, I guess I answered the other 2 things right?
 

DarkDoom3000

Super Pokemon Eevee Edition
1,715
Posts
19
Years
took me a few posts to get it.

So you can't change any personal ID attributes without generating a whole new ID, thus screwing up the other attributes. In that case; yeah, make overrides for all.

You don't have to remove the PID, just make it give the defaut attributes, then have the overrides if you want something else. thus it won't effect hidden power and spinda and whatnot.
 

IceGod64

In the Lost & Found bin!
624
Posts
15
Years
I say go for it; Essentials doesn't operate exactly like the base game as it is, and I'm all for convenience Vs. Accuracy.
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
I don't think thats this is necessary because you can use this:
(is an example, don't try to execute)
Code:
while(true)
 pokemon.generate
 break if (pokemon.nature==nature && pokemon.gender==gender && pokemon.isShiny)
end
This can be only interesting if you think of changing the nature of a player pokémon.
 
Back
Top