I'm currently working on a project that requires complicated menu commands, so I decided to use events instead of altering the default game menu, and I'm planning to use Jet's Mouse System along with it.
But some of the buttons I'm making are 16x16 (it's for a color selection palette), if I could somehow bind the mouse's X and Y coordinates to variables, then eventing this would be fairly easy to accomplish.
I know that Grim's Event Extender script allows this, but all of the links to that are dead, and I can't seem to find any other scripts that do this.
If someone could make a script that does this, I would be eternally grateful. :)
[Ace-Script Request] Mouse X&Y Coordinates Bound to Variables
● ARCHIVED · READ-ONLY
-
-
Alternately: if anyone has or knows where to find Grim's Event Extender script, that should cover everything I'm needing. :)
-
Metalraptor, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
Find this block of code under module Mouse in the mouse script:
Code:Try changing it to this (I'm using variables 5 and 6 - substitute whatever variables you want to use - note, each variable is used twice, so you've got 4 lines to change):def pos return 0, 0 if $game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH] x, y = screen_to_client(*global_pos) width, height = client_size begin x = 0 if x <= 0; y = 0 if y <= 0 x = width if x >= width; y = height if y >= height return x, y end end
Code:def pos if $game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH] $game_variables[5] = 0 $game_variables[6] = 0 return 0, 0 end x, y = screen_to_client(*global_pos) width, height = client_size begin x = 0 if x <= 0; y = 0 if y <= 0 x = width if x >= width; y = height if y >= height $game_variables[5] = x $game_variables[6] = y return x, y end end -
Thanks Shaz, and sorry about that, I thought that more time had gone between the posts.
I just tried that, and it's giving me an error message:
"Script 'Mouse System' line 231: NoMethodError occurred.
undefined method `[]=' for nil:NilClass" -
72 hours (3 days) is the time between double-posting/bumping.
ah, yeah. Do this instead:
def pos if $game_switches[JetMouse::TURN_MOUSE_OFF_SWITCH] if $game_variables $game_variables[5] = 0 $game_variables[6] = 0 end return 0, 0 end x, y = screen_to_client(*global_pos) width, height = client_size begin x = 0 if x <= 0; y = 0 if y <= 0 x = width if x >= width; y = height if y >= height if $game_variables $game_variables[5] = x $game_variables[6] = y end return x, y end endI wonder why it flipped out on $game_variables, but $game_switches was okay ... -
That did the trick, thanks a lot Shaz! ^_^
-
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.