Detect Mouse Click with Shaz Super Simple Mouse System

Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
I'm using the Shaz Super Simple Mouse System, a convert form RMXP Mouse script by Near Fantastica and SephirothSpawn. The script is really amazing but there is one thing bother me. Is there any script call that i can detect if player left click,right click,..? just like Input Trigger.


Here is the script


http://pastebin.com/TxKQa3WK
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,866
Reaction score
14,520
First Language
English
Primarily Uses
RMMV
Please remove my script from your post and put a link to the original thread instead.


Input Trigger does check for left click and right click.  That's how it works.
 

Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
Please remove my script from your post and put a link to the original thread instead.


Input Trigger does check for left click and right click.  That's how it works.

I edited it. So if Input Trigger don't do it, is there a way, like a script call to do it?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,866
Reaction score
14,520
First Language
English
Primarily Uses
RMMV
Input trigger does test for left and right mouse click.


Unless you've modified the script or added another one that overrides it.
 

Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
Input trigger does test for left and right mouse click.


Unless you've modified the script or added another one that overrides it.

the only thing i moddified is the icon setting,i test with conditional branch to check if c button is pressed, and if i left click, nothing happen


I found this part is your script


#--------------------------------------------------------------------------
# * Mouse to Input Triggers
# key => Input::KeyCONSTANT (key: 0 - left, 1 - middle, 2 - right)
#--------------------------------------------------------------------------
Mouse_to_Input_Triggers = {0 => Input::C, 1 => Input::B, 2 => Input::A}


Do I need to do something with it?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,866
Reaction score
14,520
First Language
English
Primarily Uses
RMMV
Try testing for Input.repeat instead of Input.trigger - I do think the "button is pressed" part of the conditional branch has timing issues - if the condition is not tested at the exact time the button is pressed there may be issues.


Mouse.trigger?(x) might also work, but you'd have to check what value x needs to have - look for the Mouse module's trigger? method definition, and the comments will tell you.  I think it's 0 for left button and either 1 or 2 for right button).
 

Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
Try testing for Input.repeat instead of Input.trigger - I do think the "button is pressed" part of the conditional branch has timing issues - if the condition is not tested at the exact time the button is pressed there may be issues.


Mouse.trigger?(x) might also work, but you'd have to check what value x needs to have - look for the Mouse module's trigger? method definition, and the comments will tell you.  I think it's 0 for left button and either 1 or 2 for right button).

I try Input.repat::C and got this error


error1.png


I try Mouse.trigger?(0), and get this when i left click


.error2.png


:(  
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,866
Reaction score
14,520
First Language
English
Primarily Uses
RMMV
you need to look up the correct syntax.
 

Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
you need to look up the correct syntax.

what is that? i'm a noob at script, the only thing i could found is 0 - left, 1 - middle, 2 - right, i try and it still not work?


Can you explain more
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,866
Reaction score
14,520
First Language
English
Primarily Uses
RMMV
Show a screenshot of the event where you're putting the script call.
 

Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
here is the screenshotUntitled-1.png
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,866
Reaction score
14,520
First Language
English
Primarily Uses
RMMV
It's working for me, but the timing has to be exact.  Because you're doing it in an event, that means there's other stuff happening and it's not checking for a mouse press constantly.


Even replacing Mouse.trigger? with Mouse.repeat? doesn't register every single time I press the mouse.


I'm not really sure what the solution is. It works fine in the menus, but that's pure script and not processed by Game_Interpreter.  What is it that you're trying to do?
 

Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
It's working for me, but the timing has to be exact.  Because you're doing it in an event, that means there's other stuff happening and it's not checking for a mouse press constantly.


Even replacing Mouse.trigger? with Mouse.repeat? doesn't register every single time I press the mouse.


I'm not really sure what the solution is. It works fine in the menus, but that's pure script and not processed by Game_Interpreter.  What is it that you're trying to do?

idk but my pj keep getting the same error, even a blank new one :(
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,866
Reaction score
14,520
First Language
English
Primarily Uses
RMMV
pj?


What are you trying to accomplish?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,193
Reaction score
841
First Language
Hungarian
Primarily Uses
RMVXA
The interpreter got a bug, it constantly skips some frames, so not every button trigger will register.


It has been noticed several times before by users, and I know that Source made a fix for it.


I think it's name was something like "Interpreter Bug Fix" or similar, it is posted on this forum for sure, so you can search for it here.


If that won't fix the issue you get, you will most probably need to search the cause somewhere else.
 

Latest Threads

Latest Profile Posts

Going to start a new project today. OMG, it will be on RPGMaker MV. :D
Paid material WIP~
EysZO9cVEAEWy9W

This is Alchemy pack.
I decided to add more witch elements.

Now we have wooden props, candles, pots, and potion bottles.
We also want to add herbs, kettles, fireplaces, etc.
First posts! Maybe I can use this update?
Using MV here: can i move blocks around in the event page and i'm just too stupid to do it or does it only look like you should be able to do it and i would always need to cut and paste?
Aba, aba chgb rtb fhz.
Ubp rfg hahz qr snohyvf srpv, cbfg bzarf.
Rtb vhfghf ibyb hg ivtvyb ubp hahz rk yhqb.
Qbarp fvathyvf yhqvb yhqvhf cbgrfg, aba zntvf.

Forum statistics

Threads
110,391
Messages
1,052,902
Members
143,442
Latest member
TolomeoSolano
Top