Author Topic: hate how the mouse works? have i got the script for you!  (Read 25425 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: hate how the mouse works? have i got the script for you!
thats a good pointer, i think they did change something somewhere.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: hate how the mouse works? have i got the script for you!
Yeah, taylor said something about the pilot files being broken/getting corrupted in HEAD. I'm rather unhappy with that, considering I've been going to the effort of testing my changes before they get in, and now somebody has decided to **** all over the only branch I'm allowed to commit to.
-C

 

Offline Unknown Target

  • Get off my lawn!
  • Global Moderator
  • 212
  • Push.Pull?
Re: hate how the mouse works? have i got the script for you!
Doesn't this break the BtRL flight model? That's what I've always heard.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: hate how the mouse works? have i got the script for you!
only thing it might break is perhaps moi. i accounted for rotdamp, but i dont think anyones checked my math.

ive never had a pilot file get corrupted and i pretty much run head builds exclusively.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hate how the mouse works? have i got the script for you!
It was the earlier (or earliest) versions that broke it.. Though the use of the scripting.tbl & multi is not a good idea.

And pilot files get broken, but AFAIK this appears only in certain situations, like red alert missions etc.
« Last Edit: April 06, 2007, 12:55:05 am by Wanderer »
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Fury

  • The Curmudgeon
  • 213
Re: hate how the mouse works? have i got the script for you!
I was told this Nuke's script allows freelancerish mouse control. :) I tried it and got the oddball menu in the HUD, I got settings saved but once that's done the game crashes. :p Tried again and crashed again.

I mentioned this yesterday on IRC and it would seem like Wanderer reworked parts of the script, I have yet to see his work though. I'd love to get this script working because I hate the standard mouse control and joystick doesn't sit comfortably on my table.

I wonder if this script can still cause pilot file corruption? What of multiplayer? I assume I would get complains of unvalidated tables. :nervous:

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hate how the mouse works? have i got the script for you!
Well... I have recently added option to the scripting that should (might, possibly could... - cant give 100% on this yet as there might be some unforeseen probs in the code/script) enable player controls to be read directly into lua which is a lot less hackish way of using mouse control than the one used in this script (granted at the time this script was written it was the only way). Though that option is still only in wanderer branch.

This script also utilizes control over (read/write) other files and i haven't recently checked how those work.

Script such as the one above should not cause pilot file corruption in any case. But in multiplayer it might (probably will) complain of unvalidated tables. Then again only result of that complain is that the stats wont be saved so its not really that major loss.

I'm gonna take closer look at the lua/c code as soon as i get enough time to get around to it. Before that i can write menuless script that should enable different mouse control if you need it.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Fury

  • The Curmudgeon
  • 213
Re: hate how the mouse works? have i got the script for you!
I'd be happy with any script that would allow me actually play FS2 with some comfort. :D Thank you very much. :)

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: hate how the mouse works? have i got the script for you!
Well let me ask this then since it is at least related to the topic....

I've got a trackball (ball on top) mouse which is set fairly high in terms of cursor speed.
Any time FS2 is loaded, the program slows the travel of the mouse considerably. Enough
so that it at least gives my thumb a work out by comparison.

The mouse sensitivity is all the way up, general options and launcher settings just don't seem
to take into account that the mouse is naturally slowed while within the game window.

Would this script fix this issue, or is something else entirely needed?
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: hate how the mouse works? have i got the script for you!
i think they chaged cfile since last i updated this thing. the script stores its settings in a file called nukemouse.cfg. once the file is stored the menu wont come up again unless you hold down both mouse buttons, or delete the file. for some reason editing the file manually doesnt seem to work. probibly because i used linux style escape sequences. probibly why youre getting the crash.

when i wrote this scripting was fairly new and we didnt have much to work with. for example my menu sucks bad. now its probibly possible to add a button to the options screen with conditional hooks. also most of the physis bugs could probibly be avoided now. frankly the script was kinda poorly written from the getgo. i stopped working on it, aside from minor bug fixes  (all the major bugs go unfixed :D )  for a few reasons, first nobody seemed to be using it, second, i was under the assumption that input was about to get a major rewrite, third, any remaining problems with physics, i didnt have the skill to solve at the time, also the code was a mess and ttempts to rewrite it usually ended in me working on something entirely different.

yep its most definately a cfile thing. when it tries to save the file it gives an assert

Assert: dir_type != CF_TYPE_ANY
File: cfile.cpp
Line: 1019

problem is cfile isnt documented at all so i havet a clue how its supposed to work, just that what i coded before worked. since then ive learned a thing or two about file parsing. i bet i could make the cfg look like a freespace table if i wanted to. looks like it didnt like the path i gave it (which i probibly didnt).

i could probibly hack together something that would use default values, because this file handling is haphazard at best.
« Last Edit: March 05, 2009, 12:04:27 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hate how the mouse works? have i got the script for you!
Well... i have been working on something which still requires some fine adjustments and couple of additional controls to be added...

Here is something that can be tested... archive.

From my local codebase with a set of additional scripting functions which are not yet in either trunk nor in any of the branches in SVN. Archive consists of a mod and a build. It is strongly recommended that you run the script in question only as a mod within its own directory (when using multi mod - mod.ini - feature then preferably the first one in the 'stack').

The cfg file has several options...
Sensitivity: defines the length of the response area measured from the end of the deadzone (oddly enough in screen pixels... minimum is 100)
Sensitivity Curve: defines the exponent applied to the response (setting it to 1 essentially disables this setting)
Control Mode: planned support for other modes.. as for now only '1' will work
Deadzone: defines the size of the deadzone from the centerpoint (again in pixels)
Mouse Invert: defines if the mouse invert is use or not (1 = inverted mouse in use, 0 = not in use)

Keeping center mouse button pressed for > 0.2 s resets the controls. Script can be used when normal FS2 mouse is in use but it might be is better to turn the default mouse off. When playing in windowed mode it is very easy to get the mouse cursor of the edge. This generally causes both the game to pause as well as when continued if any of the weapons were firing.. then they will keep firing. This firing can be stopped by shooting once with the weapons in question.

EDIT... still uploading... DONE
« Last Edit: March 05, 2009, 12:07:18 am by Wanderer »
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: hate how the mouse works? have i got the script for you!
looks like you beat me to it. i was about to post a dirty hack. i commented out the file load code and just hard coded the variables. but your system seems to work better. my script is a total mess, i really didnt want to waste an evening debugging it :D

looks like you added some stuff to lua that ive been asking for for a long time.
« Last Edit: March 05, 2009, 01:27:36 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
Re: hate how the mouse works? have i got the script for you!
Help for a total Open Source FS noob?  Please?

I play on my laptop in front of the TV...so mouse (a'la freelancer) is the best option for me.

I've read through this thread...and there's a lot I don't understand.

Could someone post an "Idiot's guide to Freelancer-style mouse control"?

Please?

TIA!

Earl

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hate how the mouse works? have i got the script for you!
Well... This is still something that is tested and it relies on a special build

Download the archive linked couple posts before this one. Extract the build (the exe file) to your main freespace directory. Extract the mod directory also to the same place. Start the launcher, make sure to select the newly extracted build, select MOD tab and choose the new directory as a mod. Start the game. Go to options screen and set mouse off. Return to mainhall and test it out (or start playing).

If the default settings weren't good enough those can be changed in the .cfg file (in the new mods data directory, open with text editor like notepad).
Do not meddle in the affairs of coders for they are soggy and hard to light

 
Re: hate how the mouse works? have i got the script for you!
Really?  It's that easy?

Thanks!

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hate how the mouse works? have i got the script for you!
Had to revise the script a bit... Same link but now there is additional (small) bitmap in the set. And the cfg file has couple more options. Also the sct.tbm file now has some comments to make it easier to understand what it is doing. Basically uses the same build as the current wanderer branch so OS X and Linux users can compile their own builds and try it out if they want to (though i have no idea how well the script will run on those). Now it should not matter if you have the normal fs mouse flight control on or off.

Boundary Limit:   Limit from the edge of the screen/window (towards the center) on how far the mouse cursor is allowed to go before it is reset.
Indicator Color:   Four numbers for example comma separated, red, green, blue, alpha

Do not meddle in the affairs of coders for they are soggy and hard to light

 
Re: hate how the mouse works? have i got the script for you!
FAN-Tastic!  How long before it's rolled into the main build, do you think?

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hate how the mouse works? have i got the script for you!
The script is now in wiki http://www.hard-light.net/wiki/index.php/Script_-_Scripted_Mouse and works with trunk builds

Just remember to get the icon from the archive from this thread (but do not mix the actual scripts).
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Current projects: GVCa Tanen, Vasudan Imperium
    • Steam
    • User page on the FreeSpace Wiki
Re: hate how the mouse works? have i got the script for you!
I've been trying this and it's a little frustrating--I'd really love to be able to actually steer my targeting reticle, as I seem to be overshooting my targets by too much. This appears to be because the sensitivity has a minimum of 100. Any chance of eliminating that limit?
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hate how the mouse works? have i got the script for you!
Steering the targeting reticle is something that is not readily doable. Not impossible however...

As for the minimum...
Code: [Select]
         if mousesensitivity < 100 then
            mousesensitivity = 100
That section in the script handles it... You can make it smaller but it also makes the response area for the mouse smaller..
Do not meddle in the affairs of coders for they are soggy and hard to light