[Ace] Fullscreen++ and Amaranth's Super Simple Mouse System Ace

Hello everyone,

I've spent a while on the forums looking for a solution, but even though I found some discussions of similar issues, none of them were of much help.

I'm having trouble making "Amaranth's Super Simple Mouse System Ace" by Shaz (http://pastebin.com/TxKQa3WK) work together with "Fullscreen++" script by Zeus81 (http://pastebin.com/raw.php?i=kc1hzBek).

The mouse cursor is there and it works, but whenever I switch the fullscreen mode to anything different from the native RMVXA resolution (by pressing F6), the cursor reverts to Windows system pointer when leaving any edge of the game screen except the top. This renders the mouse system only semi-usable.

I've uploaded a short video here, I hope it helps: https://www.dropbox.com/s/7qlcym70vpbmxnu/Mouse%20bug%20-%20fullscreen.mp4?dl=0

Happens in windowed mode as well, but it's less frustrating because you can see the desktop and it's not as disorienting.

The best solution I see would be to prevent the cursor from leaving the game window ("game area" if in fullscreen) at all, but since I couldn't code my way out of a broom closet I obviously need some help.

Thank you in advance!
That's a problem I've found too, and I couldn't fix it as well.

This fullscreen script only does a zoom on the window, so the mouse cursor is not limited to the displayed space and, if you move outward that space, the Windows cursor can appear instead of the game cursor.

It doesn't happen in the "classic" fullscreen mode since then Windows restricts the display space to the actual focused window instead of just zooming.
Hi cabfe,

This doesn't happen with Vlue's mouse script (http://pastebin.com/gw4GKWk0) or (kind of - the mouse still leaves the right and bottom edges of the screen) Jet's mouse system (http://pastebin.com/raw.php?i=3KPTNr7z), so I think it should be possible to fix this for Shaz's system as well...
They all lose the mouse unfortunately, when you go to the far right or bottom.

But maybe there's a way to limit the mouse movement. I'll take a look at both Shaz and Jet's scripts and see if I can find something, although I'm only a pretty average scripter.

Edit: For the moment, I got a system that reinitialize the mouse cursor position to an arbitrary location inside the screen space when Fullscreen is active (with Jet's script).

I'll see if I can get a better fix.

Edit2: Got it for Shaz's script as well, in its crude form like for Jet's. Still working on it.
They all lose the mouse unfortunately, when you go to the far right or bottom.

[...]
Not really, at least the Windows pointer doesn't show, and in Vlue's case the in-game cursor never disappears from the screen, even if you move it to the far right/bottom. It does "stick" there a bit because the actual cursor is by then out of bounds and invisible, but at least the confusion factor is reduced.

Thank you very much for looking into this! I hope you find a solution =)
Actually, I'm now facing the opposite problem with Shaz's script: the mouse cursor no longer wants to leave the screen space, even in windowed mode. :dizzy:
Wait, this is perfect! Do want! XD
Really?
I find it annoying not to be able to free the cursor in windowed mode. You have to ALT-TAB to do something else.


Anyway, here are my modifications for Shaz's mouse script:
I don't know if I can paste the entire script here, so I'm only posting my fix.
It's very crude, be warned not to take it as an optimized fix!

Spoiler
After line 274 (@sys_cursor_visible = false):


SetCursorPos = Win32API.new('user32', 'SetCursorPos', 'nn', 'n')
GetWindowRect = Win32API.new('user32', 'GetWindowRect', 'lp', 'i')
GetClientRect = Win32API.new('user32', 'GetClientRect', 'lp', 'i')
a = Win32API.new('kernel32', 'GetPrivateProfileString', 'pppplp', 'l')
b = Win32API.new('user32', 'FindWindow', 'pp', 'i')
a.call("Game", "Title", "", title = "\0" * 256, 256, ".//Game.ini")
@handle = b.call("RGSS Player", title.unpack("C*").collect {|a| a.chr }.join.delete!("\0"))
Win32API.new('user32', 'ShowCursor', 'i', 'i').call(0)

def self.area?(x, y, width, height)
@pos[0].between?(x, width + x) && @pos[1].between?(y, height + y)
end


def self.client_size2
rect = [0, 0, 0, 0].pack('l4')
GetClientRect.call(@handle, rect)
right,bottom = rect.unpack('l4')[2..3]
return right, bottom
end

def self.set_pos(x_pos = 0, y_pos = 0)
width,height = client_size2
if (x_pos.between?(0, width) && y_pos.between?(0, height))
SetCursorPos.call(client_pos[0] + x_pos,client_pos[1] + y_pos)
end
end

def self.client_pos
rect = [0, 0, 0, 0].pack('l4')
GetWindowRect.call(@handle, rect)
left, upper = rect.unpack('l4')[0..1]
return left + 4, upper + 30
end
and another part after line 384 (that is, 384 after you pasted the above lines, else it's line 348 - it's after the "# Leaving / Entering Range?" section):
Spoiler
if area?(0, 0, 544, 416)
then #nothing
else set_pos(16,16)
end

I've set the reset position for the cursor at 16, 16 but you can change it to anything you want inside the window.



Edit: I've just found a simple way to test if I'm in windowed mode or fullscreen.
Assuming no one has a screen smaller than 544 pixels in width (which should be everybody 🙂 )
Replace part 2 of my script fix above by this:
Spoiler
if client_size2[0] > 544
then
if area?(0, 0, 544, 416)
then #nothing
else set_pos(16,16)
end
end
Hello!

Sorry for the late reply, just got around to testing your fix. It works, but to be honest I'm not too sure what's less confusing - having the mouse leave the screen or jump back to certain point whenever it does =)

In any case, thank you for the fix!
I have just fixed the mouse script for use with Fullscreen++ by creating a game launcher. I'll release it for you to use once I figure out how to use hooks to disable F1, F12 and Alt+Enter keys.
Hi!

That's an interesting approach, would love to try it out!
Hi!

That's an interesting approach, would love to try it out!
Posting solution for this soon, exhausted due to excessive programming. D:
Just make sure to implement some sort of a check as described here: http://himeworks.com/2014/10/using-custom-game-launchers-in-rpg-maker/

Alternatively, swap your current script with Dekita's Mouse script (Included on his Heavily Optimized Input System (http://dekyde.com/1/post/2015/03/heavily-optimized-input-system.html)). Works well and it's a lot better (Note: Mouse is only used for menus with that script).
Thank you for the suggestion (I wasn't aware Dekita also had a mouse script), but unfortunately a menu-only mouse is not an option for me, since I would like the player to be able to control the character's movement and interactions via mouse as well.
Thank you for the suggestion (I wasn't aware Dekita also had a mouse script), but unfortunately a menu-only mouse is not an option for me, since I would like the player to be able to control the character's movement and interactions via mouse as well.
Exactly. I'll pm you with what I've got when I wake up tomorrow. I'm working on some other really neat things and just making some good progress with it. Will release it all when I'm finished with this stuff.
USEFUL STUFF

This did the trick for me.


Nice one! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/ace-fullscreen-and-amaranths-super-simple-mouse-system-ace.39987/