Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Mouse Input Module 3.00 [XP/VX/VXA]

Jeea":12hlft8a said:
It's been a while since I looked at this, but I'm fairly certain that you could do an event script call for Mouse.show_cursor() to manage that.


Ok. so I tried putting it and inside the parentheses, I placed "reset_state = true" ( or just "true") and what happens is that the event/common event freezes, may it be set on parallel, autorun, etc. I've tried disabling the event by self switch, exit process, or erase event, and still the same happens. Next i tried putting it on the script, specifically on Main, below or on top of the auto fullscreen piece. It runs normally, except for the problem being unsolved. Any ideas?

Hmm. Try dropping the parentheses altogether. The function isn't supposed to need them. (In other words, just "Mouse.show_cursor", minus the quotes.) Do you also have my Keyboard script installed? This gets updated by that one, and without it the mouse won't keep being updated.
 

Jeea

Member

Glitchfinder":1nrgn6fc said:
Hmm. Try dropping the parentheses altogether. The function isn't supposed to need them. (In other words, just "Mouse.show_cursor", minus the quotes.) Do you also have my Keyboard script installed? This gets updated by that one, and without it the mouse won't keep being updated.

I tried it out, and it still freezes the event. It makes the player unable to move. I also tried it on main and same results also(see my early post). Yes, I do have your Key input module at the top of the Mouse input module. (I also upgraded it to version 1.20).
If this may help, I also have other scripts used like MGC's FPLE, and a map name displayer (which has no name on it..>< I'll look it up again)
 
Jeea":15r1g54i said:
Glitchfinder":15r1g54i said:
Hmm. Try dropping the parentheses altogether. The function isn't supposed to need them. (In other words, just "Mouse.show_cursor", minus the quotes.) Do you also have my Keyboard script installed? This gets updated by that one, and without it the mouse won't keep being updated.

I tried it out, and it still freezes the event. It makes the player unable to move. I also tried it on main and same results also(see my early post). Yes, I do have your Key input module at the top of the Mouse input module. (I also upgraded it to version 1.20).
If this may help, I also have other scripts used like MGC's FPLE, and a map name displayer (which has no name on it..>< I'll look it up again)

I was looking into it a couple of days ago, and it would seem my script has some flaws regarding showing/hiding the mouse. I got it to consistently show the mouse, but it couldn't keep it constantly visible in fullscreen even then. At the same time, I didn't test hiding the mouse, but I imagine it wouldn't be too difficult to hide the mouse and swap out an ingame cursor. I've done that before.
 

Jeea

Member

Glitchfinder":2u62j2fg said:
I was looking into it a couple of days ago, and it would seem my script has some flaws regarding showing/hiding the mouse. I got it to consistently show the mouse, but it couldn't keep it constantly visible in fullscreen even then. At the same time, I didn't test hiding the mouse, but I imagine it wouldn't be too difficult to hide the mouse and swap out an ingame cursor. I've done that before.

That sounds even better! Could you add that up to the script? That'd be awesome :angel:
 
I'm in the process of writing a pretty hefty update to this script and possibly my keyboard script. They'll both be getting new licenses as well. (at the moment, I'm thinking about going with the MIT license) To give a preview of the changes in this one, thus far I have:

  • Rewritten mouse show/hide to use image cursors
  • Finished implementing the double click feature
  • Reworked double click and drag tracking to work per button
  • Given access to more of the calculated values
  • Started work on functions to convert the different types of mouse coordinates I have to other kinds. (i.e. x, real_x, relative_x, etc.)

I might be able to post it tonight, but I'm not entirely certain.
 

Jeea

Member

Take your time. That's a long list. Thanks for giving it considerations by the way. I appreciate that. :biggrin:
 
Jeea":3b85sml6 said:
Take your time. That's a long list. Thanks for giving it considerations by the way. I appreciate that. :biggrin:

Actually, everything but the last point in that list was written in the past tense because I had already done it. I was working on the last point when I got called in to work, so...yeah. Haven't finished, have a really busy schedule next week too >_<.
 

Jeea

Member

Oh, I see. XD You should comply with it then. Focus on that and when you feel like it, you can resume working on the last one. There's no need to rush it. Take your time, please. :smile:
 
I've just updated this script to a new version. The condensed changelog is below.

Version 3.00:
  • Updated and improved the update function.
  • Added the ability to use the non-primary mouse keys for the drag check.
  • Added the ability to use the non-primary mouse keys for the double-click check.
  • Added the ability to check the position of the mouse at the last click.
  • Added the ability to move the cursor.
  • Added shortcut functions for conversion between three of the coordinate systems used in this script.
  • Fixed the calculations used to determine screen size and location.
  • Fixed the show_cursor and hide_cursor functions.
  • Changed the license to the MIT license for better ease of use.
  • Tested to ensure functionality in RPG Maker XP, RPG Maker VX, and RPG Maker VX Ace.
  • Heavily updated the format of the initial post.

The most important update here is that this script is now under the MIT license, which means that you're free to use it as you see fit so long as you include the license somewhere. It also means I can't see any legal repercussions for what you do with the script, since that's not under my control. That said, this is a major update, enough that it got bumped up to 3.00 for the version number.
 
Jeea":29hwpci3 said:
Awesome! Thanks Glithfinder. Definitely crediting you for this. :bd keep up the great work

I'm sorry it took so long to roll that update out. Stuff was kind of crazy at work for a few months, so I didn't have much time on my plate.

Anyway, if there are any issues, please feel free to ask about them.
 

Jeea

Member

Glitchfinder":3nf9r802 said:
Jeea":3nf9r802 said:
Awesome! Thanks Glithfinder. Definitely crediting you for this. :bd keep up the great work

I'm sorry it took so long to roll that update out. Stuff was kind of crazy at work for a few months, so I didn't have much time on my plate.

Anyway, if there are any issues, please feel free to ask about them.

It's ok. I tried it out a while earlier and so far, it works great. I'll let you know if I have one.
 
I'm having trouble getting LBUTTON, RBUTTON, ANYBUTTON to trigger anything. Other keys work, and position works, but none of my ifs do anything for mouse buttons. Could this be due to using a touchpad and usb mouse?
 
Do PRIMARY or SECONDARY work? If so, I recommend using those anyway (as they refer to whichever button "left" click is on the given machine. You can reverse them for lefties, after all.) As for ANYBUTTON, I'm not entirely certain what the issue could be. I doubt it has anything to do with the touchpad/USB mouse, since I built this script using the same kind of combination. When you say other keys work, what exactly does that refer to? If it's for the keyboard, I'll have to double check to make sure that things are interfacing properly. If it's for the mouse too, then I'll have to do some more in-depth digging to see if there have been any system-wide changes in how this input is handled.

Speaking of, what OS are you on?
 
I've worked out it's another script in my project causing issues, as it works perfectly in a blank project. I'll try and work out what it is and remove it. I wouldn't have thought anything I have would though, but I bet there's something.
 
Hello,

I have some problems to use your script.
In fact, I don't know how to use it : for example, I would like to open the menu when I click on right button of my mouse (like a trigger so).
I used differents methods : event with a condition script/switch on to enable a common event witch work in parallel with switch condition.
I hope that you will accept help me ^^'

Kinsuke

PS : I'm french so, excuse me if my english isn't perfect ^^'
 
Hello! Thank you for the great scipt!

My knowledge is a bit limited, so I want to ask if it's possible (and if so, how) to transfer the values I get with Mouse.real_x_to_x() to variables? The idea is to have a parallel process event changing a picture depending on the mouse position.

Thank you for your help!
 
Use a Call Script event command to set `$game_variables[NUMBER] = Mouse.real_x_to_x()` where NUMBER is the variable number. That's my quick suggestion without knowing what the Mouse.real_x_to_x() method does.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top