Steel Battalion controller and win 7 64-Bit drivers
#261
Posted 01 November 2013 - 10:41 AM
Unfortunately Playing on Kai (and XB Connect) died off about a year ago. when the forums went down, we were down to using text messages to try to get a hold of each other. I was the POC for a long wile and still have about 12 numbers but it was too hard to connect up and so it fell apart.
That aside, the control scheme being worked on here for the SB controller is really dang close to LOC so it is the close successor to it. Plus I've been playing Battletech / Mechwarrior since I was a kid so merging the two is a dream come true for me.
#262
Posted 05 November 2013 - 06:44 AM
#263
Posted 14 November 2013 - 09:10 AM
#264
Posted 14 November 2013 - 10:11 AM
A simple solution for now, is to use a simple .cs file that simply sets the joystick positions and doesn't interact with the SB controller. I wrote one up real quick and tested it.
//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 System; using Microsoft.DirectX.DirectInput; namespace SBC{ public class DynamicClass { String debugString = ""; vJoy joystick; bool acquired; bool mouseStarted = false; int desiredX; int desiredY; int currentX = -1; int currentY = -1; const int refreshRate = 50;//number of milliseconds between call to mainLoop //this gets called once by main program public void Initialize() { joystick = new vJoy(); acquired = joystick.acquireVJD(1); joystick.resetAll();//have to reset before we use it joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_SL1); joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_X); joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_Y); joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_Z);//throttle joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_RZ); joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_SL0); joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_RX); joystick.setAxis(1,32768/2,HID_USAGES.HID_USAGE_RY); } //this is necessary, as main program calls this to know how often to call mainLoop public int getRefreshRate() { return refreshRate; } //this gets called once every refreshRate milliseconds by main program public void mainLoop() { joystick.sendUpdate(1); } //new necessary function used for debugging purposes public String getDebugString() { return debugString; } //this gets called at the end of the program and must be present, as it cleans up resources public void shutDown() { joystick.Release(1); } } }
After I ran it once the values stayed. So I think its either a windows restart or something else that resets the values to 0 after its been run once. I have run into this issue before. Quite annoying.
#265
Posted 14 November 2013 - 03:17 PM
I have a shortcut to "Device Manager" and Disable the SB controller when I'm not using it.
The only down side is that you have to remember to turn it back on when you go to use it.
#266
Posted 14 November 2013 - 07:07 PM
I can't tell if you guys are working on small refinements or still struggling for basic function. Where does this project stand today, and how long as this digital wrestling match been going?
#267
Posted 14 November 2013 - 07:11 PM
#268
Posted 14 November 2013 - 07:43 PM
#269
Posted 23 November 2013 - 09:52 AM
AFAIK the SB driver currently uses PPJoy, but I seem to recall it was compatible with the vJoy driver.
If you are interested in helping, please make a post on the vJoy forum.
#270
Posted 23 November 2013 - 10:45 AM
#271
Posted 24 November 2013 - 03:55 AM
As mentioned before, I have talked Shaul into starting up a fund to get the vJoy driver signed.
We only need to raise about $180, so every little helps - please go here and click Donate if you can help!
Edited by evilC, 24 November 2013 - 03:55 AM.
#272
Posted 17 December 2013 - 01:21 PM
The funding is close to complete but still needs help. Every little bit helps.
Just think, getting it signed means easier access to it and all the possibilities for our SB sticks! So this Holiday season, give the gift that'll give back to you and donate!
Link: http://vjoystick.sou...driver-fund#857
On a completely different note, I am selling 3 of my 4 sets of sticks. I need to pay off bills and my dream of making a LoC cell is gone the way of the Dodo so I figure it's time to find good homes to my babies.
I've been in the community for years and have been keeping each set in good working order so bid with confidence. I also offer to anyone here, or their friends, who win a set continued support via E-mail and over the phone to make sure they get the most out of their purchase.
I'm not offering the help outside this forum or the Vjoy forum so you will not see it in the auctions.
Anywho, take a look and bid with confidence!
Link: http://www.ebay.com/...=p2047675.l2562
PS- the Saitek X-52 is a GREAT stick but sucks balls for MWO. Just sayin'...
#273
Posted 08 February 2014 - 02:39 AM
Edited by OTC Moltenz, 08 February 2014 - 02:40 AM.
#274
Posted 12 February 2014 - 01:29 PM
OTC Moltenz, on 08 February 2014 - 02:39 AM, said:
Yup! I still have all the files and game you need to teporarily softmod your Xbox and get the update onto it. Unfortunantly the instructions died with the LoC forums but I can type them up again if need be.
I assume you are talking about Steel Battalion: Line of Contact and not the original game, correct? IF you have both and need to unlock everything for the first game, there are tutorials for that on Youtube.
Shoot me a PM and we'll talk more about this.
Golden Gun
#275
Posted 27 February 2014 - 04:00 PM
Im fairly new to MWO but not to MechWarrior. I've been playing everything I could get my hands on Mech related ever since my parents bought there ibm apteva and it came with mercs 2!! And later picked up SB with the panel and pedals (so many drunk nights with the roommates playing that game) fun game!! All the while thinking MW is a far better game and wishing I could use my vt panel for MW!! But I am pretty computer illiterate when it comes to things like that. So I want to give a HUGE THANKS!!!!!! to everyone who has made this possible!!!!!!! THANK YOU!!!!! THANK YOU ALL!!!! Now that that is out of the way. Lol I have the ??? First what exactly do I need to connect the VT controller to my computer and where can I find the drivers/programs? And last ? But probably the most important lol... can I do this myself or should I have a text savvy friend help?
Ps.. thx all for putting in the time to make this happen!
I cant wait to see MWO run on this thing! (Might have to make a pit)
#276
Posted 30 July 2014 - 03:29 PM
I must say i'm really impressed by all the work you've made, especially hacknfly. So much passion is really appréciated. Owner of a Steel batallion controller, I plan to use it for Elite Dangerous / Star Citizen (with some improvement like replacing the right stick in a few months).
And so, I was reading the 14 pages, trying to understand how everything work but I have found myself with some difficulties about the script (*.cs files). (All the previous step are fine )
On the one hand, I try to mapp the controller inside Elite dangerous (with mwo profile) but i had some difficulties : not all button work, 4/5 button doesn't seem to respond. The toggles works fine.
So I try to use the simple.cs where everything is working (all buttons recognized in game) but the toggles which are'nt doing anything (unlike mwo file). So I read the two files side bye side, found the code line about toggles and try to put them into the source.cs. Unfortunately I failed to make it work...
If someone would want to help me, I would want to tuse the filt control system toggle to make the left hat stick be mapping two times.
Toggle on : right up down left (as usual)
Toggle Off : z q s d (for example).
On the other hand, I don't understand what I must write inside the cs file to have all the lights always shiny ( at a lower intensity than a pushed button intensity ). And maybe light or not bye using the oxygen supply system?
So if someone is still reading this thread, and maybe could help me, I would be really thankfull.
ps : also looking to make the dial tuner working, read something about it some pages ago but failed at making it work.
#277
Posted 31 July 2014 - 09:15 AM
Just as an FYI the reason all the buttons can't work is a Windows limitation of it not recognizing more than 32 buttons on a controller. That's why I provided a mapping system, so you could map buttons to keys, so that limitation wouldn't be an issue.
If you send me what you currently have, I can look through it and see if I see anything obvious. It might be a week before I have time to pull the SB controller out. I've also "upgraded" to Windows 8.1 so I'll have to hope everything still work there.
#278
Posted 31 July 2014 - 09:34 AM
Right now i found serveral cs files though the net, some of them use the toggle to change the button key.
Example : toggle off : main weapon = joy4 toggle on main weapon = M
My goal is to have something like Toggle off : hat stick = up down right left / toggle on = z q s d on the one hand.
On the other hand I would like the tuner dial to have a key at each position (execept 0) and if you could explain to me how to have all the lights always lighted it would be great.
Actually I took the base simple.cs file, adding some toggle option i found through the web. unfortunately as I don't really understand how it works I can't do what i want with the toggles but i'm sur you, with your knowledge, could do it in a few minutes...
here's my actual cs file :
//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 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 = 20;//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; } public void updatePOVhat() { int thumbstickDeadZone = 44; SBC.POVdirection lastDirection = controller.POVhat; if(( (Math.Abs(controller.SightChangeX) > thumbstickDeadZone) || (Math.Abs(controller.SightChangeY) > thumbstickDeadZone) )) { if(Math.Abs(controller.SightChangeX) > Math.Abs(controller.SightChangeY)) if(controller.SightChangeX <0) controller.POVhat = SBC.POVdirection.LEFT; else controller.POVhat = SBC.POVdirection.RIGHT; else if(controller.SightChangeY <0) controller.POVhat = SBC.POVdirection.DOWN; else controller.POVhat = SBC.POVdirection.UP; } else { controller.POVhat = SBC.POVdirection.CENTER; } if(lastDirection != controller.POVhat) { switch(lastDirection) { case SBC.POVdirection.LEFT: controller.sendKeyUp(Microsoft.DirectX.DirectInput.Key.Left); break; case SBC.POVdirection.RIGHT: controller.sendKeyUp(Microsoft.DirectX.DirectInput.Key.Right); break; case SBC.POVdirection.DOWN: controller.sendKeyUp(Microsoft.DirectX.DirectInput.Key.Up); break; case SBC.POVdirection.UP: controller.sendKeyUp(Microsoft.DirectX.DirectInput.Key.Down); break; } } else { switch(controller.POVhat) { case SBC.POVdirection.LEFT: controller.sendKeyDown(Microsoft.DirectX.DirectInput.Key.Left); break; case SBC.POVdirection.RIGHT: controller.sendKeyDown(Microsoft.DirectX.DirectInput.Key.Right); break; case SBC.POVdirection.DOWN: controller.sendKeyDown(Microsoft.DirectX.DirectInput.Key.Up); break; case SBC.POVdirection.UP: controller.sendKeyDown(Microsoft.DirectX.DirectInput.Key.Down); break; } } } //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)); }
This is the toggle code i borrow in some files, it's working but it's not the function i'm looking for.
//Handle Buttons joystick.setButton(controller.GetButtonState(ButtonEnum.RightJoyFire),1, controller.GetButtonState(ButtonEnum.ToggleBufferMaterial) ? 09 : 10); //Right Trigger joystick.setButton(controller.GetButtonState(ButtonEnum.RightJoyMainWeapon),1, controller.GetButtonState(ButtonEnum.ToggleBufferMaterial) ? 10 : 09); //Left Trigger joystick.setButton(controller.GetButtonState(ButtonEnum.RightJoyLockOn),1,06); //Right Analog Stick joystick.setButton(controller.GetButtonState(ButtonEnum.ToggleOxygenSupply),1,02); //B Button //joystick.setButton(controller.GetButtonState(ButtonEnum.ToggleFilterControl),1,11); //Back Button joystick.setButton(controller.GetButtonState(ButtonEnum.LeftJoySightChange),1,01); //A Button //joystick.setButton(controller.GetButtonState(ButtonEnum.MultiMonOpenClose),1,15); //D-PAD DOWN
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 any Idea? ( for toggles / Light always lighted / Tuner Dial ). (Again, everything else is working perfectly )
If you wrote some code and send it to me, I could test it (if you don't have the time to setup the SBC)
Thank's again, for all the work.
File : http://374xuk8e7r.1fichier.com/
Quote
Argh, good luck with "that"
Edited by Nydo, 31 July 2014 - 09:50 AM.
#279
Posted 31 July 2014 - 10:58 AM
That could be helpful in some situations.
joystick.setButton(controller.GetButtonState(ButtonEnum.RightJoyFire),1, controller.GetButtonState(ButtonEnum.ToggleBufferMaterial) ? 09 : 10); //Right Trigger
I'm not sure where you got this. The person obviously knows what they're doing, but its not easily maintainable code. I've stared at this for a few minutes trying to figure out whats going on without being able to test it. So the joystick.setButton method is a direct wrapper to vJoy, whose function goes like this:
SetBtn(BOOL Value, UINT rID, UCHAR nBtn);
So it takes a boolean, TRUE/FALSE, rID which always = 1 in our case since we're only dealing with 1 virtual joystick at a time, and the button you are updating.
So you can think of the first part of he statement
controller.GetButtonState(ButtonEnum.RightJoyFire)
As the button that you want to get mapped.
The next part,
controller.GetButtonState(ButtonEnum.ToggleBufferMaterial) ? 09 : 10)
Is a bit of a doozy. It makes use of the ternary operator "?" which isn't used that often anymore. It basically says check the value of the variable before the "?" if it is true then return the value directly after the "?" otherwise return the last value.
Without knowing which file you got it from. The reasoning for this is unknown to me, he/she is conditionally swapping the mapping of buttons 9 and 10 on the virtual joystick between the right joyfire and the right joy mainweapon buttons depending on the condition of the ToggleBufferMaterial switch.
Don't get me wrong, I love the code for its elegance. Two lines of code that does this is brilliant, but some commenting would have helped. I hope I can help you some more later on when I have some more time.
For your code you would probably need something with a few more lines such as:
if(controller.GetButtonState(ButtonEnum.ToggleBufferMaterial)) { //1 is virtual joystick 1, 04 is virtual joystick button 4 joystick.setButton(controller.GetButtonState(ButtonEnum.RightJoyFire),1,04); } else { if(controller.GetButtonState(ButtonEnum.RightJoyFire)) controller.sendKeyPress(SBC.Microsoft.DirectX.DirectInput.Key.M); }
I haven't tested this, but that should be the basic idea.
Edited by HackNFly, 31 July 2014 - 11:05 AM.
#280
Posted 31 July 2014 - 11:10 AM
I'll send you the original code from where it is from in a few minutes.
I'm going to test your last portion of code.
For the 128 vjoy button i'm happy to learn about this!
What about activating all the lights with one of the toggle? would it be easy?
I'm so happy/lucky you were still looking at this thread =)
___________________________________________________________________
Ps : I can ony post two more messages because of the forum limitation (maybe because i'm new?) so if i run out of messages slot, i'll talk to you by another method (can you send me your mail or skype or whatever you want by pm please? )
______________________________________________________________________
Edit : you're kidding? I can just send 2 pm a day O_o What's the problem of administrators in here...
http://jntx98f7ox.1fichier.com/ There are two files, tne hawken one from which the "elegant" code you're looking for is from, and the other one for mwo which was on your google code site, at the end there is some code for toggles but I failed at putting it in my own file (taking part from the beginning and the end) whereas i could with the hawken one.
The problem of the mwo file is that not all buttons are working... and for Elite Dangerous and Star Citizen I really need all of them .
Can you send me some email or else by pm please ? In order to avoid being not able to answer to you.
Ps : the coder from hawken seem to work as a coder for Kinzart Productions. But I can't reach him.
_____________________________________________________________________
Edit 2 : I failed at using your code, i must be putting it at the wrong place (I tryed at the same place than for hawken's code)
c:\Users\*********\Desktop\Steel-Batallion-64\Steel-Batallion-64\Simple - Copie.cs(21,13) : warning CS0219: La variable 'emergencyLightIntensity' est assignée, mais sa valeur n'est jamais utilisée
In english : The variable 'emergencylightintensity' is assigned, but its value is never used.
c:\Users\*********\Desktop\Steel-Batallion-64\Steel-Batallion-64\Simple - Copie.cs(97,31) : error CS0234: Le type ou le nom d'espace de noms 'Microsoft' n'existe pas dans l'espace de noms 'SBC' (une référence d'assembly est-elle manquante ?)
In english : Type or name of space of names 'microsoft' doesn't exist in the SBC space name ( Assembly Reference missing? )
Sorry, if you integrate your code in the basic simple.cs file, or at least tell me where i have to put it I'll do.
Edited by Nydo, 31 July 2014 - 11:47 AM.
14 user(s) are reading this topic
0 members, 14 guests, 0 anonymous users