RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Lambchop's Super Simple Mouse Script

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 87
Super Simple Mouse System
Version: 1.0
Author: Lambchop (Amaranth), Near Fantastica, SephirothSpawn, Shaz
Date: August 2, 2010

Version History


  • <Version 1.0> 8.2.2010 - Original Release
  • <Version 1.1> Nov 27 2010 - Fix to character selection and equipment selection in menu, CTRL to ignore passability, missing attr_accessor in Game_Character

Planned Future Versions

  • <Version 2.0> Plan to add HUD

Description


This script adds mouse control to RMXP.  It is a simplified version of the mouse script used in all the Aveyond games.

Features

  • Custom mouse graphics
  • Popup icons on events (sword over enemy, "talk" bubble over NPC, "hand" icon over chest, etc)
  • Pathfinding
  • Mouse-enabled menus

Screenshots



Instructions

Copy the following scripts from the demo into your own scripts file, placing them above Main:
  • Start Game
  • Mouse 1
  • Mouse 2
  • Mouse 3

Change the icons in the Graphics/Icons folder to suit your game.  Extra icons can be added, and must be inserted into the Mouse 2 script, at the top and around line 150.

Add the following comments to events to add specific mouse functionality:
  • ArrowX - on a comment on line 1, tells the script to show a certain cursor when the mouse moves over this event.  By default, Arrow is the default cursor, Arrow2 is a talk bubble, Arrow3 is a hand, Arrow4 is a sword
  • Mouse[x-offset, y-offset] - on a comment on line 2, tells the script to move the player to the specified offset, then turn towards the event and trigger it.  For example, Mouse[1, 2] will make the player move one tile to the right and two tiles below the event, turn up, and trigger the event (useful if you want the player to stand below a sign or bookshelf before reading it)
  • Name abc 123 - on a comment on line 2, tells the script to show some popup text (abc 123) when the mouse moves over this event.  If using the Name comment and the Mouse comment, the Mouse comment must be first on the line

Script


This system consists of several scripts, one of them quite large.  Please download the demo and take them straight from the project.
Note - you must be logged into the forum in order to see access the demo.

Credit


  • Lambchop (Amaranth)
  • Near Fantastica
  • SephirothSpawn
  • Shaz


Support


Post here or send me a PM

Known Compatibility Issues

  • This script redefines the Game_Character.passable? function.  If you have any mods to this function that you have made (or other scripts have made), you will need to reapply them to this script
  • If you have any windows that inherit from Window_Selectable but use non-default item sizes, you may need to add functions for oh and mouse_oh as shown in the Mouse 3 script

Demo


Demo attached (you must be logged in to see it)

Author's Notes


With the pathfinding, sometimes the player will have to click twice on an NPC that's set to move around - with the first click, they'll walk up to where the NPC is at the time, but the NPC could move away while the PC is walking.  The trigger will only happen if the NPC is still within trigger distance.

The icon, mouse offset and popup text were all added at different times, and require a total of 2 comment lines.  You COULD alter the script to allow them all to appear on line 1 and all be optional.

Restrictions

This script can be used in freeware and commercial games.
Please include the list of authors in your credits.
« Last Edit: December 08, 2011, 12:00:57 AM by shaz »
Always remember you're unique.
Just like everybody else.

*
Rep: +0/-0Level 75
... hi...
ZOMG, this script is awesome, this is definetly in my game, thanks! :D

btw, is there anyway to make it so an event will follow the cursor?

- curious?
- doubley curious?

*
Rep:
Level 87
the player will move when you click where you want him to walk.  You could make an event do a similar thing, I guess, though I can't think of a reason why you'd want to.

I wouldn't advise trying to make an event follow the cursor as it moves - the pathfinding could really make your game lag if the destination keeps changing and the path has to keep calculating, and the player can move the mouse around a LOT faster than an event can move.


I realise there's a couple of lines missing from the Mouse scripts.  They're in the Game_Character 1 script, but if you're just taking the 4 scripts, you'll need to insert them yourself.  In Mouse 1, where Game_Character is extended (around line 280), add
attr_accessor :ignore_movement
and set it to false in the initialize routine.
Always remember you're unique.
Just like everybody else.

*
Rep: +0/-0Level 75
... hi...
So that's a no?
ahh well, it's still an epic script ;D

reason why: Well, I was wondering if it would be possible to make some sort of telekinesis thingy-ma-bobby game out of it... :P

Edit: I just had another thought, instead of having the pathfinding going crazy trying to make the event follow the cursor, how about just clicking once on the object, and then clicking on the map to make the object go there?
« Last Edit: August 12, 2010, 09:36:27 AM by Karltheking4 »

- curious?
- doubley curious?

*
Rep: +0/-0Level 74
RMRK Junior
I get this error when I play it. I double checked every thing but this pops up any ways can u help please???

*
Rep:
Level 87
Just a couple of posts above yours:

In Mouse 1, where Game_Character is extended (around line 280), add
attr_accessor :ignore_movement
and set it to false in the initialize routine.
Always remember you're unique.
Just like everybody else.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Cool script. How did I not know about it before today?

**
Rep: +0/-0Level 74
RMRK Junior
this script is fabulous but I am having a couple issues with it:

when in debug mode is there any way to enable the +CTRL to walk through impassible tiles?  (if not I can live without it)

I'm having trouble using the mouse on some selectable windows, like when trying to select an actor to see equipment, status etc, moving the pointer down just a little highlights someone much further down the list.  (like if I move the pointer to character #2 the one actually highlighted is #3 and moving it down even a fraction of an inch makes it jump to #4) It looks like the same amount of distance gets tacked on every time the pointer moves down but I'm a lousy scripter so I don't want to tinker with it too much   ::)   

In the equip submenu I can't highlight a selection in the upper right at all using the mouse, only the arrows.   

This happens both in the demo and a game of my own that I tried to add it to.

if anyone can suggest a fix I'd be a happy girl  ;D

*
Rep:
Level 87
I've not had any of these issues.  I'll take a look and see if I can reproduce them.
Always remember you're unique.
Just like everybody else.

**
Rep: +0/-0Level 74
RMRK Junior
I am using RPG XP version 1.02a and Windows XP Home if that might make a difference, and not using a CMS or any other script that messes around with menu layouts.

The start, item select, and battle menus all work fine, it's just the "select an actor" and "select equipment currently in use" menus I'm having issues with.

*
Rep:
Level 87
Can you be more specific about the Equip submenu problem, where you can't select "something" at all unless you use the keyboard?

I can repro the other problems, which is half way to finding a solution :)


edit: nevermind - I see it's the whole window that's not responding.  Got a solution to the character select and CTRL issues.  As soon as I get a fix for the other, I'll update the demo.
« Last Edit: November 26, 2010, 09:56:49 PM by shaz »
Always remember you're unique.
Just like everybody else.

**
Rep: +0/-0Level 74
RMRK Junior
What I mean is, if I select "equip" and then a character I can't use the mouse to move the cursor in the box that displays Weapon, Shield etc.  I can move the cursor with the arrow keys and ENTER to select the piece of equipment I want to change.




*
Rep:
Level 87
okay, fixes all done.  I've updated the attached demo.  Can you grab it and let me know if you can run it okay and open the project?
Always remember you're unique.
Just like everybody else.

**
Rep: +0/-0Level 74
RMRK Junior
I downloaded the demo and extracted the file, but when I try to run the game.rxproj file I get an error message that says "This project is from an old version of RPG maker and cannot be loaded"  ???

*
Rep:
Level 87
yup - I was afraid of that.  The newest version of RMXP does something different with the files, and older versions can't open them.  I do have a solution - I just have to search for it.  Hold tight, and I'll replace that demo very soon.
Always remember you're unique.
Just like everybody else.

*
Rep:
Level 87
okay, done.  Try this one and see if it lets you open it now.
Always remember you're unique.
Just like everybody else.

**
Rep: +0/-0Level 74
RMRK Junior
man nuthin's ever easy  ;D

and I really appreciate all your help with this

**
Rep: +0/-0Level 74
RMRK Junior
just downloaded the latest version of the demo and now it works like a charm  :D

THanks again, Shaz

PS before I try to add it to another game, do you still need to add the attr_accessor :ignore_movement
and set it to false in the initialize routine.

to Mouse1?
« Last Edit: November 26, 2010, 10:58:03 PM by Rat Diva »

*
Rep:
Level 87
awesome :)  And you're welcome
Always remember you're unique.
Just like everybody else.

**
Rep: +0/-0Level 71
Umm piez
awseome script but umm it took me ever to figure out how to download it could you put directions on how to download it for other people   
« Last Edit: July 06, 2011, 09:46:20 AM by TNBProductions »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Yeah, you click on the link and open it with WinRAR.
It's so damn confusing!
Just checking, did you even look at the date of the last post before you posted your nausea?
Uhn.
it's like a metaphor or something i don't know

*
Rep: +0/-0Level 70
RMRK Junior
actually the reason the guy had such a tough time is that he probably, like me, found a link to this page off google. Doing this you have NO idea you have to be a member for the link to appear to you. So he probably searched all over the page for a nonexistant link.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Except that he joined the forum the day before he posted that question. Nyea.
And did you make an account just to point that out?
it's like a metaphor or something i don't know

*
Rep: +0/-0Level 70
RMRK Junior
Hi there shaz.
Congrats on the script, but I have a just a simple question.
How can I disable the mouse cursors when I am no map and just enable on menus and battles? To the kind of game then I pretend to do it's better if cursor is just enabled on these 2 things.
Tanks for the help and sorry if English is not OK.

***
Rep:
Level 88
Tried to download the script, but it only downloaded some index.php :( Can someone pls tell me where to download this awesome script?
THX

Edit: I was using Firefox :D It downloaded fine trough IE :D LOL u should make these downloads compatible with all browsers thou, ppl might get confused! :D
« Last Edit: December 17, 2011, 04:18:20 PM by patmi »