Basic Mouse System + Addons

shasow

Warper
Member
Joined
Jan 23, 2014
Messages
3
Reaction score
1
Primarily Uses
I am getting this error when opening the save menu:



When I remove the save script, it stops popping up. 
 

N7Pankake

Veteran
Veteran
Joined
Jan 22, 2014
Messages
56
Reaction score
5
First Language
Spanish
Primarily Uses
is there a way to do this:
i dont want that the mouse move my character, I only want to be able to select the options and that stuff of the menus or skills or on combat etc, is there

a way to make that? again... im new and i dont know much about scripts 
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
I am getting this error when opening the save menu:





When I remove the save script, it stops popping up.
Again, not sure why it's happening to you and not me, but if you comment out (put a # in front of it) line 218 then it should be ok.
is there a way to do this:


i dont want that the mouse move my character, I only want to be able to select the options and that stuff of the menus or skills or on combat etc, is there a way to make that? again... im new and i dont know much about scripts
You can comment out (put a # in front of it) line 261 to disable player movement
 

shasow

Warper
Member
Joined
Jan 23, 2014
Messages
3
Reaction score
1
Primarily Uses
Again, not sure why it's happening to you and not me, but if you comment out (put a # in front of it) line 218 then it should be ok.
Thank you that fixes it.
 

Xorthias

Novice Developer
Member
Joined
Feb 19, 2014
Messages
6
Reaction score
2
First Language
English
Primarily Uses
Hey Vlue, I really enjoy your script. It was simple to use and put into my current project.

However, I have a question: Can you define where your cursor point is in relation to the icon you are using? It seems that the icon I am using has the pointer in a different spot than where the actual cursor point is and I would like to re-define it.

If you still don't understand, think of it this way...

The natural cursor pointer is on the top left corner, but my cursor icon has the point at the bottom left, can this be changed?  Or should I just adjust the icon to point to the top left?
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
That could be a problem with different icons! I updated the pastebin with two new customization options, CURSOR_OFFSET_X and CURSOR_OFFSET_Y. You can play around with those to adjust the position of the icon.
 

Xorthias

Novice Developer
Member
Joined
Feb 19, 2014
Messages
6
Reaction score
2
First Language
English
Primarily Uses
Wow, I wasn't sure if it was a feature already, but I'm surprised that you went in and coded it just for me! Haha thanks.
 

Edsephiroth

Edsephiroth
Member
Joined
Feb 10, 2014
Messages
19
Reaction score
4
First Language
Portuguese
Primarily Uses
N/A
Hello, Vlue.

I've read each post about your script and watched the evolution of your code. I'm amazed with it, but I have an issue: I'm using Schala Battle System, MOG scene file and MOG adv load bar in my project; when I click on save option, the game crashes and appears this message: Line 239: TypeError ocurred. No implicit conversion from Nil to integer.
Can you help me with it?

Thank you for your effort.
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
This'll allow you to click to load/cancel, but moving files by mouse doesn't work out.

Just put this anywhere below this mouse script:

Code:
class Scene_File < Scene_MenuBase  alias mouse_update update  def update    mouse_update    mouse_input  end  def mouse_input    mouse_cursor    on_savefile_ok if Mouse.lclick?     on_savefile_cancel if Mouse.rclick?  endend
 

Edsephiroth

Edsephiroth
Member
Joined
Feb 10, 2014
Messages
19
Reaction score
4
First Language
Portuguese
Primarily Uses
N/A
I'm sorry if I'm bothering you, but appears this message after I put the script you brought:

SystemStackError ocurred. Stack level too deep.

I've positioned the script below your main mouse script, but it crashes and appears the message I told before. After I put in the mouse script page, but the same thing happens.

Am I doing anything wrong?

Thanks in advance.
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
Oh right that would do that... I really mean, you place that below the script and then delete lines 229 - 262 of the mouse script.
 

Edsephiroth

Edsephiroth
Member
Joined
Feb 10, 2014
Messages
19
Reaction score
4
First Language
Portuguese
Primarily Uses
N/A
Hey, Man! I'm sorry for taking so long to respond.

It works! Perfectly!

Thank you, Vlue.

Once I finish my project I'll post here.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Just as Shasow, I am also having compatibility issues with Yanfly Save Engine.



Great script by the way. Also I'd like to note that unlike double-pressing (or holding) Z during ShowTexts to wiz through it quickly, clicking via mouse does not do it.

Edit: Will try your commenting-out workaround for now.

Edit 2: I don't know when you updated your script compared to last time, but the lines around 218 are not related? (218 specifically is blank) Can you be more specific? (Is it your mouse script, or Scene_File, or the Yanfly Save Engine 218?

Edit 3: Nevermind I fixed it with that small sniplet you provided the other guy.
 
Last edited by a moderator:

JohnnyR

Dungeon Master
Restaff
Joined
Mar 27, 2013
Messages
275
Reaction score
135
First Language
English
Primarily Uses
RMMV
Hey, Vlue!

I found this awesome script of yours, and after some tests, I found a bug. I'm using your Basic Options Menu Script, and if I go into the options screen while using the mouse script, the game crashes and gives me the error below:

"Script 'Basic Mouse Script' line 483: NoMethodError ocurred"

"undefined method 'rect' for nil:NilClass"

Apparently it's the same problem with the 'rect' thingy that people have been posting.. I tried using that little code you provided to fix the Yanfly Script problem, it resolved the Yanfly problem, but not this one.. I believe the error might be caused because of those slide like bars from your options script, I'm not sure though, it's just a theory.. xD

Would mind looking into it? Your mouse script is the best one in my opinion, and I really want to use it!  :D

Btw, I have the Basic Window Resizer addon, if that's of any help.
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
Yes, I didn't think about the mouse when I made the option menu script, but It's been fixed already (I hope...) ! Just need to grab both new versions of the scripts from the pastebin and put them in. They do need to go in a particular order, Options Menu above Mouse System.
 

Will11690

Warper
Member
Joined
Oct 1, 2014
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Can you post the script with this:

class Scene_File < Scene_MenuBasealias mouse_update updatedef updatemouse_updatemouse_inputenddef mouse_inputmouse_cursoron_savefile_ok if Mouse.lclick?on_savefile_cancel if Mouse.rclick?endend
Edited into it and this

Oh right that would do that... I really mean, you place that below the script and then delete lines 229 - 262 of the mouse script. 
 edited out because it doesn't matter what I do it breaks on me. I know almost nothing about scripting but I really want this script.
 
Last edited by a moderator:

Xorthias

Novice Developer
Member
Joined
Feb 19, 2014
Messages
6
Reaction score
2
First Language
English
Primarily Uses
Hey Vlue, I'm having a direct conflict with this script and Yami's Overlay Mapping script.

Basically when I have this script in my database, your mouse script does not execute anymore. The weird thing is on the main menu, (presumably when the YSE overlay is not called) I can see and use the mouse script. It is only when the game begins after the title screen that your script "disappears" and I can no longer see or use it.

If you could look into this specific issue that would be amazing. I'm assuming it has to do with where/when the mouse and overlay images are drawn for the user.

If you want to see the code without going to the website, here it is below: (This is not an advertisement for YSE in any way, shape, or form.)

Also the even weirder thing is that the game/program does NOT crash, it just renders your script useless.

Thanks.

Code:
#==============================================================================# # ¥ Yami Engine Ace - Overlay Mapping# -- Last Updated: 2012.04.16# -- Level: Normal# -- Requires: n/a# #==============================================================================$imported = {} if $imported.nil?$imported["YSE-OverlayMapping"] = true#==============================================================================# ¥ Updates# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# 2012.04.16 - Reworked with Encrypted Game.# 2012.04.13 - Ported into Yami Engine.##==============================================================================# ¥ Introduction# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script based on Hanzo Kimura's idea. This will automatically load map's# overlay by map ID, and a map can have more than one image per layer, so you# don't have to create two or more map just for day/night or when an event occur.# #==============================================================================# ¥ Instructions# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Create a folder in Graphics and name it Overlay.# Put all of your overlay into Graphics/Overlay.# Your overlay file will have the name: "Filename Prefix" + Map-ID + "-" + Number# which "Filename Prefix" is the one you will config below# Map-ID is your map's ID# Number is 1, 2, 3, ... using for Overlay Variables.## Example: Graphics/Overlay/ground2-1.png# Which means this will be ground layer, for map 2, variable = 1## Light/Shadow must be .jpg# Parallax/Ground must be .png##==============================================================================module YSA  module OVERLAY        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # - Overlay Switches -    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # These are switches which are enable overlay layers. Turn them on to show    # them in your maps.    #--------------------------------------------------------------------------    # Default: ON    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    LIGHT_SWITCH = 1        # Turn on/off light layer    SHADOW_SWITCH = 2       # Turn on/off shadow layer    PARALLAX_SWITCH = 3     # Turn on/off parallax layer    GROUND_SWITCH = 4       # Turn on/off ground layer    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # - Overlay Variables -    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # A map can have more than one image per layer, that means you can have a    # different light/shadow for day and night, or have a different ground when    # an event occured.    #--------------------------------------------------------------------------    # Default: 1    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    LIGHT_VARIABLE = 2      # Switch to another light    SHADOW_VARIABLE = 2     # Switch to another shadow    PARALLAX_VARIABLE = 1   # Switch to another parallax    GROUND_VARIABLE = 1     # Switch to another ground        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # - Filename Prefix -    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # This will make this script automatic, it will check if there are layers in    # overlay folder    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    LIGHT = "light"         # Light layer's filename prefix    SHADOW = "shadow"       # Shadow layer's filename prefix    PARALLAX = "par"        # Parallax layer's filename prefix    GROUND = "ground"       # Ground layer's filename prefix        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # - Overlay Opacity -    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    # This will make this script automatic, it will check if there are layers in    # overlay folder    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-    GROUND_OPACITY = 255    PARALLAX_OPACITY = 255    LIGHT_OPACITY = 128    SHADOW_OPACITY = 96      end #OVERLAYend # YSA#==============================================================================# ¥ Editting anything past this point may potentially result in causing# computer damage, incontinence, explosion of user's head, coma, death, and/or# halitosis so edit at your own risk.#==============================================================================#==============================================================================# ¡ Cache#==============================================================================module Cache    #--------------------------------------------------------------------------  # new method: overlay  #--------------------------------------------------------------------------  def self.overlay(filename)    begin      self.load_bitmap("Graphics/Overlay/", filename)    rescue      self.empty_bitmap    end  end  end # Cache#==============================================================================# ¡ DataManager#==============================================================================module DataManager    #--------------------------------------------------------------------------  # alias method: setup_new_game  #--------------------------------------------------------------------------  class <<self; alias ovm_setup_new_game setup_new_game; end  def self.setup_new_game    ovm_setup_new_game    setup_overlay_mapping  end    #--------------------------------------------------------------------------  # new method: setup_overlay_mapping  #--------------------------------------------------------------------------  def self.setup_overlay_mapping    # Control switches    $game_switches[YSA::OVERLAY::LIGHT_SWITCH] = true    $game_switches[YSA::OVERLAY::SHADOW_SWITCH] = true    $game_switches[YSA::OVERLAY::GROUND_SWITCH] = true    $game_switches[YSA::OVERLAY::PARALLAX_SWITCH] = true        # Control variables    $game_variables[YSA::OVERLAY::LIGHT_VARIABLE] = 1    $game_variables[YSA::OVERLAY::SHADOW_VARIABLE] = 1    $game_variables[YSA::OVERLAY::GROUND_VARIABLE] = 1    $game_variables[YSA::OVERLAY::PARALLAX_VARIABLE] = 1  end  end # DataManager#==============================================================================# ¡ Spriteset_Map#==============================================================================class Spriteset_Map    #--------------------------------------------------------------------------  # alias method: initialize  #--------------------------------------------------------------------------  alias overlay_initialize initialize  def initialize    overlay_initialize    create_overlay_map    update  end    #--------------------------------------------------------------------------  # new method: create_overlay_map  #--------------------------------------------------------------------------  def create_overlay_map    @current_light = 0    @current_shadow = 0    @current_par = 0    @current_ground = 0    # Ground Layer    @ground = Sprite.new(@viewport1)    @ground.z = 1    @ground.opacity = YSA::OVERLAY::GROUND_OPACITY    # Light Layer    @light = Sprite.new(@viewport1)    @light.opacity = YSA::OVERLAY::LIGHT_OPACITY    @light.blend_type = 1     @light.z = 299    # Shadow Layer    @shadow = Sprite.new(@viewport1)    @shadow.opacity = YSA::OVERLAY::SHADOW_OPACITY    @shadow.blend_type = 2    @shadow.z = 298    # Parallax Layer    @par = Sprite.new(@viewport1)    @par.opacity = YSA::OVERLAY::PARALLAX_OPACITY    @par.z = 297  end    #--------------------------------------------------------------------------  # alias method: dispose_parallax  #--------------------------------------------------------------------------  alias overlay_dispose_parallax dispose_parallax  def dispose_parallax    overlay_dispose_parallax    dispose_overlay_map  end    #--------------------------------------------------------------------------  # new method: dispose_overlay_map  #--------------------------------------------------------------------------  def dispose_overlay_map    @ground.dispose    @light.dispose    @shadow.dispose    @par.dispose  end    #--------------------------------------------------------------------------  # alias method: update_parallax  #--------------------------------------------------------------------------  alias overlay_update_parallax update_parallax  def update_parallax    overlay_update_parallax    update_overlay  end    #--------------------------------------------------------------------------  # new method: update_overlay  #--------------------------------------------------------------------------  def update_overlay    update_om_ground    update_om_par    update_om_light    update_om_shadow  end    #--------------------------------------------------------------------------  # new method: update_om_ground  #--------------------------------------------------------------------------  def update_om_ground    return unless @ground    @ground.visible = $game_switches[YSA::OVERLAY::GROUND_SWITCH] if @ground.visible != $game_switches[YSA::OVERLAY::GROUND_SWITCH]    @ground.ox = $game_map.display_x * 32 if @ground.ox != $game_map.display_x * 32    @ground.oy = $game_map.display_y * 32 if @ground.oy != $game_map.display_y * 32    if @current_ground != $game_variables[YSA::OVERLAY::GROUND_VARIABLE]      filename = YSA::OVERLAY::GROUND      filename += $game_map.map_id.to_s      filename += "-" + $game_variables[YSA::OVERLAY::GROUND_VARIABLE].to_s      @ground.bitmap = Cache.overlay(filename)      @current_ground = $game_variables[YSA::OVERLAY::GROUND_VARIABLE]    end  end    #--------------------------------------------------------------------------  # new method: update_om_par  #--------------------------------------------------------------------------  def update_om_par    return unless @par    @par.visible = $game_switches[YSA::OVERLAY::PARALLAX_SWITCH] if @par.visible != $game_switches[YSA::OVERLAY::PARALLAX_SWITCH]    @par.ox = $game_map.display_x * 32 if @par.ox != $game_map.display_x * 32    @par.oy = $game_map.display_y * 32 if @par.oy != $game_map.display_y * 32    if @current_par != $game_variables[YSA::OVERLAY::PARALLAX_VARIABLE]      filename = YSA::OVERLAY::PARALLAX      filename += $game_map.map_id.to_s      filename += "-" + $game_variables[YSA::OVERLAY::PARALLAX_VARIABLE].to_s      @par.bitmap = Cache.overlay(filename)      @current_par = $game_variables[YSA::OVERLAY::PARALLAX_VARIABLE]    end  end    #--------------------------------------------------------------------------  # new method: update_om_light  #--------------------------------------------------------------------------  def update_om_light    return unless @light    @light.visible = $game_switches[YSA::OVERLAY::LIGHT_SWITCH] if @light.visible != $game_switches[YSA::OVERLAY::LIGHT_SWITCH]    @light.ox = $game_map.display_x * 32 if @light.ox != $game_map.display_x * 32    @light.oy = $game_map.display_y * 32 if @light.oy != $game_map.display_y * 32    if @current_light != $game_variables[YSA::OVERLAY::LIGHT_VARIABLE]      filename = YSA::OVERLAY::LIGHT      filename += $game_map.map_id.to_s      filename += "-" + $game_variables[YSA::OVERLAY::LIGHT_VARIABLE].to_s      @light.bitmap = Cache.overlay(filename)      @current_light = $game_variables[YSA::OVERLAY::LIGHT_VARIABLE]    end  end    #--------------------------------------------------------------------------  # new method: update_om_shadow  #--------------------------------------------------------------------------  def update_om_shadow    return unless @shadow    @shadow.visible = $game_switches[YSA::OVERLAY::SHADOW_SWITCH] if @shadow.visible != $game_switches[YSA::OVERLAY::SHADOW_SWITCH]    @shadow.ox = $game_map.display_x * 32 if @shadow.ox != $game_map.display_x * 32    @shadow.oy = $game_map.display_y * 32 if @shadow.oy != $game_map.display_y * 32    if @current_shadow != $game_variables[YSA::OVERLAY::SHADOW_VARIABLE]      filename = YSA::OVERLAY::SHADOW      filename += $game_map.map_id.to_s      filename += "-" + $game_variables[YSA::OVERLAY::SHADOW_VARIABLE].to_s      @shadow.bitmap = Cache.overlay(filename)      @current_shadow = $game_variables[YSA::OVERLAY::SHADOW_VARIABLE]    end  end  end # Spriteset_Map#==============================================================================# ¡ Scene_Map#==============================================================================class Scene_Map < Scene_Base    #--------------------------------------------------------------------------  # alias method: post_transfer  #--------------------------------------------------------------------------  alias overlay_post_transfer post_transfer  def post_transfer    @spriteset.dispose_overlay_map    @spriteset.create_overlay_map    @spriteset.update    overlay_post_transfer  endend # Scene_Map#==============================================================================# # ¥ End of File# #============================================================================== 
 

Gothic Lolita

YouTube Starlet
Veteran
Joined
Oct 21, 2014
Messages
1,132
Reaction score
197
First Language
German
Primarily Uses
RMMV
I have a complex question, hope I describe it right:
I will make a mini game where the objects move to a specific area and you need to hit them in it.
You will get points on how close you hit it with the mouse buttons to the line.
It would be okay, if the script ask's, if the left and right button clicked the right time on the line. 
The point system belongs more to the eventing then the script itself. But that's the way I want to use this script. (\s/)
 

MECM

Villager
Member
Joined
Jun 16, 2014
Messages
11
Reaction score
2
First Language
Spanish
Primarily Uses
Excuse me, is there a way to show the buttons only in the map scene?. The buttons are very annoying in some scenes like battle and save scene...
 

Madlark

Villager
Member
Joined
Dec 20, 2014
Messages
10
Reaction score
2
First Language
Russian
Primarily Uses
Hello Vlue!

I've already posted this on the VXAce forums, but the issue remains (v2.7e), so I decided to give it a try here.

When 8-dir movement is enabled, I get the following error at random intervals (while moving the character). Could happen after the first click or after 20 seconds or so.



Line 319 is this:       angle = Math.atan(x.abs/y.abs) * (180 / Math::pI)

Happens even in default projects with no other scripts installed. Could you take a look please?

Thank you!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top