Jump to content

How to fix horribly calibrated Joysticks in KSP (Workaround)


Ulair

Recommended Posts

  • 2 weeks later...
I tried to follow the instructions on the README file from the github project page on how to install AltInput,but I haven't been able to locate the AltInput.dll file and am not sure what to use to compile the project after changing the KSPPath and ultimately failing to install it. If someone could provide a better set of instructions on how to install AltInput (or any insight into whether it will work with KSP 1.0 versions at all) or possibly a completely different solution to the input delay, your help would be greatly appreciated.

To compile it you have 3 different choices:

1. The best way is to use Visual Studio, but Visual Studio is not available for free, it costs money and is an Integrated Development Environment from Microsoft for Microsoft related Products like Windows or .Net.

If you have a license of Visual Studio you can open the Project File AltInput.csproj in Visual Studio and press the compile button.

If the compilation gives no errors, the compilation was a success.

2. You can give Visual Studio Express a try.

Visual Studio Express is a free but limited Version of Visual Studio.

It can be downloaded at Microsoft for free, but it requires a registration.

https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx

Though i don't know if the Express version is enough for this project. I never worked with C# source code or .Net and i also normally do not use Visual Studio Express.

3. You can run the command line compiler of .Net manually in a command line.

To do this, you must have .Net 4.0 installed.

The target of this Joystick AltInput Plugin might be .Net 3.5, but the .csproj file requires the command line versions of .Net 4.0

If you have .Net 4 installed, you can normally find it in:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\

To compile the AltInput Plugin open a command line in the folder, where your AltInput.csproj file is.

The enter the following command line in the cmd.exe window:


C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild .\AltInput.csproj

and press enter.

Now the compilation should run, if everything worked fine, no error messages should be shown.

I tried that myself by using the 3. option (I don't have VS installed), and i got the following error messages:


Microsoft (R) Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 14.05.2015 07:03:22.
Project "F:\AltInput-master\AltInput.csproj" on
node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Debug\".
Creating directory "obj\Debug\".
CoreCompile:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /war
n:4 /define:DEBUG;TRACE /highentropyva- /reference:"E:\Steam\SteamApps\common\Kerbal Space Program
\KSP_Data\Managed\Assembly-CSharp.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /referen
ce:F:\AltInput-master\Libraries\SharpDX.Direct Input.dll /reference:F:\AltInput-master\Libraries\SharpDX.dll
/reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /re
ference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /ref
erence:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2
.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Fi
les (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:"E:\Steam\
SteamApps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll" /debug+ /debug:full /filealign:512 /optimize-
/out:obj\Debug\AltInput.dll /target:library /utf8output Sources\Config.cs Sources\Device.cs Sources\DirectInputDevic
e.cs Sources\Flight.cs Sources\GameState.cs Sources\Ini.cs Properties\AssemblyInfo.cs
Sources\GameState.cs(326,13): error CS0246: The type or namespace name 'VesselSAS' could not be found (are you missing
a using directive or an assembly reference?) [F:\AltInput-master\AltInput.csproj]
Sources\GameState.cs(326,62): error CS1061: 'Vessel' does not contain a definition for 'vesselSAS' and no extension met
hod 'vesselSAS' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an ass
embly reference?) [F:\AltInput-master\AltInput.csproj]
Done Building Project "F:\AltInput-master\AltInput.csproj" (default targets) -- FAILED.


Build FAILED.

"F:\AltInput-master\AltInput.csproj" (default target) (1) ->
(CoreCompile target) ->
Sources\GameState.cs(326,13): error CS0246: The type or namespace name 'VesselSAS' could not be found (are you missin
g a using directive or an assembly reference?) [F:\AltInput-master\AltInput.csproj]
Sources\GameState.cs(326,62): error CS1061: 'Vessel' does not contain a definition for 'vesselSAS' and no extension m
ethod 'vesselSAS' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an a
ssembly reference?) [F:\AltInput-master\AltInput.csproj]

0 Warning(s)
2 Error(s)

Time Elapsed 00:00:00.51

As i said, i am not a C# developer, neither do i know the Plugin System of Kerbal Space Program, but the important error messages are this one:


Sources\GameState.cs(326,13): error CS0246: The type or namespace name 'VesselSAS' could not be found (are you missing
a using directive or an assembly reference?) [F:\AltInput-master\AltInput.csproj]
Sources\GameState.cs(326,62): error CS1061: 'Vessel' does not contain a definition for 'vesselSAS' and no extension met
hod 'vesselSAS' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an ass
embly reference?) [F:\AltInput-master\AltInput.csproj]

I assume that some classes of the Plugin System of Kerbal Space Programm were renamed in one of the later versions and this might be the result of the above error message.

VesselSAS is a data type which can't be found during compilation and because it is not in the AltInput sourcecode i would assume, that this belonged to the

Plugin System of Kerbal Space program of an older KSP version, but it doesn't exist there anymore, so it was probably renamed or the code had changed in a bigger step.

So to fix this, someone should look into

E:\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll

and check what Class Names are available. Hint: DLLViewer might help.

Or look in the community API documentation:

http://wiki.kerbalspaceprogram.com/wiki/Community_API_Documentation

But to make a final statement about this Joystick problem i must say, this is not Unity's fault and neither the developers of Unity.

Technically it might be their problem, but come on, we are talking about a commercial project that is sold professionally.

And if software developers find a bug in a third party product, like the unity engine, then they have to let their third party product owners fix that bug, especially if the developers of KSP are commercial customers of Unity themselves.

If they pay the Unity guys, they have a right to get support or, if this is not the case, they, the KSP developers have to develop a work around this bug. And the latter one is always possible,

And that is the main problem, they do not provide a work around for this Unity bug, but they sell KSP commercially, so the only one that is to blame are the KSP developers. They must fix it by providing a workaround, it is their fault.

Especially with such an important feature like joystick input which isn't a big thing from a programming point either.

It's a shame, that they released the game without providing a fix or workaround of this bug.

They could easily have worked something out, like this AltInput Plugin and they didn't. Shame on them.

Link to comment
Share on other sites

  • 1 month later...
I tried that myself by using the 3. option (I don't have VS installed), and i got the following error messages:


Microsoft (R) Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 14.05.2015 07:03:22.
Project "F:\AltInput-master\AltInput.csproj" on
node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Debug\".
Creating directory "obj\Debug\".
CoreCompile:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /war
n:4 /define:DEBUG;TRACE /highentropyva- /reference:"E:\Steam\SteamApps\common\Kerbal Space Program
\KSP_Data\Managed\Assembly-CSharp.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /referen
ce:F:\AltInput-master\Libraries\SharpDX.Direct Input.dll /reference:F:\AltInput-master\Libraries\SharpDX.dll
/reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /re
ference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /ref
erence:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2
.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Fi
les (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:"E:\Steam\
SteamApps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll" /debug+ /debug:full /filealign:512 /optimize-
/out:obj\Debug\AltInput.dll /target:library /utf8output Sources\Config.cs Sources\Device.cs Sources\DirectInputDevic
e.cs Sources\Flight.cs Sources\GameState.cs Sources\Ini.cs Properties\AssemblyInfo.cs
Sources\GameState.cs(326,13): error CS0246: The type or namespace name 'VesselSAS' could not be found (are you missing
a using directive or an assembly reference?) [F:\AltInput-master\AltInput.csproj]
Sources\GameState.cs(326,62): error CS1061: 'Vessel' does not contain a definition for 'vesselSAS' and no extension met
hod 'vesselSAS' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an ass
embly reference?) [F:\AltInput-master\AltInput.csproj]
Done Building Project "F:\AltInput-master\AltInput.csproj" (default targets) -- FAILED.


Build FAILED.

"F:\AltInput-master\AltInput.csproj" (default target) (1) ->
(CoreCompile target) ->
Sources\GameState.cs(326,13): error CS0246: The type or namespace name 'VesselSAS' could not be found (are you missin
g a using directive or an assembly reference?) [F:\AltInput-master\AltInput.csproj]
Sources\GameState.cs(326,62): error CS1061: 'Vessel' does not contain a definition for 'vesselSAS' and no extension m
ethod 'vesselSAS' accepting a first argument of type 'Vessel' could be found (are you missing a using directive or an a
ssembly reference?) [F:\AltInput-master\AltInput.csproj]

0 Warning(s)
2 Error(s)

Time Elapsed 00:00:00.51

I went through the code (on KSP 1.0.2°) and I found out that the developpers have made some changes.

In the GameState.cs, at the end you find the logic for override the SAS manoeuvers.

But VesselSAS has been moved in VesselAutopilot class.

Replace with the foolowing code, this will compile and if you have update the path for your KSP folder. The .dll will be at the correct position.

VesselAutopilot.VesselSAS VesselSAS = FlightGlobals.ActiveVessel.Autopilot.SAS;
Boolean overrideSAS = (Math.Abs(CurrentState.pitch) > VesselSAS.controlDetectionThreshold) ||
(Math.Abs(CurrentState.yaw) > VesselSAS.controlDetectionThreshold) ||
(Math.Abs(CurrentState.roll) > VesselSAS.controlDetectionThreshold);
VesselSAS.ManualOverride(overrideSAS);

Note that I just execute the code, I'm about to config this then give it a try.

Link to comment
Share on other sites

  • 7 months later...

I realize it's been a while since there was anything posted here but how do I reference the proper names of the axis used by my stick? Does anyone happen to have a setup for an X52 already?

 

-- EDIT --

Well . . . figured that out. Now I'm having issues with SAS not working. Hopefully someone that knows what they're doing will get with me about this.

Edited by Styles2304
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...