Jump to content

Recommended Posts

In RMXP, you had the ability to specify blending mode and opacity for each event. For some reason, this ability has been removed. This script restores this functionality by allowing you to change blending mode and opacity through a notetag in the event's name.

 

 

#==============================================================================
#
# â–¼ SAI RMXP Blending Options v 1.0
# -- Last Updated: 2012.01.12
# -- Author: Bishop Myers ("Sailerius")
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["SAI-RMXPBlendingOptions"] = true
#==============================================================================
# â–¼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.12 - First release
#
#==============================================================================
# â–¼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# In RMXP, you had the ability to specify blending mode and opacity for each
# event. For some reason, this ability has been removed. This script attempts
# to compensate by allowing you to change blending mode and opacity through
# a notetag.
#
#==============================================================================
# â–¼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below â–¼ Materials/ç´ æ but above â–¼ Main. Remember to save.
#
# This script adds the following notetags, which must be used in an event's
# name.
# <blend mode: x>
#   x must be one of 0, 1, or 2. 0 = normal; 1 = add; 2 = subtract
# <opacity: y>
#   y must be 0-255 inclusive
#
#==============================================================================
# â–¼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script should be fully compatible with any other well-written Ace
# scripts, although I offer no guarantee of compatibility for scripts which
# rewrite the Sprite_Character's initialization method.
#
#==============================================================================
# â–  Game_CharacterBase
#==============================================================================
class Game_CharacterBase
 #--------------------------------------------------------------------------
 # * Allow writing to blend_type and opacity
 #--------------------------------------------------------------------------
 attr_accessor   :blend_type
 attr_accessor   :opacity
end
#==============================================================================
# â–  Sprite_Character
#==============================================================================
class Sprite_Character < Sprite_Base
 #--------------------------------------------------------------------------
 # * alias method: initialize
 #--------------------------------------------------------------------------
 alias :sprite_character_initialize_saiblendmodes :initialize
 def initialize(viewport, character = nil)
sprite_character_initialize_saiblendmodes(viewport, character)
# Don't bother with followers or vehicles
if @character.instance_of?(Game_Event)
  # Parse the name for tags
  blend_regex = /<BLEND MODE: ((?:\d+,?\s*))>/i
  opacity_regex = /<OPACITY: ((?:\d+,?\s*))>/i
  blend_mode = @character.name.scan(blend_regex)
  opacity = @character.name.scan(opacity_regex)
  unless opacity.empty?
	# Get the value out of the nested arrays
	blend_mode = blend_mode.first.first
	# Set the blend mode
	@character.blend_type = blend_mode.to_i
  end
  unless blend_mode.empty?
	# Get the value out of the nested arrays
	opacity = opacity.first.first
	# Set the blend mode
	@character.opacity = opacity.to_i
  end  
end
 end
end

 

Edited by Sailerius

Share this post


Link to post
Share on other sites

Oh, now that is sweet, i like that.. useful.. considering they did in fact remove all that stuff from Ace.

I want to see more functions from older makers restored to be honest.

Edited by Michael Ponder Jr

Share this post


Link to post
Share on other sites

With no intentions of raining on anyone's parade:

 

14kk3s1.jpg

 

Putting these movement commands in a custom moveroute with the highest frequency will cause them to reach that opacity and blend type before the map loads visibly. Still, your script's useful in the event that you need a movement route without the highest frequency and custom opacity/blend types.

Share this post


Link to post
Share on other sites

Yeah, that's doable, but as you mention, it occupies your custom moveroute slot. I also like using the name because it means you can easily tell which events use it from the editor without needing to open them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×