Save-Point
RPG::ME Extended - Printable Version

+- 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: RPG::ME Extended (/thread-8941.html)



RPG::ME Extended - kyonides - 04-15-2024

RPG::ME Extended

by Kyonides

Introduction

This scriptlet is just an extension of the ME already present in both editions of the RPG Maker engine. It mimics the BGM's and BGS's ability to keep track of the ME currently playing. If any...

The Script

Code:
# * RPG::ME Extended * #
#  2024-05-04

module RPG
  class ME
    @@last = ME.new
    def play
      if @name.empty?
        Audio.me_stop
        @@last = ME.new
      else
        Audio.me_play('Audio/ME/' + @name, @volume, @pitch, pos)
        @@last = self.clone
      end
    end
    alias :replay :play

    def self.stop
      Audio.me_stop
      @@last = ME.new
    end

    def self.fade(time)
      Audio.me_fade(time)
      @@last = ME.new
    end

    def self.last
      @@last
    end
  end
end

Terms & Conditions

Free for use in ANY Gamer game.
That's it! Grinning


RE: RPG::ME Extended - kyonides - 05-05-2024

Important Bug Fix

I revisited my scriptlet as of recent only to fix the module / class scope issue that it triggered while creating a new ME object.
Without the Bug bug fix, the code would make your game crash in no time. Happy with a sweat