- 1,224
- Posts
- 10
- Years
- Omnipresence
- Seen Aug 8, 2023
This script/accompanying event generates a new animation for the pokecenter; both displaying the balls on the healing machine one at a time, and uses the appropriate graphics to reflect what balls your pokemon are in (Master, Great, Dive, etc)
When copying and pasting scripts from pokecommunity, use Thread Tools -> Printable Version
There is a formatting problem that breaks some scripts. If you encounter a "Syntax error", your lack of reading this warning is most likely the cause.
First thing, add this script in a new section above the main.
And add this folder (which contains the graphics for each ball) into Graphics/Pictures
https://www.mediafire.com/download/ucad4vbtut2q4t9/Balls.rar
Now, for setting up the events.
Instead of making this overcomplicated, I've just made an example map with the necessary events.
Download here: https://www.mediafire.com/download/05bi57377zg76b6/Map009.rxdata
Note that this map's number is 009, so you'll probably have to change that before adding it to your game to avoid overwriting a previous map.
Video of this working:
PS: To add a new ball's graphic, just put it in the same folder. Named "ball_X", where X is it's ID number (if you'd added a new ball, you've defined this.) If a ball graphic is not found for a particular ball, it defaults to "ball_0", which is a pokeball.
When copying and pasting scripts from pokecommunity, use Thread Tools -> Printable Version
There is a formatting problem that breaks some scripts. If you encounter a "Syntax error", your lack of reading this warning is most likely the cause.
First thing, add this script in a new section above the main.
Spoiler:
Code:
class MakeHealingBallGraphics
def initialize
balls=[]
for poke in $Trainer.party
balls.push(poke.ballused) if !poke.isEgg?
end
return false if balls.length==0
@sprites={}
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=999999
for i in 0...balls.length
@sprites["ball#{i}"]=Sprite.new(@viewport)
if pbResolveBitmap("Graphics/Pictures/Balls/ball_#{balls[i]}.png")
@sprites["ball#{i}"].bitmap=Bitmap.new("Graphics/Pictures/Balls/ball_#{balls[i]}.png")
else
@sprites["ball#{i}"].bitmap=Bitmap.new("Graphics/Pictures/Balls/ball_0.png")
end
@sprites["ball#{i}"].visible=false
end
bitmap1=Bitmap.new(128,192)
bitmap2=Bitmap.new(128,192)
rect1=Rect.new(0,0,128,192/4)
rect2=Rect.new(0,0,128,192/4)
for i in 0...balls.length
case i
when 0
bitmap1.blt(20,50,@sprites["ball#{i}"].bitmap,rect1)
bitmap1.blt(20,98,@sprites["ball#{i}"].bitmap,rect1)
bitmap1.blt(20,146,@sprites["ball#{i}"].bitmap,rect1)
when 1
bitmap2.blt(0,50,@sprites["ball#{i}"].bitmap,rect2)
bitmap2.blt(0,98,@sprites["ball#{i}"].bitmap,rect2)
bitmap2.blt(0,146,@sprites["ball#{i}"].bitmap,rect2)
when 2
bitmap1.blt(20,106,@sprites["ball#{i}"].bitmap,rect1)
bitmap1.blt(20,154,@sprites["ball#{i}"].bitmap,rect1)
when 3
bitmap2.blt(0,106,@sprites["ball#{i}"].bitmap,rect2)
bitmap2.blt(0,154,@sprites["ball#{i}"].bitmap,rect2)
when 4
bitmap1.blt(20,162,@sprites["ball#{i}"].bitmap,rect1)
when 5
bitmap2.blt(0,162,@sprites["ball#{i}"].bitmap,rect2)
end
Graphics.update
end
if RTP.exists?("Graphics/Characters/Healing balls left.png")
File.delete("Graphics/Characters/Healing balls left.png")
end
if RTP.exists?("Graphics/Characters/Healing balls right")
File.delete("Graphics/Characters/Healing balls right")
end
bitmap1.saveToPng("Graphics/Characters/Healing balls left.png")
bitmap2.saveToPng("Graphics/Characters/Healing balls right.png")
pbDisposeSpriteHash(@sprites)
@viewport.dispose
bitmap1.dispose
bitmap2.dispose
end
end
And add this folder (which contains the graphics for each ball) into Graphics/Pictures
https://www.mediafire.com/download/ucad4vbtut2q4t9/Balls.rar
Now, for setting up the events.
Instead of making this overcomplicated, I've just made an example map with the necessary events.
Download here: https://www.mediafire.com/download/05bi57377zg76b6/Map009.rxdata
Note that this map's number is 009, so you'll probably have to change that before adding it to your game to avoid overwriting a previous map.
Video of this working:
PS: To add a new ball's graphic, just put it in the same folder. Named "ball_X", where X is it's ID number (if you'd added a new ball, you've defined this.) If a ball graphic is not found for a particular ball, it defaults to "ball_0", which is a pokeball.
Last edited by a moderator: