There should mouse event trigger actions

Give us your feedback about the Level Editor! Or have an idea? Post it here!

There should mouse event trigger actions

Postby jeje52 » 12 November 2019, 21:13

I tried to make a sniper zoom out when it's held. I can do this by checking if the player's inventory has the sniper and setting a variable whenever the player switches to it, or some other gun.

It works almost perfectly, except that the scroll wheel breaks it. Players can switch to the sniper with number keys, and switch to some other gun with scroll wheel. The zoom will stay the same.

It would be nice if we could have:
- Mouse event trigger actions like we have for the keyboard keys
- or maybe just a way to set a variable to the right mouse button and scroll wheel states.
User avatar
jeje52
Civil Security Lite [100]
 
Posts: 146
Joined: 13 April 2018, 19:52

Re: There should mouse event trigger actions

Postby Darnit525 » 13 November 2019, 15:12

i agree, this would be an excellent addition.
User avatar
Darnit525
Usurpation Soldier [50]
 
Posts: 86
Joined: 14 October 2019, 20:19

Re: There should mouse event trigger actions

Postby alj99 » 29 November 2019, 12:43

wait how do u check player inventory and how do u check which gun he/she is using, sorry i quit pb2 i think last year because the lag is beyond unbearable (even thought i can run youtube on 4k and i think my pc is beyond crap considering it is beyond 10yr old by now and can apperantly crash)
Hello.
User avatar
alj99
Advanced Usurpation Soldier [150]
 
Posts: 164
Joined: 8 April 2014, 12:01

Re: There should mouse event trigger actions

Postby jeje52 » 29 November 2019, 20:02

alj99 wrote:wait how do u check player inventory and how do u check which gun he/she is using, sorry i quit pb2 i think last year because the lag is beyond unbearable (even thought i can run youtube on 4k and i think my pc is beyond crap considering it is beyond 10yr old by now and can apperantly crash)

There's now a trigger action that sets a variable to the player's inventory. I can check what gun a player is using by setting press event triggers for all the number keys that fire when the key is pressed, then I can check if the player's inventory contains the gun that they tried to switch to, and if it does I set a variable to that gun.
It works great, but as I said, switching guns via the scroll wheel breaks it.
User avatar
jeje52
Civil Security Lite [100]
 
Posts: 146
Joined: 13 April 2018, 19:52

Re: There should mouse event trigger actions

Postby alj99 » 30 November 2019, 05:44

i think i get it now, thank you, i remember playing a new map in pb2 that uses keys to use certain action, way better than to use chat commands. Basically event triggers only apply to keyboard keys but not mouse keys. Is that right?
Hello.
User avatar
alj99
Advanced Usurpation Soldier [150]
 
Posts: 164
Joined: 8 April 2014, 12:01

Re: There should mouse event trigger actions

Postby jeje52 » 30 November 2019, 15:01

alj99 wrote:Basically event triggers only apply to keyboard keys but not mouse keys. Is that right?

Yes, it's impossible to get the scroll wheel or right mouse button states. It's possible to grab the left button's state with the trigger action "Save shoot intention of character 'B' to variable 'A'"

It would be great to have similar actions for the other mouse buttons as well, or maybe just an action to set a variable to the held gun.
User avatar
jeje52
Civil Security Lite [100]
 
Posts: 146
Joined: 13 April 2018, 19:52


Return to Level Editor

Who is online

Users browsing this forum: No registered users