Amaranth's Super Simple Mouse System for Ace

Lantiz

Biterkid
Veteran
Joined
Dec 29, 2012
Messages
719
Reaction score
1,069
First Language
Portuguese
Primarily Uses
RMMV
Now its my turn... is there a way to execute something when the run_path is done?

I tried creating a Proc variable inside Game_CharacterBase, and override the update method so it would call the Proc after run_path, but didnt work at all...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,453
Reaction score
12,014
First Language
English
Primarily Uses
RMMV
When the run_path is done (for the player), if the event that was clicked on is still in reach, it will execute.


What are you trying to do that is different from this?
 

Lantiz

Biterkid
Veteran
Joined
Dec 29, 2012
Messages
719
Reaction score
1,069
First Language
Portuguese
Primarily Uses
RMMV
Its not an event triggering route, I'm using the propper find_path method with coordinates.

My goal is part of an ABS system, trying to require that the player gets closer to the enemy, in range of the skill, before casting the skill.
 

astracat111

Astra Cat
Veteran
Joined
Jun 16, 2015
Messages
205
Reaction score
113
First Language
English
Primarily Uses
When the run_path is done (for the player), if the event that was clicked on is still in reach, it will execute.

What are you trying to do that is different from this?
To Shaz - 

I was playing around with using the super simple mouse script today, and I really think that you should include this in the main topic or in the script commenting: 

Mouse.pos[0] - Mouse x position

Mouse.pos[1] - Mouse y position

Mouse.trigger?[0] - Mouse left clicked once

Mouse.trigger?[1] - Mouse right clicked once

Mouse.pressed?[0] - Mouse left clicked and held down

Mouse.pressed?[1] - Mouse right clicked and held down

So that people can be encouraged to create mini-games, huds and custom content for this. 

It took me a little while to figure that out as I'm still just learning ruby and rgss. 

Then you can do this to add a hud button to the screen when you're running around the map scene:

#Script for when mouse is hovered over object and clicks on the object.#You have to create an instance of @custom_sprite before using, but you get the general idea.class Scene_Mapalias update_custom_alias_goes_here_for_scene_map updatedef update update_custom_alias_goes_here_for_scene_map if ( Mouse.pos[0] > @custom_sprite.x && Mouse.pos[0] < (@custom_sprite.x + @custom_sprite.width) && Mouse.pos[1] > @custom_sprite.y && Mouse.pos[1] < (@custom_sprite.y + @custom_sprite.height) && Mouse.trigger?[0]) # Do stuff here when sprite object is clicked. endendendIf you explain this, I think more people will be inclined to try creating mini-games or huds that work with this.
 
Last edited by a moderator:

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,579
Reaction score
10,917
First Language
English
Primarily Uses
RMVXA
A small point about making mini-games that totally depend upon using the mouse - some players hate mouse and always chose the keyboard/arrows option.

Just saying.
 

astracat111

Astra Cat
Veteran
Joined
Jun 16, 2015
Messages
205
Reaction score
113
First Language
English
Primarily Uses
A small point about making mini-games that totally depend upon using the mouse - some players hate mouse and always chose the keyboard/arrows option.

Just saying.
I wouldn't disagree with you, but for those that would like to use the mouse to create a mini-game or a hud this information could be really helpful. Although I admit that, to those that have used rgss and ruby for a while, they will know how to look this information up, but to those that are kind of beginners at it it could be useful. 
 

Lantiz

Biterkid
Veteran
Joined
Dec 29, 2012
Messages
719
Reaction score
1,069
First Language
Portuguese
Primarily Uses
RMMV
Just to be clear, I wanted to trigger an action at the end of the path without using an event, an idea would be to add a custom Proc call when the player reach the path end (assuming success).

BUT, a workaround of its sorts (that I didn't use, if someone cares) is to get the Mouse.grid position and create an event in runtime with a script call to do what you want with a player touch trigger, and then delete itself in the end.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,453
Reaction score
12,014
First Language
English
Primarily Uses
RMMV
I just put the find_path into the move route of the event, and follow it by a loop that checks to see if the event's x and y position matches the destination. If it does, add a break loop; if it doesn't, add a Wait 5 frames so as not to hog the CPU and give it a chance to get there.


The whatever needs to happen afterwards is added as event commands after the loop.
 

optimum45

Veteran
Veteran
Joined
Mar 31, 2015
Messages
537
Reaction score
65
First Language
English
Primarily Uses
Thank you for the wonderful mouse script.  It's become an integral part of my current work, and I was wondering if you could help me with an issue...



The mouse seems to be mis-aligned to the south by around a half a tile.  If you could help me re-align it somehow, I would greatly appreciate it.  The only other script in the program that could possibly conflict with the mouse is the Yanfly Message System as a stand alone.  I've made very few modifications.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,453
Reaction score
12,014
First Language
English
Primarily Uses
RMMV
Does it work properly if you disable the Yanfly script? I doubt it has much to do with it, as a message system and a menu system are two very different things.
 

optimum45

Veteran
Veteran
Joined
Mar 31, 2015
Messages
537
Reaction score
65
First Language
English
Primarily Uses
It didn't seem to make a difference.  I am running 640x480 format, and I suspect that has something to do with it, but other than that, I am at a loss.

I'm to afraid to tinker with this one that deep.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,318
Reaction score
2,444
First Language
French
Primarily Uses
RMVXA
If you revert to 544x416 (just for testing), does the problem still occur?
 

optimum45

Veteran
Veteran
Joined
Mar 31, 2015
Messages
537
Reaction score
65
First Language
English
Primarily Uses
I just tried this and the problem still occurs on normal resolution.

I thought I had it tracked down to an Extra Y command, but removing that did nothing either.

Pasting it into a brand new project also yielded the same result, which was confusing.   :unsure:   The only changes in the script I made were to the iconset call numbers.  I'm not sure why it would happen.

Edit:  I would also like to request knowledge of how to set either the Mouse Wheel to register Input.trigger Up and Down, and/or how to get it to trigger Up/Down after moving the mouse up or down a certain amount (or however).  One or both are for functionality with an event based menu system that accepts Input.trigger commands.
 
Last edited by a moderator:

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,318
Reaction score
2,444
First Language
French
Primarily Uses
RMVXA
The introduction to this script says "to fix the variables problem in RPG Maker VX"

It doesn't talk about VX Ace, which this Mouse script is written for.

Maybe this is the cause of the crash?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,453
Reaction score
12,014
First Language
English
Primarily Uses
RMMV
Yep, that's exactly it. That script is for VX, not Ace. The mouse script is for Ace. There isn't a VX version of this mouse script.


If you're using VX, you might be able to find a mouse script from someone else. If you're using Ace, you shouldn't use that Game_Interpreter "fix" script because it'll mess up a whole lot more than the mouse system.
 

sutorumie

I'm a whimsical girl.
Veteran
Joined
Apr 26, 2014
Messages
30
Reaction score
1
First Language
English
Primarily Uses
RMMV
My apologies if this has already been asked somewhere (if so, I can't find it) but is it possible to change the default mouse icon in-game, be it with a script call or a variable?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,453
Reaction score
12,014
First Language
English
Primarily Uses
RMMV
There is a list of icons to be used for each purpose.  You just give it a different icon index.
 

sutorumie

I'm a whimsical girl.
Veteran
Joined
Apr 26, 2014
Messages
30
Reaction score
1
First Language
English
Primarily Uses
RMMV
But the icons only change when hovering over an event. I need it to change forever. As in, the mouse icon that is always there, even when not hovering over an event (y'know, the default icon). Then I could change it at the beginning of the game based on which character the player decides to play as, just as I change the colors of the entire UI in general based on that. It'll look odd if the cursor is always blue when the player chose the character with the predominantly pink/red color scheme at the start, rather than the blue one.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,453
Reaction score
12,014
First Language
English
Primarily Uses
RMMV
Um ...

# Add/remove/change icon names here.  The icon name is what will be used in the# event <mouse ...> command to show a different mouse icon when hovering over# the event.  These MUST be in lower case here!ICON = {'arrow' => 386, 'talk' => 4, 'look' => 3, 'fight' => 116,        'touch' => 491, 'exit' => 121}DEFAULT_ICON = 'arrow'DEFAULT_ICON is 'arrow'

Therefore change the icon index for 'arrow' in order to change the default icon
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Please don't create long, boring cutscenes in which characters do nothing but stand around talking.
What if I took a lesson from Half Minute Hero? Let the player get dumb powerful each area, but reset them down to just slightly stronger than before for the next map?
Been averaging 2-3 hours sleep for almost a month now. Starting to space out all the time ^^;
loopk wrote on whtdragon's profile.
Nice to meet you. My name is loopk.
May I use the materials distributed here for adult games for sale?

Thank you in advance.
loopk wrote on Avery's profile.
Nice to meet you. My name is loopk.
May I use the materials distributed here for adult games for sale?

Thank you in advance.

Forum statistics

Threads
94,258
Messages
919,462
Members
123,977
Latest member
Panam
Top