Go Back   The PokéCommunity Forums > Create & Discover > Game Development > Scripts & Tutorials
Reload this Page Essentials Script Better PokeCenters

Notices
For all updates, view the main page.

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.



Reply
 
Thread Tools
  #1    
Old December 20th, 2015 (6:30 PM). Edited December 21st, 2015 by Maruno.
mej71's Avatar
mej71 mej71 is offline
Moderator
 
Join Date: Mar 2014
Location: Omnipresence
Gender: Male
Posts: 1,023

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.

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
http://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: http://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.

Reply With Quote

Relevant Advertising!

  #2    
Old December 29th, 2015 (10:50 AM).
Fakemon123's Avatar
Fakemon123 Fakemon123 is offline
 
Join Date: Dec 2015
Gender: Male
Posts: 21
Send a message via Skype™ to Fakemon123

This is pretty interesting! I think I'll use this!

Reply With Quote
  #3    
Old December 29th, 2015 (12:05 PM).
HarmonyConcept HarmonyConcept is offline
 
Join Date: Sep 2015
Gender: Female
Posts: 71

I tried this and it's working fine. Thanks a lot!

Reply With Quote
  #4    
Old February 14th, 2016 (2:43 PM).
Letrax's Avatar
Letrax Letrax is offline
 
Join Date: Feb 2016
Gender: Male
Posts: 54

Wow looks awesome thx :3

Reply With Quote
  #5    
Old February 16th, 2016 (12:05 PM).
khkramer's Avatar
khkramer khkramer is offline
 
Join Date: Apr 2010
Gender: Male
Posts: 250

Looks great!
I'll be using this for sure.
Thanks for creating and sharing this.

__________________


MMO. New thread coming soon.
Reply With Quote
  #6    
Old April 26th, 2016 (7:09 AM).
Broskinator97 Broskinator97 is offline
 
Join Date: Apr 2016
Posts: 1

Hi, I've tried to use this script, but it didn't work for me, maybe someone can explain me how to make it work?

Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 6:01 AM.