Resource icon

Display IV/EVs in V17

In script section PScreen_Summary, find def drawPageThree. This is what defines what appears when the player looks at the third page of the summary section. The textpost part of it defines what text will be drawn.

Replace the existing text with this code:

[_INTL("HP"),292,76,2,base,shadow],
[sprintf("%d/%d",@pokemon.hp,@pokemon.totalhp),420,76,1,Color.new(64,64,64),Color.new(176,176,176)],
[sprintf("%d/%d",@pokemon.iv[0],@pokemon.ev[0]),475,76,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Attack"),248,120,0,base,statshadows[0]],
[sprintf("%d",@pokemon.attack),400,120,1,Color.new(64,64,64),Color.new(176,176,176)],
[sprintf("%d/%d",@pokemon.iv[1],@pokemon.ev[1]),475,120,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Defense"),248,152,0,base,statshadows[1]],
[sprintf("%d",@pokemon.defense),400,152,1,Color.new(64,64,64),Color.new(176,176,176)],
[sprintf("%d/%d",@pokemon.iv[2],@pokemon.ev[2]),475,152,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Sp. Atk"),248,184,0,base,statshadows[3]],
[sprintf("%d",@pokemon.spatk),400,184,1,Color.new(64,64,64),Color.new(176,176,176)],
[sprintf("%d/%d",@pokemon.iv[4],@pokemon.ev[4]),475,184,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Sp. Def"),248,216,0,base,statshadows[4]],
[sprintf("%d",@pokemon.spdef),400,216,1,Color.new(64,64,64),Color.new(176,176,176)],
[sprintf("%d/%d",@pokemon.iv[5],@pokemon.ev[5]),475,216,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Speed"),248,248,0,base,statshadows[2]],
[sprintf("%d",@pokemon.speed),400,248,1,Color.new(64,64,64),Color.new(176,176,176)],
[sprintf("%d/%d",@pokemon.iv[3],@pokemon.ev[3]),475,248,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Ability"),224,284,0,base,shadow],
[PBAbilities.getName(@pokemon.ability),362,284,0,Color.new(64,64,64),Color.new(176,176,176)],


The result will look like this:




How could we edit this code? Let's look at a line and what its components are.

[sprintf("%d",@pokemon.defense),400,152,1,Color.new(64,64,64),Color.new(176,176,176)],

  • [sprintf is the code used to start a line where you draw a variable. ("%d" decides how it will be written, with %d being the variable pulled. If you use multiple variables, you will need more %d included in the quotation marks. Some defined characters may be used, such as the / shown here.
  • Before the ), you will put where you want the variables to be pulled from. They will be substituted for the %d in the same order-the first variable will go in the first %d, the second in the second, and so on.
  • If you want to draw text that doesn't vary, like the word "Defense" that comes before this, then you would instead use [_INTL. All you would need in your (" ") is the text you want to write.
  • The three variables after the ) are the X, Y, and Z values of your text's position. X is its position horizontally-0 is the farthest left, and as the numbers climb up, the text is moved farther right. Y is its position vertically-0 is the farthest up, and as the numbers climb up, the text is moved farther down. Z is its position in regards to depth. You would only need to edit this if you had text overlapping, as it would determine which text was displayed on top of the other.
  • Color.new(64,64,64) determines the first color that will be used to draw the text. It's written in RGB format. Essentials has some default colors that function the same as this, like the base and shadow used in Defense.
  • Color.new(176,176,176), because it comes after the previous Color.new, determines the color used to write the text's shadow. It works exactly the same, it just writes slightly down and to the write, to give the shadow effect. (You can only draw one base and one shadow in a line, though-adding a third color won't give you a shadow to the shadow, it'll just give you an error)
  • ], close our [ and get it ready for the next-it's very important not to forget them!

What could we do with this information? Pretty much anything! We can change the color scheme to suit a new background, rearrange the text for different borders, or even ditch the list format altogether! Try messing around and see what designs you can come up with!

I really like Bulbapedia's stat colors, though they don't translate well to the default background. (And I also overwrote the colors indicating stats affected by natures here)
Credits
If you plugged in my code directly, I'd appreciate credits to TechSkylander1518. If you made any kind of edits, no credit needed!
Author
TechSkylander1518
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from TechSkylander1518

Top