• 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.

Is this Trainer Card Usable?

Prof Oakley

JourneyofPossibilities Creator
75
Posts
11
Years
I made a trainer card with all of the badges on one side (with name, picture, time, money, date started spots too).

It has a spot for all 5 region's 8 badges and I didn't see anywhere you couldn't do that but I just wanted to know if there's a special script or code I have to write or put somewhere to make it align properly. (so the first region shows up on the top row, in the box it's supposed to be in)

Also, I added a second side of the card with 49 boxes for the 47 Legendaries to go into. I wanted to know if they could be used like badges in the way that when you catch one it shows the picture on the trainer card. It seems like a similar script to the gym badges showing up but I don't know if it would be the same or if I'd have to do some advance tweaks.

If I can use the second side, how do you activate the flip control on the trainer card?

I have a picture on DeviantART but I can't post the url since I don't have enough posts on here.

EDIT: The pngs of the cards are saved to the specifications on the wiki and of the default trainer cards in my graphics folder.
 
Last edited:

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
You could always put the images as attatchments... I myself can understand what ur trying to make... But we would need to see some sort of image to what you want... The flipping of the card is a slight edit to trainer card script probably an if statement if button right is pressed show one side if left show the other... As for badges position... Once a visual is given help would be easier but we can't just throw code at you without ore info
 

Prof Oakley

JourneyofPossibilities Creator
75
Posts
11
Years
Its on my deviantart which has a link in my signature. I cant put a direct link because i dont have enough posts yet.

Where do i find the trainer card scrpt?
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
For convenience, here is the trainer card design Oakley is talking about.
Spoiler:


The trainer card script is called PokemonTrainerCard. It's one of the easier scripts to edit, but I'm still not exactly sure how you should go about making the second side with the legendaries. Sorry!
Even be the easier, if you don't know about script you can't do.

Example: '$Trainer.owned[PBSpecies::ARTICUNO]' returns true if the Articuno is caught. You can put an 'if' clause to display the icon.
 

Prof Oakley

JourneyofPossibilities Creator
75
Posts
11
Years
So I could take the badge script:

if $Trainer.badges[i+region*8]
imagePositions.push(["Graphics/Pictures/badges",x,310,i*32,region*32,32,32])
end
x+=48
end

And add a script that says:

if $Trainer.owned[PBSpecies::ARTICUNO]
imagePositions.push(["Graphics/Pictures/legendaries",x,310,i*32,region*32,32,32])
end
x+=48
end
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
That's pretty much how to do it $Trainer.owned[species number] works too, less writing that's all... But add ==true at the end so

$Trainer.owned[144]==true

This checks to see if species is owned and returns true if it is and false if it isn't.

But that's only if you want that certain species to show the whole side other wise you would need to find positions of all PNG files separately but use the same method.
 

Prof Oakley

JourneyofPossibilities Creator
75
Posts
11
Years
and the pictures will show up in the right boxes like with the badges?

EDIT: I put in the legendaries on the back of the card to give an idea of what it will look like (not the sprites I'm using but I haven't gotten that far yet).
Each Box is 62x39 pixels (while badges are 32x32 I believe).

So if I put in the script:

$Trainer.owned[151]==true

when they catch mew it would show up like when they get a badge?
or would I have to put a new picture with the legendaries lined up like the badges and put in some sort of grid/coordinates system?

Spoiler:
 
Last edited:

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
That's pretty much how to do it $Trainer.owned[species number] works too, less writing that's all... But add ==true at the end so

$Trainer.owned[144]==true

This checks to see if species is owned and returns true if it is and false if it isn't.

But that's only if you want that certain species to show the whole side other wise you would need to find positions of all PNG files separately but use the same method.
I prefer to use the internal names for better code maintenance. The "==true" for booleans isn't needed.
and the pictures will show up in the right boxes like with the badges?

EDIT: I put in the legendaries on the back of the card to give an idea of what it will look like (not the sprites I'm using but I haven't gotten that far yet).
Each Box is 62x39 pixels (while badges are 32x32 I believe).

So if I put in the script:

$Trainer.owned[151]==true

when they catch mew it would show up like when they get a badge?
or would I have to put a new picture with the legendaries lined up like the badges and put in some sort of grid/coordinates system?

Spoiler:
You can do this putting separate pictures or one big and putting coordinates system.
The example of second way (note that I haven't tested):

Code:
#Put all legendary pokémon in order that it show in picture
legendary=[
  PBSpecies::ARTICUNO,PBSpecies::ZAPDOS,PBSpecies::MOLTRES,
  PBSpecies::MEWTWO,PBSpecies::MEW,PBSpecies::RAIKOU,
  PBSpecies::ENTEI,PBSpecies::SUICUNE,PBSpecies::LUGIA
]
basex=180 #Base x coordinate, change it to fill in card.
basey=180 #Base y coordinate, change it to fill in card.
imgwidth=62
imgheight=39
columnmax=7
#Base y coordinate
for i in 0...legendary.length
  if $Trainer.owned[legendary[i]]
   imagePositions[imagePositions.length]=[
      "Graphics/Pictures/legendaries",
          basex+imgwidth*(i%columnmax),basey+imgheight*(i/columnmax),
          imgwidth*(i%columnmax),imgheight*(i/columnmax),imgwidth,imgheight
   ]
  end
end
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
and I just add a new if $Trainer.owned... for each legendary pokemon? with ii, iii, iv, v, vi?
No, this script already checks every one in "legendary" array. Just fill it with other legendaries.
 

Prof Oakley

JourneyofPossibilities Creator
75
Posts
11
Years
oh alright, so I just add them in the PBSpecies list in the order they are in the picture.

Side question, is there a site or some program I can learn all this so I don't bug you guys all the time? even if it's just the basics so I learn things like array?
 

Prof Oakley

JourneyofPossibilities Creator
75
Posts
11
Years
I should have asked this before but I didn't seem to think of it >< the basex and basey numbers are the pixels right? and they start at the upper right corner of the first pokemon's box?
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
Top left corner, but yes. The locations of things are always determined by their top left point, unless you do fancy things by changing picture origins (but that's not the case here).
 
Back
Top