Hello, this is a nice post but I need help getting my badges to appear on the trainer card. No matter what I do they're just blank boxes on the card
imagePositions.push(["Graphics/Pictures/badges",x,y,j*32,i*32,32,32])
imagePositions.push(["Graphics/Pictures/Trainer Card/badges",x,y,j*32,i*32,32,32])
Hello, I'm really hoping that you are still around and fine with helping out. I'm currently working on making a game with 18 gym badges. 2 rows of 9 but I'm extremely new to coding. After adding the codes in that you've posted and adjusted them to what i think to be correct, i keep getting a weird error. I'll post all of the relevant images in this post as well as the coding I have input. I greatly appreciate any and all help you can provide.wow talk about a blast from the past.
the code just needs a few more edits
Code:x=72 # x coordinate of left most badge slot y=243 # y coordinate of top most badge slot imagePositions=[] for i in 0...3 #change 3 to total number of regions for j in 0...8 #change 8 number of badges in a row if $Trainer.badges[j+i*8] #change 8 to number of badges in a row imagePositions.push(["Graphics/Pictures/badges",x,y,j*32,i*32,32,32]) # These 32's are the dimensions of each badge (not sure if you changed that) end x+=48 # distance between the top left corners of two badge slots beside each other end x=72 y+=38 # distance between the top left corners of two badge slots on top of each other end
Same deal in the end, just a few more edits.
$Trainer
anymore).pbDrawTextPositions(overlay, textPositions)
to pbDrawImagePositions(overlay, imagePositions)
with the below pbDrawTextPositions(overlay, textPositions)
x = 32
y = 262
imagePositions = []
2.times do |row| # number of rows
9.times do |badge| # number of badges in a row
if $player.badges[badge + (row * 9)] # number of badges in a row
imagePositions.push(["Graphics/UI/Trainer Card/icon_badges", x, 310, badge * 32, row * 32, 32, 32])
end
x += 48
end
x = 32
y += 38 # distance between top of one row to the top of the next
end
pbDrawImagePositions(overlay, imagePositions)
[poked for notification]
ThankYour code doesn't match the correct number of ends. You are missing an end, as well as the method call that actually draws the images.
v21 also changes how the code would work (mostly just that it's not$Trainer
anymore).
Go back to a clean version of that script section, and replace everything frompbDrawTextPositions(overlay, textPositions)
topbDrawImagePositions(overlay, imagePositions)
with the below
Ruby:pbDrawTextPositions(overlay, textPositions) x = 32 y = 262 imagePositions = [] 2.times do |row| # number of rows 9.times do |badge| # number of badges in a row if $player.badges[badge + (row * 9)] # number of badges in a row imagePositions.push(["Graphics/UI/Trainer Card/icon_badges", x, 310, badge * 32, row * 32, 32, 32]) end x += 48 end x = 32 y += 38 # distance between top of one row to the top of the next end pbDrawImagePositions(overlay, imagePositions)
I really appreciate the assistance! that seemed to fix letting me back into the game and being able to test, but I'm now seeing this when I click into the trainer card location of the player options.Your code doesn't match the correct number of ends. You are missing an end, as well as the method call that actually draws the images.
v21 also changes how the code would work (mostly just that it's not$Trainer
anymore).
Go back to a clean version of that script section, and replace everything frompbDrawTextPositions(overlay, textPositions)
topbDrawImagePositions(overlay, imagePositions)
with the below
Ruby:pbDrawTextPositions(overlay, textPositions) x = 32 y = 262 imagePositions = [] 2.times do |row| # number of rows 9.times do |badge| # number of badges in a row if $player.badges[badge + (row * 9)] # number of badges in a row imagePositions.push(["Graphics/UI/Trainer Card/icon_badges", x, 310, badge * 32, row * 32, 32, 32]) end x += 48 end x = 32 y += 38 # distance between top of one row to the top of the next end pbDrawImagePositions(overlay, imagePositions)
your code somehow has an extra pbDrawImagePositions (the one on line 65 is the issue)Thank
I really appreciate the assistance! that seemed to fix letting me back into the game and being able to test, but I'm now seeing this when I click into the trainer card location of the player options.
Okay, so i fixed those problems and there's 1 thing left, for some reason the badges are layering on top of one anotheryour code somehow has an extra pbDrawImagePositions (the one on line 65 is the issue)
Compare your highlighted code (lines 65 to 79) with my code block.
I made a mistake.Okay, so i fixed those problems and there's 1 thing left, for some reason the badges are layering on top of one another
Thank you so much! I've gotta fix the badges images themselves but it's perfect!I made a mistake.
replace 310 with y