Can I set the cursor to move a character without clicking?

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
Basically what I'm doing is experimenting with making a first person point and click horror game using Blender cycles rendered images as parallaxes for rooms and all that. What I'm wondering is if I can obtain the same scrolling effect I get when setting the "player" invisible and clicking around the screen, but without actually clicking in order to navigate, because I want clicking to be reserved for the action button when clicking on objects with event triggers over them.

In short, can I move the player by only MOVING the cursor around the screen instead of clicking, and still ONLY trigger events by clicking on them?

Also If there's a plugin for this, that'd be awesome.
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@UnderYourCloset If you have another comment, question or info please use the Edit button on your earlier post and add the additional information there. I have merged your posts this time for you.

[move]JS Plugin Requests[/move]
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
EDIT: (Please see later posts, this post links Yanfly's Picture Common Events, the actual plugin needed is Yanfly's Grid Free Doodads)

http://yanfly.moe/2016/04/01/yep-88-picture-common-events/

This is a link to Yanfly's Picture Common Events plugin. What's interesting about this plugin is that it adds properties to the TouchInput object
for the x and y position of the mouse.
After enabling the plugin, you'll have access to the following script commands:
TouchInput._mouseOverX
and
TouchInput._mouseOverY

These two properties can tell you the current position of the cursor on screen.

Also, if you don't already know, the following code will detect the width and height of a user's display area

Graphics.width
Graphics.height

Yanfly's link at the top of this reply doesn't mention (that I see) if this plugin has any dependencies. In general, many of those plugins require the Yanfly Core, but atm I have quite a few Yanfly scripts enabled and disabling the core causes quite a few bugs, so I haven't tested that.

Either way, with the width/height of a user's display area, and the cursor X/Y, you can easily set up events to occur based off of the mouse's movement.
I hope this helps, don't hesitate to ask if you need more assistance, or if this doesn't quite make sense for you.

EDIT:
Also, if you didn't know, TouchInput.x and TouchInput.y will return the LAST clicked position on screen, which can assist you in moving the player if needed, although initially your post says it would be first person. Toward the end however, it does mention moving a player, so just in case you need to know...
You can, using a JS Math function and the tile size for your game, do something like this (for example if you have standard 48x48 tile size settings):

Math.floor(TouchInput._mouseOverX / 48)
This will return an x coordinate that a sprite could move to, if needed.
TouchInput essentially returns pixel coordinates, which won't be useful if you're moving an actual sprite as opposed to simply scrolling the screen in response to the pixel coordinates of your mouse, so it's necessary to divide by the tile size, and then round down.
 
Last edited:

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
So are you talking about setting up a script command that automatically works as a parallel event, or do the triggers need to be an image splashed over the screen? Also do I need to put specific values in after the "TouchInput._mouseOverY/X" commands? Is the Graphics.width/height commands you're talking about the plugin commands under the Community_Basic plugin? I've already set the screen's size to quite large. 1920x1080 to be exact.
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
Whenever you enter the script command Graphics.width or Graphics.height, it will return the appropriate values for the machine it's being used on. This means if someone else is playing with a different set of dimensions, the code will still work correctly.

Graphics.height and Graphics.width are script calls that are available regardless of plugin. I'm pretty sure they're part of PIXI, so they're already valid regardless of plugins.

You do not need images to use the Yanfly Picture Common Event script for this particular solution. It just so happens that, behind the scenes of that plugin, it adds the very useful ._mouseOverX and ._mouseOverY properties.
Also, note that all of the calls I'm mentioning are script calls, not plugin calls.

I would start by setting up a parallel event like you mentioned. Have a set of conditional branches that checks for the borders of your screen using the TouchInput._mouseOverX property. The branch should use the script box, and here's an example of what you could put in there:

TouchInput._mouseOverX < Graphics.width * .15

That condition will trigger once the mouse moves within 15% of the left edge of the screen.

It's a good idea to use Graphics.width and percentages, because as you know, different people are using different screens, so any hard-coded values could alter the behavior of the program for different people.

Likewise, for the right border of the screen, I would put the following in the script box of a conditional branch:

TouchInput._mouseOverX > Graphics.width * .85

That condition will trigger once the mouse moves within 15% of the right edge of the screen.


You could have a similar setup for the ._mouseOverY properties. Just remember with the Y axis, 0 is the top and Graphics.height is the bottom of the screen.

Please let me know if this all works for you, if you need further assistance or if you're looking for a different solution.
 

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
I've only played with conditional branches briefly before when setting up light switches in Terrax Lighting. How would I set up the triggering? Would it be a self switch or another events page or.. Yeah sorry I'm a noob at RPG Maker, lol. It's also been a while since I've used MV.

Actually I'll just send a screenshot and you can tell me what I've done wrong. Like I said, conditional branches are confusing for me, lol

Edit: I presume that I should separate those two commands into separate script lines rather than how you wrote them? Or I could be completely lost, haha
 

Attachments

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
So here' s a very basic example of capturing ._mouseOverX and ._mouseOverY for the borders of the screen. If I come with 15% of the right border of the screen, it scrolls the map to the right, 15% of the top border moves the screen up, etc

mouseOverExample.png



When you open a Conditional Branch, in the settings, if you go to the 4th tab, the last option is script. That's where you'll enter the TouchInput._mouseOverX and TouchInput._mouseOverY conditions, as shown in the picture.

Also, 15% is a little touchy, you might want to make it between 5 and 8%, honestly. So that would be
.05 to .08 for the left and top borders,
and
.92 to .95 for the right and bottom. Play around with the percentages as you see fit. In my opinion, from my tests, 15% was much too sensitive.
 

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
Okay so I did what you said, and still nothing. Is there something extra I need to do? I'll mess with values after I can get the command to work. Anything you need to know that would affect this command?
 

Attachments

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
After some more testing, I don't know how I made this error before, but it appears I told you the wrong plugin.
I was sure it was Yanfly's Picture Common Events.
However, I just went and disabled EVERY plugin I had and starting going through them individually.
It seems Yanfly's Grid-Free Doodads is the one you'll want.

http://yanfly.moe/2016/09/17/yep-116-grid-free-doodads-rpg-maker-mv/

There is a small amount of installation required, but it's super easy. Also, in general....Grid Free Doodads is AWESOME.

Follow that link, download the plugin, the .JSON file and the images. Get all of that installed, will take just a few moments, and the page is very clear about how to install them.

After that, try running your map again (after enabling the plugin, of course)
Also, make sure the map you're on is larger than the standard 17x13, otherwise there's nowhere for the screen to scroll anyway.
 

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
Alright you are a damn lifesaver. Thank you so much! If you'd like I can put you in the credits for technical support, lol

Another side question, is there a way to increase player speed beyond the highest speed setting? Because the invisible player functions as the cursor, and I'd rather there not be a huge delay before an event triggers. 6 is too low of a speed. The camera pan from left to right works flawlessly though. :D
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
As far as I know, you can't make the player go faster without needing a plugin, and I don't know of any off the top of my head.

Hmm, you're saying that instead of seeing a player, you're using a graphic akin to a cursor for selection?

I ask because I've done something before that I felt worked wonderfully. I had a separate parallel process that repeatedly drew a picture centered on where my cursor was (using the TouchInput._mouseOverX and Y properties.

I had to show the picture with the script command, as the event command doesn't allow you to use script calls for the X and Y.
Also, to save from repeatedly drawing the graphic nonstop, you had to press SHIFT to bring the image up.

Anyway, help me understand what you mean by using the player as the cursor, because if how I described it is the case, I have a better solution for you.

Either way, it sounds like the type of game your doing could benefit from the following plugin:

https://forums.rpgmakerweb.com/index.php?threads/mouse-system-ex.46511/

Take a look at it, it allows events to be clicked to activate without the player having to touch them, and it gives you options for how the cursor looks and behaves. I have a hunch that it will help you.

Let me know if this is useful, or if you need different options.
 

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
Ok so this plugin looks like what I need, but how do I now turn off player movement when I click on an event, and instead have the event activate immediately? Do I need another plugin to turn off cursor player movement or do I just need to set something up?
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
I had thought of this just a moment ago lol, I was coming back to tell you this.

http://yanfly.moe/2015/12/01/yep-35-stop-map-movement/

This is super useful for games where you don't want the player moving around, or plan on keeping the player sprite transparent.
It also allows you to stop Event's from moving, too.


http://yanfly.moe/2018/10/19/yep-172-touch-input-disabler-rpg-maker-mv/
This plugin gives you more control over what kind of Touch Input is allowed.
The stop map movement plugin will do what you just asked, but checkout this Touch Input Disabler plugin.

But BE WARNED. I don't know if it will play nice with the Mouse System Ex from the previous reply.
 

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
Well I stopped player movement, and now no events can trigger at all, lol

I'll go searching and see if I can find a plugin that makes player movement much faster, that way it'll still use the player for event triggering but won't have so much wait time for the walking animation.
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
Ok so i did some more research, turns out this TDDP Mouser System Ex doesn't work with the latest version of MV
However, another user fixed it , and the link is here

pastebin.com/y3C2Tw4z

Click download on that page, replace the TDDP plugin you do have.
When you want an event to activate via click, you put
click_activate!
in the notetag box at the top of the event.

I tested this with StopMapMovement, and it worked. I had the Player movement frozen, my border-screen-scroll was working, and clicking on the event activated it.
 

UnderYourCloset

Villager
Member
Joined
Jul 2, 2019
Messages
21
Reaction score
21
First Language
English
Primarily Uses
RMMV
Wow, thank you so much! I think it's all set now. Scrolling and click activation are working beautifully. :D I'll put "Special thanks to standardplayer from rpgmakerweb.com for technical support" in the credits if you'd like. :D

Edit: I hope this thread also helps some others out as well. :)
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,450
First Language
English
Primarily Uses
N/A
@UnderYourCloset I'm glad it's all working, sorry I sent you down the wrong path a few times. No need for any specific credit, if anything thank the whole forum but definitely credit @Yanfly and @Galenmereth for the plugins, as well as @Krimer for the updated fix to the TDDP_MouseSystemEx plugin.

Feel free to DM me if you need any further assistance with these plugins, I'll always help if I'm able :D
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top