ZaellixA 383 Posted September 6, 2019 Hey all, I am trying to find a way to restrain the movement of the mouse. The aim is to restrain the movement of the weapon to lie inside the aiming deadzone so that the player won't be able to steer the unit with the mouse. So far I have used vectorDir, weaponDirection and some vector manipulation commands in order to find what the angle between the facing-direction of the unit is and the direction the weapon is facing. Seems to work OK (unless I am missing something), but regardless of the functionality of this part of the script I can't find any way to restrain the mouse movement. If you have any idea (or a source to point me to) please let me know. Thanks in advance, Achilles. Share this post Link to post Share on other sites
wogz187 1085 Posted September 7, 2019 @ZaellixA, Like this?disable user input Also, how does cursorTarget or cursorObject react to invisible objects? Seems you could save a lot of triangulation by just having an invisible object spawn in the center of the players FOV-- if that works with the previous commands-- maybe? Worth a test. Share this post Link to post Share on other sites
ZaellixA 383 Posted September 7, 2019 Hhhhmmm, interesting approach... Can't really think of a way to use cursorTarget and/or cursorObject to get the direction the weapon is pointing relative to the unit. If you have something specific in mind I would be more than glad to head about :). Now regarding the disableUserInput, I don't think this is what I am looking for, as I am looking for a way to restrain the mouse and not letting it move outside a specific boundary (looking for a restrain on the horizontal axis but ending up restraining the mouse in a box wouldn't hurt too much). disableUserInput actually renders the player unable to use anything, which is not what I am looking for. I would really like to get something like setMousePosition which will work while NOT in the map (which is how setMousePosition works). 1 Share this post Link to post Share on other sites
Dedmen 2590 Posted September 11, 2019 On 9/7/2019 at 11:06 AM, ZaellixA said: to get the direction the weapon is pointing relative to the unit https://community.bistudio.com/wiki/weaponDirection 2 Share this post Link to post Share on other sites
ZaellixA 383 Posted September 15, 2019 On 9/11/2019 at 11:37 AM, Dedmen said: https://community.bistudio.com/wiki/weaponDirection Yeah, as I said in the initial post I have already used this command to do exactly that. In the previous post I was just saying that I cannot think of a good way to use the commands wogz187 suggested to get the weapon direction. So far I haven't managed to do something with any commands I have found... It seems to me that there are no scripting commands to constrain the move of the mouse inside a specific "polygon". Or to be more exact I haven't found any way to restrain the mouse movement at all (except when in the map getMousePosition and setMousePosition). I have come to believe that this is not possible through ArmA scripting. Please let me know if you have any other idea that could prove me wrong. Thanks all for the information. Best, Achilles. Share this post Link to post Share on other sites
Dedmen 2590 Posted September 17, 2019 On 9/15/2019 at 9:17 PM, ZaellixA said: It seems to me that there are no scripting commands to constrain the move of the mouse inside a specific "polygon" Correct. There aren't. On 9/15/2019 at 9:17 PM, ZaellixA said: I have come to believe that this is not possible through ArmA scripting. Yes that's correct. 1 Share this post Link to post Share on other sites
ZaellixA 383 Posted September 18, 2019 Thanks, is quite nice to now that I don't have to spend time on that 🙂 Share this post Link to post Share on other sites