Message Shutter Animation
#1
This is just a simple script I was using in a game I'm working on that was requested from Sixty.
It adds an opening and closing shutter animation to message windows when they open and close.

Code:
#==============================================================================
# ** Message Shutter Animation
#------------------------------------------------------------------------------
#
#  This script was made by Myownfriend, its only function is to add a shutter
#  effect to message windows as they open and close.
#
#  If your experiencing any compatibility problems with other scripts that make
#  small modifications to the message window, try placing this script directly
#  under the original Window_Message class. If you experience any other problems
#  with this script, please go to http://www.rmphantasy.net/
#
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
#  This message window is used to display text.
#==============================================================================


class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias mof_shutter_initialize :initialize
  def initialize
    mof_shutter_initialize
    @opening = false
    @closing = false
    @full_height = self.height
    @full_y = self.y
    @y_difference = @full_height/2
    @fade_in = false
    @fade_out = false
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    open
    if @input_number_window != nil
      @input_number_window.update
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        $game_variables[$game_temp.num_input_variable_id] =
          @input_number_window.number
        $game_map.need_refresh = true
        @input_number_window.dispose
        @input_number_window = nil
        terminate_message
      end
      return
    end
    # If message is being displayed
    if @contents_showing
      # If choice isn't being displayed, show pause sign
      if $game_temp.choice_max == 0
        self.pause = true
      end
      # Cancel
      if Input.trigger?(Input::B)
        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
          $game_system.se_play($data_system.cancel_se)
          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
          terminate_message
        end
      end
      # Confirm
      if Input.trigger?(Input::C)
        if $game_temp.choice_max > 0
          $game_system.se_play($data_system.decision_se)
          $game_temp.choice_proc.call(self.index)
        end
        terminate_message
      end
      return
    end
    if @closing == false && $game_temp.message_text != nil
      @contents_showing = true
      $game_temp.message_window_showing = true
      reset_window
      refresh
      Graphics.frame_reset
      self.visible = true
      self.contents_opacity = 0
      self.y = @full_y + @y_difference
      self.height = 0
      if @input_number_window != nil
        @input_number_window.contents_opacity = 0
      end
      @opening = true
      return
    end
    close
  end
  #--------------------------------------------------------------------------
  # * Open Window Animation
  #--------------------------------------------------------------------------
  def open
    if @opening
      self.contents_opacity = 0
      self.height += @full_height/5
      self.y -= @y_difference/5
      if @input_number_window != nil
        @input_number_window.contents_opacity += 24
      end
      if self.height == @full_height
        @opening = false
        self.contents_opacity = 255
      end
      @contents_showing = true
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Close Window Animation
  #--------------------------------------------------------------------------
  def close
    if self.visible
      @closing = true
      self.contents_opacity = 255
      self.height -= @full_height/5
      self.y += @y_difference/5
      if self.height == 0
        self.visible = false
        @wait_count = 5
        @closing = false
        $game_temp.message_window_showing = false
      end
      @contents_showing = false
      return
    end
  end
#-------------------------------------------------------------------------------
end
Reply }
#2
looks nice, too bad that it doesn't work with ccoas UMS
Reply }
#3
So it just does the same thing that happens on VX with command and message windows?
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#4
@kyonides

Yes pretty much.

@Zarox

It might work with very little modification. I'll take a look at it when I get back home later tonight.
Reply }
#5
Doesn't work with the AMS as well... hope there's going to be a patch for this, I wanna give this script a try.
Reply }
#6
Just checked out the two message systems. I would probably have to make a version of the script that works with each. If they had both made the fade in and fade out parts of their code into difference methods then simply overwriting those methods would make this script work. I'll see what I can do about getting them to work. Otherwise, I might just make this script into a full fledged message system at some point.
Reply }
#7
ty, I hope you can get it working. My Events are made to work with the UMS, so I can't just change the Message Script^^ I would have to change also all events
Reply }
#8
Works well, I like it. Just a quick question, would it be possible to have a method for this to be turned on/off at certain points of a conversation? Like if I have two characters talking, the shutter only activates when a different person is talking? So guy 1 could have three text boxes of conversation uninterrupted, the shutter activates and then the second guy talks.

Hope that makes sense. :P
Reply }
#9
I understand what you mean, and back when I first made this script I don't think I had the know how to do that, but I will try again.
Reply }
#10
hey just wanted to ask you still work on the UMS Edition :D
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Toggle Message Window XP kyonides 0 83 11-11-2024, 01:28 AM
Last Post: kyonides
   Quickie Battler Animation DerVVulfman 0 284 08-26-2024, 10:16 PM
Last Post: DerVVulfman
   Drago Message Log LiTTleDRAgo 0 5,019 08-31-2016, 01:22 PM
Last Post: LiTTleDRAgo
   Message Text from Files DerVVulfman 0 5,292 04-13-2016, 03:25 AM
Last Post: DerVVulfman
   Universal Message System Cancel Choices Fix DerVVulfman 3 10,206 05-23-2012, 03:46 AM
Last Post: Taylor
   Animation : Ground Kain Nobel 1 5,400 01-12-2012, 08:33 AM
Last Post: yamina-chan
   Universal Message System ccoa 15 48,656 10-09-2011, 04:33 AM
Last Post: DerVVulfman
   AMS - Advanced Message Script - R4 (LegacyX Edit) Legacy 2 9,203 09-18-2009, 09:43 AM
Last Post: Legacy
   Dubealex's Advanced Message System R4 Dubealex 0 8,296 12-07-2008, 04:19 PM
Last Post: Dubealex
   Picture Message Window - With Ease Mac 0 4,897 03-08-2008, 01:02 AM
Last Post: Mac



Users browsing this thread: 1 Guest(s)