+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker VX/VXAce (RGSS2/3) Engines (https://www.save-point.org/forum-117.html)
+---- Thread: P's MessageBack Changer and Enhancer [Exclusive] (/thread-2215.html)
P's MessageBack Changer and Enhancer [Exclusive] - PK8 - 07-02-2009
MessageBack Changer + Enhancer
Version: 1
Introduction
This is a messageback changer and as well as an "enhancer". This script allows the developer to be able to change the messageback of his/her game at any time, set the initial settings and also customise the messageback's tone, blend, and other little niceties. You may also set the "common settings" as well as reset the changes to the initial settings.
Features
Set initial settings: Messageback File, Tone, Blend, Mirror, Waves.
Change the look of the MessageBack with script calls.
Reset changes made to the MessageBack to the initial settings with a call.
Quickly change a multitude of settings in the MessageBack enhancer with "common settings" via a script call.
Screenshots
Changing MessageBack in-game.
Changing Blend Type.
Changing Blend Type back to normal and desaturating the MessageBack graphic
Script
Code:
=begin
????????????????????????????????????????????????????????????????????????????????
? MessageBack Changer + Enhancer ?
? Version 1 ?
? by PK8 ?
? June 26th, 2009 / July 2nd, 2009 ?
? http://rmvxp.com ?
????????????????????????????????????????????????????????????????????????????????
? ? Table of Contents ?
? ?? Author's Notes - Line 17?29 ?
? ?? Introduction & Description - Line 31?36 ?
? ?? Features - Line 38?43 ?
? ?? How to use (Script calls) - Line 45?83 ?
? ?? This aliases the following... - Line 85?89 ?
? ?? Thanks - Line 91?94 ?
????????????????????????????????????????????????????????????????????????????????
? ? Author's Notes ?
? This began as a request that I had made in my own forum, asking for someone ?
? to make some kind of a MessageBack changer tool simply so I could test ?
? messagebacks I've made without resorting to forcing myself to change the ?
? name of a messageback I wanted to try out to "MessageBack". DerVVulfman took ?
? this request and while we were chatting, I opened up RMVX and wanted to try ?
? my hand at making my own MessageBack Changer script. We both had different ?
? ways we went about making the messageback change in-game. Derv completed his,?
? I continued to work on my script until... I've caught the "scripting bug". ?
? Ideas for customisation started entering my mind! So I decided to make a ?
? messageback changer + enhancer... nice. ?
? ?
? I feel pretty bad for DerVVulfman though. ?
????????????????????????????????????????????????????????????????????????????????
? ? Introduction & Description ?
? This is a messageback changer and as well as an "enhancer". This script ?
? allows the developer to be able to change the messageback of his/her game at ?
? any time, set the initial settings and also customise the messageback's tone,?
? blend, and other little niceties. You may also set the "common settings" as ?
? well as reset the changes to the initial settings. ?
????????????????????????????????????????????????????????????????????????????????
? ? Features ?
? ? Set initial settings: Messageback File, Tone, Blend, Mirror, Waves. ?
? ? Change the look of the MessageBack with script calls. ?
? ? Reset changes made to the MessageBack to the initial settings with a call. ?
? ? Quickly change a multitude of settings in the MessageBack enhancer with ?
? "common settings" via a script call. ?
????????????????????????????????????????????????????????????????????????????????
? ? How to use (Script calls) ?
? ??? To change the MessageBack graphic file, type: ?
? ? $game_system.messageback = filename ?
? ? ?
? ? Where filename is the name of the file kept in the Graphics/System folder. ?
? ? Wrap the filename in single or double quotation marks. ?
? ? ?????????????????????????????????????????????????????????????????????????? ?
? ??? To change the tone of the MessageBack, type: ?
? ? $game_system.messageback_tone = Tone.new(red, green, blue, grey) ?
? ? ?
? ? red: -255 to 255 | green: -255 to 255 | blue: -255 to 255 | grey: 0 to 255 ?
? ? ?????????????????????????????????????????????????????????????????????????? ?
? ??? To change the blend type of the MessageBack, type: ?
? ? $game_system.messageback_blend = blend ?
? ? ?
? ? blend: 0 = Normal, 1 = Add/Positive, 2 = Sub/Negative ?
? ? ?????????????????????????????????????????????????????????????????????????? ?
? ??? To set whether the MessageBack graphic is flipped or not, type: ?
? ? $game_system.messageback_mirror = mirror ?
? ? ?
? ? mirror: true = flipped horizontally, false = normal ?
? ? ?????????????????????????????????????????????????????????????????????????? ?
? ??? To set the wave effects... ?
? ? Setting Wave Amplitude, type: ?
? ? $game_system.messageback_waveamp = value ?
? ? ?
? ? Setting Wave Length, type (don't set it to 0): ?
? ? $game_system.messageback_wavelength = value ?
? ? ?
? ? Setting Wave Speed, type: ?
? ? $game_system.messageback_wavespeed = value ?
? ? ?????????????????????????????????????????????????????????????????????????? ?
? ??? To adjust multiple messageback settings, type: ?
? ? $game_system.messageback_common("id") ?
? ? ?
? ? id: Common settings identifier. ?
? ? ?????????????????????????????????????????????????????????????????????????? ?
? ??? To reset your messageback settings, use this: ?
? $game_system.messageback_reset ?
????????????????????????????????????????????????????????????????????????????????
? ? This aliases the following... ?
? initialize - Game_System ?
? initialize - Window_Message ?
? create_back_sprite - Window_Message ?
? update - Window_Message ?
????????????????????????????????????????????????????????????????????????????????
? ? Thanks ?
? PK8 (Me): For requesting it. ?
? DerVVulfman: For taking this request, and somehow made me feel like making ?
? my own... huh? ?
????????????????????????????????????????????????????????????????????????????????
=end
#===============================================================================
# ** MessageBack Customisation!
#-------------------------------------------------------------------------------
# Set the initial settings and common settings.
#===============================================================================
class PK8
MessageBack_Common = {} # Don't touch this.
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================
class Game_System
#-----------------------------------------------------------------------------
# * Public Instance Variables
#-----------------------------------------------------------------------------
attr_accessor :messageback # messageback
attr_accessor :messageback_tone # messageback tone
attr_accessor :messageback_blend # messageback blend type
attr_accessor :messageback_mirror # messageback mirror
attr_accessor :messageback_waveamp # messageback wave amp
attr_accessor :messageback_wavelength # messageback wave length
attr_accessor :messageback_wavespeed # messageback wave speed
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
# This message window is used to display text.
#==============================================================================
class Window_Message < Window_Selectable
alias pk8_messageback_create :create_back_sprite
alias pk8_messageback_initialize :initialize
alias pk8_messageback_update :update
#--------------------------------------------------------------------------
# * Object Initialisation
#--------------------------------------------------------------------------
def initialize
pk8_messageback_initialize
@pk8_messageback = $game_system.messageback
@pk8_messageback_tone = $game_system.messageback_tone
@pk8_messageback_blend = $game_system.messageback_blend
@pk8_messageback_mirror = $game_system.messageback_mirror
@pk8_messageback_waveamp = $game_system.messageback_waveamp
@pk8_messageback_wavelength = $game_system.messageback_wavelength
@pk8_messageback_wavespeed = $game_system.messageback_wavespeed
end
#--------------------------------------------------------------------------
# * Create Background Sprite
#--------------------------------------------------------------------------
def create_back_sprite
pk8_messageback_create
# Hmm, this seems right. I was clearing the previously made bitmap so I
# could make this script make the modified messageback. :P
@back_sprite.bitmap.clear
@back_sprite.bitmap = Cache.system($game_system.messageback)
@back_sprite.tone = $game_system.messageback_tone
@back_sprite.blend_type = $game_system.messageback_blend
@back_sprite.mirror = $game_system.messageback_mirror
@back_sprite.wave_amp = $game_system.messageback_waveamp
@back_sprite.wave_length = $game_system.messageback_wavelength
@back_sprite.wave_speed = $game_system.messageback_wavespeed
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
pk8_messageback_update
if @pk8_messageback != $game_system.messageback
@pk8_messageback = $game_system.messageback
@back_sprite.bitmap = Cache.system($game_system.messageback)
end
if @pk8_messageback_tone != $game_system.messageback_tone
@pk8_messageback_tone = $game_system.messageback_tone
@back_sprite.tone = $game_system.messageback_tone
end
if @pk8_messageback_blend != $game_system.messageback_blend
@pk8_messageback_blend = $game_system.messageback_blend
@back_sprite.blend_type = $game_system.messageback_blend
end
if @pk8_messageback_mirror != $game_system.messageback_mirror
@pk8_messageback_mirror = $game_system.messageback_mirror
@back_sprite.mirror = $game_system.messageback_mirror
end
if @pk8_messageback_waveamp != $game_system.messageback_waveamp
@pk8_messageback_waveamp = $game_system.messageback_waveamp
@back_sprite.wave_amp = $game_system.messageback_waveamp
end
if @pk8_messageback_wavelength != $game_system.messageback_wavelength
@pk8_messageback_wavelength = $game_system.messageback_wavelength
@back_sprite.wave_length = $game_system.messageback_wavelength
end
if @pk8_messageback_wavespeed != $game_system.messageback_wavespeed
@pk8_messageback_wavespeed = $game_system.messageback_wavespeed
@back_sprite.wave_speed = $game_system.messageback_wavespeed
end
end
end
Instructions
First, set up your initial settings (lines 106 - 117). Also set up the "common settings". You'll be able to change a multitude of MessageBack settings with a simple script call.
FAQ Why are my messagebacks appearing blank?
That, I don't know but it happens when you use this script. To fix that, you'll have to refer to the MessageBack graphic in your Graphics/System directory as "MessageBack.png"
How do I change the MessageBack graphic in-game?
$game_system.messageback = "filename"
"filename" being the file name of a graphic in the Graphics/System
How do I change the tone of the MessageBack in-game?
$game_system.messageback_tone = Tone.new(red, green, blue, grey)
Red/Green/Blue: -255 to 255 | Grey: 0 to 255
How do I change the blend type of the MessageBack in-game?
$game_system.messageback_blend = value
0: Normal, 1: Add, 2: Sub
How do I flip/unflip the messageback graphic horizontally in-game?
$game_system.messageback_mirror = mirror
Set this to either true or false. (true = flipped horizontally, false = normal)
How do I set the wave amplitude of the messageback graphic in-game?
$game_system.messageback_waveamp = value
How do I set the wave frequency of the messageback graphic in-game?
$game_system.messageback_wavelength = value
Set this to anything but 0.
How do I set the wave speed of the messageback graphic in-game?
$game_system.messageback_wavespeed = value
What are "common settings"?
These are quick settings intended for developers to change a multitude of MessageBack settings in one call.
How do I make my own Common Settings?
Go to line 122 of the script and start setting up your own. Here's how.
MessageBack Common Settings Identifier. ( to be called with $game_system.messageback_common("id") ) MessageBack Graphic File MessageBack Red Tone. (-255 to 255) MessageBack Green Tone. (-255 to 255) MessageBack Blue Tone. (-255 to 255) MessageBack Grey Tone. (0 to 255) MessageBack Blend Type: 0 = Normal, 1 = Add, 2 = Sub Mirror MessageBack graphic? true or false? Wave Amplitude Wave Frequency Wave Speed
How do I call one of my Common Settings in-game?
$game_system.messageback_common("id") Common Settings identifier.
How do I reset the MessageBack settings to the initial settings I've set in the script in-game?
$game_system.messageback_reset
Compatibility
This aliases the following:
Game_System initialize
Window_Message initialize
Window_Message create_back_sprite
Window_Message update
Credits and Thanks
Me for requesting it then deciding to do it. DerVVulfman for taking this request and somehow making me feel like making my own while he was working on filling the request. o.o!
Author's Notes
This began as a request that I had made in my own forum, asking for someone to make some kind of a MessageBack changer tool simply so I could test messagebacks I've made without resorting to forcing myself to change the name of a messageback I wanted to try out to "MessageBack". DerVVulfman took this request and while we were chatting, I opened up RMVX and wanted to try my hand at making my own MessageBack Changer script. We both had different ways we went about making the messageback change in-game. Derv completed his, I continued to work on my script until... I've caught the "scripting bug". Ideas for customisation started entering my mind! So I decided to make a messageback changer + enhancer... nice.
I feel pretty bad for DerVVulfman though.
Terms and Conditions
This is exclusive to RMVXPUniverse.