Steel Battalion controller and win 7 64-Bit drivers
#41
Posted 21 August 2012 - 09:33 AM
#42
Posted 21 August 2012 - 09:43 AM
If that is the case I would suggest uninstalling PPJoy and try reinstalling, noting if there is any error or if anything deviates from the norm.
Here are the written instructions:
http://code.google.c...ki/Installation
#43
Posted 21 August 2012 - 09:49 AM
Reinstall doesnt help.
Testmode is on.
Edited by nr1pusher, 21 August 2012 - 09:50 AM.
#44
Posted 21 August 2012 - 09:53 AM
#45
Posted 21 August 2012 - 10:21 AM
Works now.
Edited by nr1pusher, 21 August 2012 - 12:04 PM.
#46
Posted 22 August 2012 - 10:14 PM
#47
Posted 22 August 2012 - 10:17 PM
#48
Posted 22 August 2012 - 10:26 PM
Should the axis be showing up in MWO now? cause XPadder will recognize them, but MWO does not...
Edited by von Pilsner, 22 August 2012 - 10:45 PM.
#50
Posted 22 September 2012 - 10:54 PM
.....
Just wanted to say SB controller works in MWO!
Its almost 3 in the morning though, so going to bed. But currently I have 8 axes and 32 buttons mapped. I can actually map 10 axes though, as vJoy supports a continous POV, which would be the first time thats ever been possible as far as I know. Not that any reasonable game would ever make use of 10 axes. The controller does has more buttons than windows supports, so I have to find a replacement for my keyboard emulator library, I have a fix up my sleeve, but I"ll get to that at a later date.
Anyways, I tried it in game, and felt sorry for the first person I ran into and knocked over both our mechs. I had my throttle and pitch axes inverted. I quickly fixed that, but I really need help creating a default profile people can use, as I'm NOT a gamer, and only played enough Mechwarrior back in the day to get consistently beat online.
Anyways, just wanted to give everyone an update. I'll try and put something together people can help BETA test. The GUI to my program is absolutely minimal, it just pops up windows with one text box to show any errors in the program and that's it. I"ll probably add a file picker so you can change profiles without relaunching the program.
Have a good night.
~Santiago
#52
Posted 23 September 2012 - 05:18 PM
#53
Posted 24 September 2012 - 03:37 PM
I dual booted so I could use VTCHID drivers, I use the left thumb POV for quick weapon group changing (up, down, left, right) so I am hoping that the behavior can be duplicated.
Also, thanks for the hard work on the 64 bit drivers!
#54
Posted 24 September 2012 - 11:20 PM
http://steel-batalli...n-64_v2_pre.zip
Basics:
Install LibUSB, also available from my website.
http://code.google.c....8.exe&can=2&q=
If you have PPJoy installed, uninstall it!
INSTALL vJoy
http://vjoystick.sou...load_x86x64.php
unzip Steel-Batallion-64_v2_pre.zip
go down to Steel-Batallion-64 and double click on runSteelBatallion64 shortcut
It should bring up a very simple program. Click File, Open, select Simple.cs. Click Ok, and the filename should show up as a label on the program, click Start, and the lights on the controller should blink. pull up the set up usb game controller menu and calibrate vJoy.
I'm purposefully leaving out a lot of detail right now, because I'm tired. I plan on polishing up the code more this weekend, but I need a break from coding for a few days to fly my RC planes and relax. In the meanwhile I'll answer any questions from those brave enough to test this code.
von Pilsner, on 24 September 2012 - 03:37 PM, said:
I dual booted so I could use VTCHID drivers, I use the left thumb POV for quick weapon group changing (up, down, left, right) so I am hoping that the behavior can be duplicated.
Also, thanks for the hard work on the 64 bit drivers!
Yes, this is possible.
The configuration files are actually written in C#. The program compiles the configuration file on the fly. This is old news in the .NET world, but first time I've done it and I think its pretty slick. I was working with someone else testing an earlier version of this, and I was able to create new features combining multiple axes to perform certain functions and e-mail him back the updates in the configuration file. This will make the configuration files very powerful and flexible.
This revision required rewriting about half the existing code. I moved from a Visual C++ / Visual C# program to a purely C# program. Anyways I hope someone else out there can also get this working. You'll here more from me later on.
#55
Posted 25 September 2012 - 02:29 PM
#56
Posted 25 September 2012 - 03:46 PM
Thanks for the hard work, HackNFly!
#57
Posted 25 September 2012 - 04:03 PM
#58
Posted 25 September 2012 - 04:36 PM
Ximmons, on 25 September 2012 - 04:03 PM, said:
Does this mean you got it working, i.e. you tested it in USB game controllers and it moves around the axes?
von Pilsner, on 25 September 2012 - 03:46 PM, said:
Thanks for the hard work, HackNFly!
Same question, so you can move the axes around in set up usb game controllers, under properties of vJoy Device, under the Test tab?
Also, under the settings tab, it probably requires you to calibrate. My next post will be an explanation of the "configuration file"
#59
Posted 25 September 2012 - 05:10 PM
//If you want a quick overview of how the configuration system works, take a look at SolExodus.cs //This example was meant to recreate the functionality I displayed for the system in the original release //however that also means that it is actually pretty complicated. using SBC; using myVJoyWrapper; using System; //using Microsoft.DirectX.DirectInput; namespace SBC { public class DynamicClass { SteelBattalionController controller; vJoy joystick; bool acquired; const int refreshRate = 50;//number of milliseconds between call to mainLoop //this gets called once by main program public void Initialize() { int baseLineIntensity = 1;//just an average value for LED intensity int emergencyLightIntensity = 15;//for stuff like eject,cockpit Hatch,Ignition, and Start controller = new SteelBattalionController(); controller.Init(50);//50 is refresh rate in milliseconds //set all buttons by default to light up only when you press them down for(int i=4;i<4+30;i++) { if (i != (int)ButtonEnum.Eject)//excluding eject since we are going to flash that one controller.AddButtonLightMapping((ButtonEnum)(i-1),(ControllerLEDEnum)(i),true,baseLineIntensity); } controller.AddButtonKeyLightMapping(ButtonEnum.CockpitHatch, true, 3, Microsoft.DirectX.DirectInput.Key.A, true);//last true means if you hold down the button, joystick = new vJoy(); acquired = joystick.acquireVJD(1); joystick.resetAll();//have to reset before we use it } //this is necessary, as main program calls this to know how often to call mainLoop public int getRefreshRate() { return refreshRate; } private uint getDegrees(double x,double y) { uint temp = (uint)(System.Math.Atan(y/x)* (180/Math.PI)); if(x < 0) temp +=180; if(x > 0 && y < 0) temp += 360; temp += 90;//origin is vertical on POV not horizontal if(temp > 360)//by adding 90 we may have gone over 360 temp -=360; temp*=100; if (temp > 35999) temp = 35999; if (temp < 0) temp = 0; return temp; } //this gets called once every refreshRate milliseconds by main program public void mainLoop() { joystick.setAxis(1,controller.AimingX,HID_USAGES.HID_USAGE_X); joystick.setAxis(1,controller.AimingY,HID_USAGES.HID_USAGE_Y); joystick.setAxis(1,(controller.RightPedal - controller.MiddlePedal),HID_USAGES.HID_USAGE_Z);//throttle joystick.setAxis(1,controller.RotationLever,HID_USAGES.HID_USAGE_RZ); joystick.setAxis(1,controller.SightChangeX,HID_USAGES.HID_USAGE_SL0); joystick.setAxis(1,controller.SightChangeY,HID_USAGES.HID_USAGE_RX); joystick.setAxis(1,controller.LeftPedal,HID_USAGES.HID_USAGE_RY); joystick.setAxis(1,controller.GearLever,HID_USAGES.HID_USAGE_SL1); joystick.setContPov(1,getDegrees(controller.SightChangeX,controller.SightChangeY),1); for(int i=1;i<=32;i++) { joystick.setButton((bool)controller.GetButtonState(i-1),(uint)1,(char)(i-1)); } joystick.sendUpdate(1); } //this gets called at the end of the program and must be present, as it cleans up resources public void shutDown() { controller.UnInit(); joystick.Release(1); } } }
So here is the code from the example Simple.cs configuration file. It is standard C# code. To begin with the majority of changes you'll want to make will be within the Initialize function. Currently as an example I added the line
controller.AddButtonKeyLightMapping(ButtonEnum.CockpitHatch, true, 3, Microsoft.DirectX.DirectInput.Key.A, true);//last true means if you hold down the button,
First variable defines which key on the SteelBatallionController you want to affect, here is a list of available keys and their proper name. (Capitalization does matter)
public enum ButtonEnum { RightJoyMainWeapon, RightJoyFire, RightJoyLockOn, Eject, CockpitHatch, Ignition, Start, MultiMonOpenClose, MultiMonMapZoomInOut, MultiMonModeSelect, MultiMonSubMonitor, MainMonZoomIn, MainMonZoomOut, FunctionFSS, FunctionManipulator, FunctionLineColorChange, Washing, Extinguisher, Chaff, FunctionTankDetach, FunctionOverride, FunctionNightScope, FunctionF1, FunctionF2, FunctionF3, WeaponConMain, WeaponConSub, WeaponConMagazine, Comm1, Comm2, Comm3, Comm4, Comm5, LeftJoySightChange, ToggleFilterControl, ToggleOxygenSupply, ToggleFuelFlowRate, ToggleBufferMaterial, ToggleVTLocation, TunerDialStateChange, GearLeverStateChange }
As you can see by the code, we're talking about the CockpitHatch key located under the eject button on the far right hand side of the controller.
The second parameter controls state change. if you change the parameter from true to false, then the button becomes a statebutton, useful for modes such as nightvision where you press the button to toggle the state.
controller.AddButtonKeyLightMapping(ButtonEnum.CockpitHatch, false, 3, Microsoft.DirectX.DirectInput.Key.A, true);//last true means if you hold down the button,
The third parameter controls the light intensity, any value from 1 - 15 is acceptable.
In order to define what key you want the button to press you need to know the DirectX.DirectInput key enumerations, they are available here:
http://msdn.microsof...4(v=vs.85).aspx
If you make a mistake typing one in, the program will let you know inside the text box labeled Errors. it'll tell you a line and column number of where the mistake was made.
The last variable for AddButtonKeyLightMapping controls whether or not the button is held down when you press it.
controller.AddButtonKeyLightMapping(ButtonEnum.CockpitHatch, true, 3, Microsoft.DirectX.DirectInput.Key.A, false);//last true means if you hold down the button,
I can't think of when you would want this to be the case, it means if you press and hold the cockpit hatch button you'll only get on letter a instead of aaaaaaaaaaaaaaaaaa
I"ll add more instructions later on, the next section to cover is how to configure joysticks.
Normally when you're revising something and you got the program to compile, you simply hit start to start the program and stop to stop. I've noticed an issue with the reference to the DirectX.DirectInput dll, Which means you'll have to restart the program between changes. I"ll see if I can get this fixed tonight.
Edited by HackNFly, 25 September 2012 - 05:11 PM.
#60
Posted 25 September 2012 - 05:57 PM
HackNFly, on 25 September 2012 - 04:36 PM, said:
Yes I do have it working now. After correcting my mistake I was able to watch the amazing christmas tree lighting I read about. Going into calibration of the controller from the control panel the right joystick, left joystick, gear lever, left/right peddle(not the center) and 8 buttons are recognized.
I am reading over your second post trying to wrap my mind around it but when it comes to programming I can not get out of the proverbial paper bag. The controller is responding in game with its limited functions before writing a new configuration file.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users