07-02-2009, 04:28 PM
(This post was last modified: 09-02-2024, 05:58 PM by DerVVulfman.)
MessageBack Changer + Enhancer
Version: 1
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.
# Initial MessageBack Graphic File.
MessageBack = "MessageBack.png"
# Initial MessageBack Graphic Tone. (Red, Green, Blue, Saturation)
MessageBack_Tone = [0, 0, 0, 0]
# Initial MessageBack Graphic Blend. (0: Normal, 1: Add, 2: Sub)
MessageBack_Blend = 0
# Initial MessageBack Graphic Mirror. Flipped (true) or not (false)?
MessageBack_Mirror = false
# Initial Wave Settings
MessageBack_WaveAmp = 0
MessageBack_WaveLength = 1 # Do not set this particular setting to 0.
MessageBack_WaveSpeed = 0
# Common MessageBack Changer settings. (See line 77 for info)
# $game_system.messageback_common(id)
# "file", [red, green, blue, grey], blend, mirror, [wavea, wavel, wavespeed]]
MessageBack_Common["SampleA"] = [
"MessageBack.png", [0, 255, 0, 0], 0, false, [0, 1, 0]]
MessageBack_Common["SampleB"] = [
"MessageBack.png", [255, 0, 0, 0], 0, false, [0, 1, 0]]
MessageBack_Common["Wavy"] = [
"MessageBack.png", [100, 100, 100, 100], 0, false, [100, 100, 10]]
end
#==============================================================================
# ** 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
alias pk8_messageback_game_system_initialize :initialize
#--------------------------------------------------------------------------
# * Object Initialisation
#--------------------------------------------------------------------------
def initialize
pk8_messageback_game_system_initialize
@messageback = PK8::MessageBack
@messageback_tone = Tone.new(PK8::MessageBack_Tone[0],
PK8::MessageBack_Tone[1],PK8::MessageBack_Tone[2],PK8::MessageBack_Tone[3])
@messageback_blend = PK8::MessageBack_Blend
@messageback_mirror = PK8::MessageBack_Mirror
@messageback_waveamp = PK8::MessageBack_WaveAmp
@messageback_wavelength = PK8::MessageBack_WaveLength
@messageback_wavespeed = PK8::MessageBack_WaveSpeed
end
#--------------------------------------------------------------------------
# * Resets MessageBack settings to initial settings.
#--------------------------------------------------------------------------
def messageback_reset
@messageback = PK8::MessageBack
@messageback_tone = Tone.new(PK8::MessageBack_Tone[0],
PK8::MessageBack_Tone[1],PK8::MessageBack_Tone[2],PK8::MessageBack_Tone[3])
@messageback_blend = PK8::MessageBack_Blend
@messageback_mirror = PK8::MessageBack_Mirror
@messageback_waveamp = PK8::MessageBack_WaveAmp
@messageback_wavelength = PK8::MessageBack_WaveLength
@messageback_wavespeed = PK8::MessageBack_WaveSpeed
end
#--------------------------------------------------------------------------
# * This sets a multitude of MessageBack settings in one script call.
#--------------------------------------------------------------------------
def messageback_common(pk8_messageback_common)
@messageback = PK8::MessageBack_Common[pk8_messageback_common][0]
@messageback_tone = Tone.new(
PK8::MessageBack_Common[pk8_messageback_common][1][0],
PK8::MessageBack_Common[pk8_messageback_common][1][1],
PK8::MessageBack_Common[pk8_messageback_common][1][2],
PK8::MessageBack_Common[pk8_messageback_common][1][3])
@messageback_blend = PK8::MessageBack_Common[pk8_messageback_common][2]
@messageback_mirror = PK8::MessageBack_Common[pk8_messageback_common][3]
@messageback_waveamp = PK8::MessageBack_Common[pk8_messageback_common][4][0]
@messageback_wavelength = PK8::MessageBack_Common[pk8_messageback_common][4][1]
@messageback_wavespeed=PK8::MessageBack_Common[pk8_messageback_common][4][2]
end
end
#==============================================================================
# ** 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.
How to set it up.
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.