Author Topic: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)  (Read 8882 times)

0 Members and 1 Guest are viewing this topic.

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)
Release of Toggleable 'Mouse as a Joystick' Script: Community Edition
Custom script file for FSO that lets the player to toggle the mouse to act as a joystick in flight (Freelancer Style).
v1.3

TLDR: Release of stable community mouse script.

Background
This script has been a community iterated project. The core ideas and movement methodology of the script first appeared on the wiki (http://www.hard-light.net/wiki/index.php/Script_-_Scripted_Mouse). Then Sushi updated the script to use a single, hard-coded control (https://www.hard-light.net/forums/index.php?topic=74435.0). I then updated the script to run on recent builds, use fewer global variables, use a bindable control key, account for some more edge cases, and fix multiple bugs.

Overview
This script can be toggled on-the-fly during a mission by pressing the key 'Toggle High HUD Contrast'. Alternatively, the player can also go to the controls configure menu and click the new check box that appears near the bottom of the screen. The Y-axis of the mouse can be set to be inverted or not in the control menu screen, too. The script takes into account your mouse sensitivity and draws a mouse cursor showing the magnitude and direction of mouse flight on the screen. I've set 'Toggle High HUD Contrast' key to my right mouse button, so I can toggle and fly with both modes of the mouse very quickly and seamlessly. It also is compatible with multiplayer!

Installation:
Download this files from https://github.com/wookieejedi/FSO-Scripts/blob/master/Joystick-Mouse/mouse-sct.tbm and then place them in your data/tables folder. Then run the game! (For folks who have not downloaded from GitHub before: Right Click on the 'Raw' Button on that Git page, then click 'Save Link As'.)

Finally, I would be happy to answer any questions. Thank you again for Sushi and all the other folks who iterated on this script before myself.
« Last Edit: March 27, 2022, 03:03:39 pm by wookieejedi »

 

Offline Alikchi

  • Neo-Terran
  • 210
  • Spooky ghost (RIP)
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.0 Dec 10, 2021)
This is great, thank you!
"Going too far and caring too much about a subject is the best way to make friends that I know."
- Sarah Vowell

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.1)
Updated with new reworked version, improves QoL and adds new options.

First, many edge case bug fixes for when the mouse should recenter have been fixed.

Second, the gauge the script draws will now match the color of your center reticle, allowing users to change the color options on the fly. The gauge will also fade when the mouse is in the dead zone, and if the mouse is beyond the bounds, it will show a faint circle.

Third, the feel of script has been updated to use a circle instead of a square, thus there is no longer the feeling of getting stuck in the corners.

Fourth, the script has been tested heavily in multiplayer and works as expected. The toggle for using the mouse as a joystick is the HUD Contrast key, but modders may specify a different key in the file if they would prefer.

Thank you to the user Acid for heavily testing.

 
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.2)
This mouse script is awesome. Thanks for updating and keeping this alive wookieejedi. I think I asked this one before, but there are some things that I noticed while using this script in a plain FS2 with only Media VPs installed.

Specifically, the throttle appears to get stuck or create duplicates markers on the gauge while trying to change speed. For example, when changing from 0 to 1/3 (or any other combination), sometimes I have to press the 1/3 throttle key 2 or 3 times before it finally picks up and changes speed. A marker for 0 and 1/3 appear on the gauge as well. When going from 1/3 to 2/3, I get the same results (most of the time). I see speed markers on both the 1/3 and 2/3 gauges but the actual speed is stuck at 1/3 still. Again, I have to press the new throttle key 2 or 3 times before the speed changes and only 1 speed appears on the gauge.

I tried screen shotting the anomaly from my computer but one of the ticks on the gauge will come through. I imagine some script is alternating the gauge speed marker between the last option and the current option selected on the throttle.

Again, I am not using any other scripts. I am only using FS2 and the latest Media vps. Is there a setting with the existing fs options that may fix this issue? Thanks!



 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.2)
Found the issue, it's actually an FSO-engine side bug. I've made a fix that will be live in tomorrow's nightly and the RC 6. This fix will also be in the next stable release. In any case, I'll update the script tomorrow once the new FSO builds are posted. 
« Last Edit: March 27, 2022, 03:02:45 pm by wookieejedi »

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)
Script updated; the throttle bug is fixed. Be sure to update the script and use FSO RC 6 or a later build.
« Last Edit: March 28, 2022, 10:48:51 am by wookieejedi »

 
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)
Thanks wookieejedi. Throttle works perfectly now!

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)
The script definitely still works!  :)

If downloading it from git didn't seem to work feel free to message me on Discord. You can toggle the functionality in the Control Config screen (a check box will appear in the center bottom of that configuration scree). Alternatively, you can use the key `Toggle High HUD Contrast` in a mission to toggle it.

If there are still difficulties getting it to work just let me know!

 

Offline savmas

  • 20
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)
Got it working now. This is great stuff, thank you!

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)
Excellent, glad you find it useful!

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Toggleable 'Mouse as a Joystick' Script: Community Edition (v1.3)
FYI, this functionality is now in recent FSO builds thanks to the work of Asteroth! You can toggle the in-game option by going to the Options menu and then clicking F3, and the flight mode option will now be listed there. Given this feature is now in engine, this script will no longer be updated. Thanks all!