RPG Maker Forums

Save Mouse Selection in Shaz' Super Simple Mouse System for Ace v.1.0

Shaz and Engr. Shana



This relates to Shaz' Mouse Script which is found here: http://forums.rpgmakerweb.com/index.php?/topic/17829-amaranths-super-simple-mouse-system-for-ace/

Objective

To give the player the choice to enable or disable the custom mouse at any point in the game.

These two scripts, taken together, enable the game to remember the data when the player restarts the game after quitting entirely, and solve the bug of having both the custom mouse icon and the default mouse icon showing simultaneously if the player has changed their mind and re-enabled the mouse.

How to use

Place under Shaz' Mouse script, with Part One above Part Two.

Designate an appropriate switch

At the beginning of the game, use a script call to enable the mouse

$mouse.enabled = true

To give the player the choice have a mechanism (I use an extra line in the main Menu) which will run these script calls

To enable the mouse:

$mouse.enabled = true

Mouse.shaz?(0)

To disable the mouse

$mouse.enabled = false

Mouse.shaz?(1)

Demo and screenshots

Not applicable.

Scripts

Save Mouse Selection Part One

Code:
#Save Mouse selection Part One
#USE: Place under Shaz Super simple Mouse System
#Select a switch and NAME IT.  Insert the number at line 11 without
#leading zeros e.g. not switch = 008 but switch = 8
#For further use information see Save Mouse selection Part Two which
#must be used in conjunction with this script
#CREDITS: Shaz, Engr. Shana
#===============================================================================
module SHAZ
  module MouseSwitch
    ENABLED_SWITCH = 4
  end
end

class Sprite_Mouse < Sprite

  def enabled=(value)
    @enabled = value
    $game_switches[SHAZ::MouseSwitch::ENABLED_SWITCH] = value
    self.visible = value
  end
end

module DataManager
  class << self
    alias shaz_mouse_switch_load_game load_game
    alias shaz_mouse_switch_setup_new_game setup_new_game
  end

  def self.load_game(index)
    loaded = shaz_mouse_switch_load_game(index)
    if loaded
      $mouse.enabled = $game_switches[SHAZ::MouseSwitch::ENABLED_SWITCH] if $mouse && $game_switches
      return true
    else
      return false
    end
  end

  def setup_new_game
    shaz_mouse_switch_setup_new_game
    $mouse.enabled = true if $mouse
  end
end
class Sprite_Mouse < Sprite

  def enabled=(value)
    @enabled = value
    $game_switches[SHAZ::MouseSwitch::ENABLED_SWITCH] = value
    self.visible = value
    Mouse.update
  end
end
Save Mouse Selection Part Two

Code:
#Save Mouse Selection Part Two
#USE: Place under Save Mouse Selection Part One
#Use an event with this script call at the beginning of the game so that
#the game begins with the mouse enabled.
#$mouse.enabled = true
#To give the player the choice of enabling/disabling the mouse during the game
#provide an event - e.g. as a choice in the Main Menu - which does the
#following:
#To enable the mouse
#script call with 2 elements
#$mouse.enabled = true
#Mouse.shaz?(0)
#To disable the mouse
#script call with 2 elements
#$mouse.enabled = false
#Mouse.shaz?(1)
#
#CREDIT: Engr. Shana
#===============================================================================
module Mouse
  def self.shaz?(show)
    ShowCursor.call(show)
  end
end
Credits

I asked for the final fixes, and am posting it publicly because I think that other people may find it useful. These are in no way my work. Engr. Shana is happy for it to be made public. Credit:

Shaz

Engr. Shana

EDIT

Forgot to put this in.

Terms of use

Free for commercial and non-commercial, but credit must be given.

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,354
Members
137,801
Latest member
topsan
Top