PDA

View Full Version : Multiple Axis for engine power...



531_Ghost
07-28-2004, 02:20 PM
A little help here: http://forums.ubi.com/eve/forums?a=tpc&s=400102&f=49310655&m=968105375

Please?

~S~

[This message was edited by 531_Ghost on Wed July 28 2004 at 03:20 PM.]

531_Ghost
07-28-2004, 02:20 PM
A little help here: http://forums.ubi.com/eve/forums?a=tpc&s=400102&f=49310655&m=968105375

Please?

~S~

[This message was edited by 531_Ghost on Wed July 28 2004 at 03:20 PM.]

BaldieJr
07-28-2004, 02:42 PM
There is a way around this limitation but it requires some scripting knowledge.

Autohotkey should be able to do it. Look on thier forums for my example concerning axis banding, copy that into a script, and just add a provision that says:

If Axis_X changes
Send key_to_select engine
Etc etc etc

Its not elegant, but it would work and would allow mixture on a slider.

BaldieJr
07-28-2004, 02:47 PM
I'll just save you some time of finding it. Here is the example script I wrote as a "proof of concept". It only sends a key command IF there is a change in the sliders position.

<pre class="ip-ubbcode-code-pre">
some stuff was here. PT me if you want a copy.
</pre>

Autohotkey is a nice thing to learn. Its handy in all sorts of ways external to gaming.

[This message was edited by BaldieJr on Thu July 29 2004 at 02:47 PM.]

531_Ghost
07-28-2004, 04:38 PM
OK but as I read your reply you refer to only one slider or axis? I have 6 on the Throttle Quadrant. I'd like to have, if it's possible an axis for engine one and another for engine two. Thanks http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

BaldieJr
07-28-2004, 06:40 PM
You'll first need to figure out which axis and which joystick number you are dealing with.

Line 4 says:
<pre class="ip-ubbcode-code-pre">
JoystickNumber = 2
</pre>
If windows thinks the throttle is stick 2, leave this alone, otherwise, you'll have to set it to 1,3, or whatever.

The next bit you need to change is within the "Loop". The line you need to change is:
<pre class="ip-ubbcode-code-pre">
GetKeyState, joyu, %JoystickNumber%JoyU
</pre>

In this script, I was reading Axis U, but you may want to read Axis Z,Y, or something else, so change the last letter to match the axis you want to read.

Assuming you've followed me this far, you'll probably be wondering what to do with all this, so here is the whole shebang....

Download and install autohotkey from http://www.autohotkey.com/download/

Now create a text file and copy all the code into that file and save it.

Now change the name of the file so that it ends with .ahk

This gives you: some_file_name.ahk

Now right-click it and choose "edit script", which should open it in Notepad.

Every place you see a line similar to this:
<pre class="ip-ubbcode-code-pre">
Send, Setting Mixture 0 Percent {enter}
</pre>

you'll want change it (this example only works in notepad and was for testing).

What you want to do is send these key strokes:
Send, Select engine X (i don't know what key you have bound to select engines)
Send, 0-9 (depends on which "if" s true. look at code to figure out)
Send, Select all engines (depends on which key you have bound to select all engines).

You can add as many "sends" as you need, just add a new line under the old one.

Now that you have one axis working, you need to create a new Loop for each axis. Just copy/paste everything starting with the word "Loop" and change the JoyU to JoyY or whatever.

You'll also want to add a line after "state = 000" that says "state1 = 000", and do this for each axis you will be using. If there are 3 additional axis to add, make
state1= 000
state2= 000
state3= 000

Finally, in each loop you will want to change the word "state" to match one of these. Each loop must have it s own "state", wether that be state1, state2, or state3456.

IF you are confused, just post the following information here:
What key selects all engines?
What key selects engines 1,2,3,4,5,6,7,8?
What keys equal 0% throttle through 100% throttle?
What Axis is each engine?
What number is the stick (to windows)?
What keys select 0% mixture through 100% mixture?

As long as I know all these things, I should be able to create this for you easily.

531_Ghost
07-28-2004, 06:58 PM
OK lemme get this straight, I'm supposed to attempt writing/editing the data streams coming into and out of the IL2FB EXE file? Would it not be easier just to add a DX device to increase/decrease power to engine 1 and 2. One lever for engine 1 (say U axis) and another (say Y axis) for engine 2? I use Control Manager (it's a CHProdutcs Programming Tool) ONLY not Windows device manager to map my controllers. My original question was if it could be added to the next version of IL2. Anyway, thanks!

~S~
Ghost

BaldieJr
07-28-2004, 07:22 PM
No. Autohotkey is just a macro language that can read joystick settings and send keystrokes.

There is no voodoo involved.

The script above will just watch the state of whatever axis you prefer, and then send key strokes based on the value of the axis. Lets say you have axisY at 20%. The script sees this and sends "2" to the game (as if you pressed the 2 key yourself").

Its just a way to emulate additional axis using autohotkey.

BaldieJr
07-29-2004, 06:23 AM
Ok. Well...

If anyone has one of these crazy-expensive throttle quadrants, please let me know. I'll provide the software to make your device work in FB/AEP in exchange for some information about the quadrant AND your feedback concerning the software I give you. Basicly, you'll be the 'beta tester'.

Jippo01
07-29-2004, 08:19 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
Ok. Well...

If anyone has one of these crazy-expensive throttle quadrants, please let me know. I'll provide the software to make your device work in FB/AEP in exchange for some information about the quadrant AND your feedback concerning the software I give you. Basicly, you'll be the 'beta tester'.<HR></BLOCKQUOTE>

Ok. I'm interested. http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

I have a home made 4 axis - 4 button throttle as game controller 2. I have now:

x axis - empty
y axis - throttle all
z axis - pitch all
wheel - trim

So what shall we do to have x & y axis' to have left and right throttle?


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

531_Ghost
07-29-2004, 08:27 AM
Here's the info on the Throttle Quadrant. Keep in mind right now there are only a small handful of us with this beta testing it.

CHProducts Throttle Quadrant (http://www.chproducts.com/retail/usb_throttle_quad.htm)

http://img.photobucket.com/albums/v179/531Ghost/DXAxis1.jpg

http://img.photobucket.com/albums/v179/531Ghost/DXAxis2.jpg

These are the DX Axis I'd like to assign. The buttons for selecting engines I can to in the HOTAS setup. Thanks for all you've provided thusfar. Much appreciated. BTW I clicked on your link for downloadling and it can't be displayed? Another question tho, Where does this script go?

BaldieJr
07-29-2004, 01:09 PM
Guys...

I need to know which keys you have bound to "select engine x".

Mine are setup: ctrl+1 through ctrl+0 (ctrl+0 = select all engines).

Dont' worry about downloading autohotkey. I'll compile a new script for you so you don't need the interpreter from that site.

BaldieJr
07-29-2004, 01:19 PM
By the way, I should be able to seperate prop pitch and mixture control also. I just takes some time.

Jippo01
07-29-2004, 01:35 PM
I have just two channels (axis') for throttle, so I actually would prefer just to control left and right side engines, not actual individual control.

I use "insert" to select left and "page up to select right. Is that ok?


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

BaldieJr
07-29-2004, 01:46 PM
Thats fine. I also need to know which key selects all engines.

I'll have yours finished in a few minutes http://ubbxforums.ubi.com/images/smiley/16x16_smiley-happy.gif

EDIT: Need to know which axis is left engine. X or Y?

531_Ghost
07-29-2004, 02:03 PM
As far as assigning buttons to select engines, I've done that in the HOTAS set up in the sim. I left buttons 2 and 4 as DIR X buttons and selected them in the sim. If I need to assign buttons to them no problem. For engine # 1 Keyboard 1, for engine # 2 Keyboard 2. Select all engines, Keyboard 3. Now for assigning an axis for prop pitch, I've done that in the sim too but if you need that too it's assigned to CM Device 2 axis R. That isn't a problem as the sim supports an axis for prop pitch.

Thanks again!

~S~
Ghost

Jippo01
07-29-2004, 02:11 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
Thats fine. I also need to know which key selects all engines.

I'll have yours finished in a few minutes http://ubbxforums.ubi.com/images/smiley/16x16_smiley-happy.gif

EDIT: Need to know which axis is left engine. X or Y?<HR></BLOCKQUOTE>

X should be left engine. And key that selects all engines is "home".


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

BaldieJr
07-29-2004, 02:24 PM
I probably should tell you guys: I can not send joystick button presses to the game with autohotkey.

I can send keyboard presses with no problems.

Taking Jippo1's setup as an example, here is how everything will work.

3 keys select engines: Inset, PgUp, and something else.
Keys 1-0 are set for Power 0-100%

The first 10% of the X axis is left engine, 0%.
100% of X axis (pushed all the way forward) equals 100% throttle.
The same goes for Y axis. First 10% equals 0% throttle.

This works the same as "Banding" a slider on the X45. Each axis is split into 10 parts, and if the slider is set to 30% the script just sends the key "3" to the game.

In order for it to work without messing with other axis, it must select the proper engine, send the key that sets the power level, and then select "all engines" (otherwise, the prop pitch/ mixture will be set to the last engine whos power was changed).

So, there are some trade-offs involved. First, you can't go to "36% throttle" because the key strokes down't allow it. I could add 5% steps, but I'm not going to worry about that right now.

Secondly, there will be times when you slam both throttles forward, but one throttle responds a split-second after the other. This should happen so quickly that it goes unnoticed, but I wont know untill it gets tested.

Jippo01
07-29-2004, 02:36 PM
Fair enough, but I have to say 5% increments sound tempting. http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

BaldieJr
07-29-2004, 02:39 PM
jippo,

Try this and let me know how it works:

http://www.fighterjerks.com/XY.exe

I'm at work and can't test it.

If you have keys 1-0 set to Power 0-100%, this should work perfectly. The only thing you need to do is open the config file and remove your current power axis mapping. I think its in the "Users" folder, but I'm not really sure.

Just make sure your current power axis mapping is empty and this should work. If not, let me know and I'll see if I can fix it.


PS- I'll see what I can do with 5% increments, but I can't promise anything at this point.

[This message was edited by BaldieJr on Thu July 29 2004 at 01:55 PM.]

Jippo01
07-29-2004, 02:54 PM
It functions, but not correctly, now both throttles move in game when I move either throttle here. I.e. if I set left throttle to 50% both engines in game set for fifty until I change position of either here.

Also power numbers are reversed: 1 = full power 0 = idle.


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

BaldieJr
07-29-2004, 03:28 PM
Reversed? Strange. Did you happen to mix up the two outer wires on your pots?

EDITED: No, you don't have them reversed. Windows reads X/Y differently from the rest of the axis. No problem.

I can reverse them in the script.

One other thing: when you go into HOTAS setup in FB/AEP, what axis do you have for "Power"? It should be empty.

I wish I were at home so I could test this myself http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

[This message was edited by BaldieJr on Thu July 29 2004 at 02:53 PM.]

BaldieJr
07-29-2004, 03:36 PM
forum seems porked?
Unporked. It seems there is a bug in the old forum that only I know about. http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

[This message was edited by BaldieJr on Thu July 29 2004 at 02:49 PM.]

Jippo01
07-29-2004, 04:02 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
Reversed? Strange. Did you happen to mix up the two outer wires on your pots?

EDITED: No, you don't have them reversed. Windows reads X/Y differently from the rest of the axis. No problem.

I can reverse them in the script.

One other thing: when you go into HOTAS setup in FB/AEP, what axis do you have for "Power"? It should be empty.

I wish I were at home so I could test this myself http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

[This message was edited by BaldieJr on Thu July 29 2004 at 02:53 PM.]<HR></BLOCKQUOTE>

Power is empty.


-jippo


PS. I'm off to bed, further testing tomorrow. http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

BaldieJr
07-29-2004, 04:08 PM
Ok. I fixed a few hiccups. Try downloading again...

http://www.fighterjerks.com/XY.exe

Jippo01
07-29-2004, 04:15 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
Ok. I fixed a few hiccups. Try downloading again...

http://www.fighterjerks.com/XY.exe<HR></BLOCKQUOTE>

Throttle works right way now, but they still remain tied together. Is the "select left engines" right? Should it maybe be "toggle left..."


Don't know, but I got to go to bed. Can do some mor etesting in the morning.


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

531_Ghost
07-29-2004, 04:38 PM
Again I have to ask, wouldn't it be easier if there were more than one throttle axis in the sim? I can duplicate very easily what Jippo is seeing by just using the Control Manager and set up the HOTAS controls in the sim. BUT, if there were another throttle axis for engine #2 in the sim's HOTAS setup this whole problem would be solved. Just my .02 http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

BaldieJr
07-29-2004, 06:23 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by 531_Ghost:
Again I have to ask, wouldn't it be easier if there were more than one throttle axis in the sim? I can duplicate very easily what Jippo is seeing by just using the Control Manager and set up the HOTAS controls in the sim. BUT, if there were another throttle axis for engine #2 in the sim's HOTAS setup this whole problem would be solved. Just my .02 http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif<HR></BLOCKQUOTE>


Sure. That would be great. Only one problem: We've been asking for this since multi-engines were first made available http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

So, we hack out our own solutions.

I'll work on this some more when I get home tonight. Its tough to debug without being able to see the problem firsthand.

BaldieJr
07-29-2004, 11:53 PM
BUG!

You can't select left engine, set power, and select any other engine. Its a limitation of FB.

A pretty damned stupid one too.

531_Ghost
07-30-2004, 11:01 AM
Ummmmm yes I can. Why do you say this?

BaldieJr
07-30-2004, 11:50 AM
Ok, yes, you can do this, but why bother? As soon as you select any other engine your settings change.

You have to deselect that engine first.

Of you play around with it, you'll understand why its broken.

I've found a solution that works, but it requires a lot of custom key bindings and you must have a throttle slider, RPM slider, and mixture slider for each engine you plan to manage. You also need a seperate start button for each engine because you can NEVER have more than one engine selected, otherwise they all read current input and set themselves to that value.

Soooo...

In your case, I could indeed make it work, but it would require a LOT of coding on my part, and you would have to use every axis of your throttle quadrant for engine management. For someone with only a couple of axis to spare, it would never work properly at all.

If you were to manage more than two engines, you'd need even more sliders. It gets messy quick!

531_Ghost
07-30-2004, 12:03 PM
http://ubbxforums.ubi.com/images/smiley/blink.gif OK well what I've been able to do so far is this:
Select engine one increase/decrease power lever on another lever increase mixture and also prop pitch on another lever. (this does not affect engine #2)

Select engine two and do the same.

I have plenty of levers to do what I want I'd just like an axis for another engine power increase/decrease http://ubbxforums.ubi.com/infopop/emoticons/icon_confused.gif

WWMaxGunz
07-30-2004, 01:12 PM
Great find Baldy! reminds of Perl that's crashed into Windoze!

Has anyone tried running two stick, one USB and the other to soundcard?
Will FB see them seperate?

Multiple meeses all work as one.....


Neal

531_Ghost
07-30-2004, 02:06 PM
WinXP don't see gameports http://ubbxforums.ubi.com/infopop/emoticons/icon_wink.gif

BaldieJr
08-01-2004, 09:18 PM
As soon as I get Jippo01's working, I'll start on a script for yours.

I've almost worked all the bugs out. It works, it just has a few minor glitches.

Jippo01
08-02-2004, 07:12 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
As soon as I get Jippo01's working, I'll start on a script for yours.

I've almost worked all the bugs out. It works, it just has a few minor glitches.<HR></BLOCKQUOTE>

Way to go Baldie, I thought you've already given up!


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

Jippo01
08-02-2004, 07:13 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by 531_Ghost:
WinXP don't see gameports http://ubbxforums.ubi.com/infopop/emoticons/icon_wink.gif<HR></BLOCKQUOTE>

My throttle is serial port.


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

BaldieJr
08-02-2004, 09:12 AM
Try this:

http://www.fighterjerks.com/XY.zip

Keys you'll need setup:
Insert: Toggle left engines
Page Up: Toggle right engines
End: Toggle All engines

Once you are in a game and ready to use both throttles, use "End" to untoggle all engines. Your sliders should now work.

I've included the script in the zip file (XY.ahk) in case you want to alter anything.

Jippo01
08-02-2004, 02:26 PM
YES!!! http://ubbxforums.ubi.com/infopop/emoticons/icon_biggrin.gif

Works perfectly! http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

Well done, really a spiffing show! http://ubbxforums.ubi.com/infopop/emoticons/icon_wink.gif

No problems with it as long as I remember to toggle the selection for all engines first.

May I still suggest a few improvements? I had two things in mind:

1. use "HOME" key for toggle all engines, "END" is used for normal zoom selection as default.
2. Please make 5% increments for input. http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif Now is not quite smooth. http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif


Experiences with the current setup:
I tried it with Bf-110 and I have to say it makes a hell of a difference for multiengines. Control on ground is very easy and I don't need to use brakes at all to manouver on airfields. Also in the air turns can be new flown with differential throttle easily.

Works marvelously and is fun, a BIG hand for BaldieJr! http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif Thank you! http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

BaldieJr
08-02-2004, 06:33 PM
I am very glad to hear you are pleased.

I'll change the End key to Home, and work on getting 5% increases/decreases. It'll probably be a few days though.

BaldieJr
08-03-2004, 01:14 AM
I'm going to see if I can make this a customizable thing. Maybe I can store keys, axis, and stick numbers in an INI file so people can just set it up however they want.

B16Enk
08-03-2004, 07:19 AM
I'm impressed http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

Told you you'd get a more reliable/intelligent answer here http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

I have to admit that I had forgotten about AutoKey and BaldieJr (well it's true about the AutoKey bit http://ubbxforums.ubi.com/infopop/emoticons/icon_wink.gif).

Nice work BaldieJr.

Jippo01
08-03-2004, 07:48 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
I am very glad to hear you are pleased.

I'll change the End key to Home, and work on getting 5% increases/decreases. It'll probably be a few days though.<HR></BLOCKQUOTE>

Pleasure is all mine, thanks for the effort! http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif


-jippo

LeLv28 - Fighting for independency since 2002
http://www.lelv28.com

Falkster's Ju-88 fan site:
www.ju88.de.tf (http://www.ju88.de.tf)

531_Ghost
08-03-2004, 10:54 AM
OK here's what I've been able to do: In my version of control Manager (not shown) I'm able to assign a lever position without DX Axis. I used ` for engine off and 1-0 &w for power settings. I still have to select/unselect engine 1 and 2 and move the assigned lever but it works. Klunky but it works. I've unassigned the throttle axis in the game HOTAS Setup and assigned `-w in the keys assigned. Assigning engines to switches I left the switches as DX devices and assigned them in the game. It would be a heck of a lot easier if there were more than one engine power axis tho. Thanks BaldieJr!
http://www.ch-hangar.com/forum/index.php?act=Attach&type=post&id=4993

BaldieJr
08-03-2004, 04:48 PM
hey, you don't have to use "End" key. I'm dumb sometimes http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

The script doesn't even unselect all engines http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

<pre class="ip-ubbcode-code-pre">
##############################
I'm not saying you have to visit my site, I'm just saying your a schmuck if you don't.</pre>
http://www.fighterjerks.com

BaldieJr
08-05-2004, 03:52 PM
5% increase update: ARGH!

http://ubbxforums.ubi.com/images/smiley/16x16_smiley-tongue.gif

Autohotkey just plain sucks in some respects. I'll eventually figure it out though.

<pre class="ip-ubbcode-code-pre">
##############################
I'm not saying you have to visit my site, I'm just saying your a schmuck if you don't.</pre>
http://www.fighterjerks.com