New show balloon icon command
by reijubvWhat is this?!This script enables you to show a balloon icon with different picture, but must in same format as default one...
Feature :+Use different balloon icon file!
+Easy to use
Screenshot :Not necessary
Script :#=============================================================
# ? [VX] ? New Balloon Command ? ?
# * Show a balloon with different filename *
#-------------------------------------------------------------------------------
# ? by reijubv [aruyasoft@comic.com]
# ? RPG RPG Revolution
# ? Released on: 14/03/2009
# ? Version: 1.0
#-------------------------------------------------------------------------------
# ? Feature:
# A small script that will allows you to show balloon sprite on your game using
# different file, but the balloon file must be in same size as the one from RTP
#
# call script : New_Balloon(wichevent,balid,filename)
# wichevent : -1 for player, 0 for 'this event', >0 for that event id
# balid : balloon index id, starts from 1 to 10
# filename : balloon icon filename, ex: "balloon01", must be in System folder!
#
# example :
# @>Script: New_Balloon(-1,1,"balloon01")
#
# will show balloon index 1 from file "balloon01" on player character
#
#-------------------------------------------------------------------------------
# Credit me (reijubv) if you use this script....
#-------------------------------------------------------------------------------
# ? Installation:
# Put this script above main
#==============================================================
#==============================================================
# ** Game_System
#==============================================================
class Game_System
#Public instance variable >> $game_system.balloon_file
attr_accessor :balloon_file
#Initialize balloon file
alias reiinitialize initialize unless method_defined?('reiinitialize')
def initialize
reiinitialize
@balloon_file = "Balloon" #Default balloon icon name
end
end
#=============================================================
# ** Game_Interpreter
#=============================================================
class Game_Interpreter
#alias command_213 (normal show balloon icon)
alias reicommand213 command_213 unless method_defined?('reicommand213')
def command_213
reicommand213
$game_system.balloon_file = "Balloon"
end
#------------------------------------------------------------------------------
# new : def NewBalloon
#------------------------------------------------------------------------------
def New_Balloon(wichevent,balid,filename)
character = get_character(wichevent)
#set baloon icon file
$game_system.balloon_file = filename
if character != nil
character.balloon_id = balid
end
return true
end
end
#=============================================================
# ** Sprite_Character
#=============================================================
class Sprite_Character < Sprite_Base
#alias start_balloon
alias reistartballoon start_balloon unless method_defined?('reistartballoon')
def start_balloon
reistartballoon
dispose_balloon
@balloon_duration = 8 * 8 + BALLOON_WAIT
#create balloon sprite
@balloon_sprite = ::Sprite.new(viewport)
#new lines
if $game_system.balloon_file != nil
@balloon_sprite.bitmap = Cache.system($game_system.balloon_file)
else
@balloon_sprite.bitmap = Cache.system("Balloon")
end
#end of new lines
@balloon_sprite.ox = 16
@balloon_sprite.oy = 32
update_balloon
end
end
#=============================================================
# END OF SCRIPT
#=============================================================
Demo :Exe Demo > 379.1 Kb
Zip Demo > 221.27 Kb
Balloon Examples :How to use :CODE
call script : New_Balloon(wichevent,balid,filename)
>wichevent : -1 for player, 0 for 'this event', >0 for that event id
>balid : balloon index id, starts from 1 to 10
>filename : balloon icon filename, ex: "balloon01", must be in System folder!
example :
@>Script: New_Balloon(-1,1,"balloon01")
this will show balloon index 1 from file "balloon01" on player character
This post has been edited by reijubv: Apr 1 2009, 09:36 PM