PDA

View Full Version : Another noobish Script question !



BLR_Tonin_fr
26th February 2008, 12:16 PM
Hello all

I have a CH fighterstick and I would like to configure one button to use a key on the keyboard.

OK, so, I did it. Quite simple actually.
Then :
the button 5 calles the H key.
the button 7 uses the Y key.

H and K are configured in the game (il2 1946) as "decrease FOV" and "increase FOV".

It works but the zooming action (while i hold the stick button on) is not smooth. I mean, it is full of notches. (5 frames per sec approx.)

The problem is that the repetition (timing) between two keys is not fast enough.
I had a correct setting with a Saitek X52 and the zooming was prefectly smoooth...

So is there a way to fasten things a little in the script box ?
Is there a way to set the Control Manager could do that without script ?
Is my script correct ?

Here it is :
script
timer( INTERVAL, d1, 1, 1 ) = js1.b5;
timer( INTERVAL, d2, 1, 1 ) = js1.b7;
cms.b5 = d1;
cms.b7 = d2;
endScript

http://img254.imageshack.us/my.php?image=sanstitrepr9.jpg

You can see with the image link that I use the Control Manager V 3.6, maybe I should update it.

Best regards and sorry for my messy english

Bob Church
29th February 2008, 02:12 AM
Hi BLR_Tonin_fr,

Well, the way you've got it set should generate about 10 characters per second, but the sim could be missing them or it may just feel that slow. Have you tried just programming B5 and B7 to send the characters directly and not scripting at all? That way, the key just goes down and stays down while you hold the button, the sim responds at it's fastest rate. Unless the command really requires you to release the key between steps, that might clear it up for you.

If it does have to be released, look on the Program Settings tab and you'll see a box for Character Rate. Set it as low as possible. If it gets too low, the sim might start missing characters, but the default is 50 and you can set it down as far as 25 which is about as fast as Windows will send the character transitions.

Hope this helps!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

BLR_Tonin_fr
29th February 2008, 12:36 PM
Hi Bob

If I set the button up without the timer scrip lines, the zoom progresses approx. 10% by 10% each time I press it. If the button is held on, nothing happens.

The sim needs the button to be repeated very fast to have a smooth action.

Apparently there is no way to set a faster rate to the timer script so what I wanna do with seems to be simply impossible.

I feel a bit confused with the cms but luckely the fighterstick is a nice piece of hardware, nearly as good as its customer support service ;)

So I think I'll give up with CH prgmation. :unsure:
For now I use my fishy Saitek's throttle : the interval timing can be very fast and then the zooming action is very smooth.

http://img186.imageshack.us/img186/6061/x52zoommh8.jpg (http://imageshack.us)

Thanks for your help !
Regards

Anton.

Bob Church
1st March 2008, 05:01 PM
Hi Anton,

No, if it really needs to press and release and you tried setting the character rate down to 25 on the Program Settings tab, then it's moving as fast as it can. It would be about 40% the speed that the Saitek program is showing you, 0.000, 0.025, 0.050, 0.075, etc. You might get somewhat better performance if you didn't use a timer at all, just inverted the CMS bit each time that program looped so long as the button was down. A script something like:


script
if( js1.b5 ) then
cms.b5 = NOT cms.b5;
else
cms.b5 = FALSE;
endIf
if( js1.b7 ) then
cms.b7 = NOT cms.b7;
else
cms.b7 = FALSE;
endIf
endScript

That would get you close to 10 milleseconds or so which is what you've got the Saitek script set to do. I don't know whether it would get you the speed you need or not, you'd just have to try it and see if it made any difference.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

NichtLanden
16th September 2010, 10:46 AM
Hello all!
I have free axes in my PT and want use ministic on PT for Flaps (vertical) and zoom FOV (horizontal)...Can I convert analog changes values from those axes to pressing buttons. For flaps I try to use HOTAS from miistic PT, but is isn't work. How I understand, I have to convert Y axis values to press buatton F and V, for zoom I can convert changing values of Y to determenated press button...What is optimal way for solution this task? When I had ST X52 I could divide this axes of little troddlier to many pieces and for each pieces corresponded specific combination press button.
For laps I have to Divide plus half axes Y to tree piecees:
flaps combat = 1 x press f,
flaps take off = 2 x press f
flaps landing = 3 x press f

the negative flaps can I divede negative half axes Y to tree piecees:
flaps down from landing = 3 x press v
flaps down from take of = 2 x press v
flaps down from combat = 1 x press v
In other words how I can analog axises on CH Product (unimportant where is this axis - PFS, PT, PP or PQ) to slider which pressed buttons or combinations buttons simular on Saitek X52 when I change axis values ?

Bob Church
16th September 2010, 02:06 PM
Hi Nichtlanden,

It sounds like you're looking for Up/Down control, that would be similar to what the Saitek and most systems offer for sending given numbers of the same characters. Select the axis you want to work with, uncheck the "DX Mode" box, and you'll have an option between "Up/Down" or "Position". Try "Up/Down", set for 3 steps, put the appropriate characters in the blocks and see if that's what you're looking for. It can always be done with CMS, a little more trouble, but your reference to Saitek leads me to think you're looking for that basic function, nothing too special.

If that doesn't work, come on back and we can figure something else out.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

NichtLanden
16th September 2010, 04:22 PM
Bob, thank you!
After work I resolved flaps slider on ministik...
All was very simple - control type - "Position", position key "v null f null"...All works fine...I try resolve through "Up/Down" option but when I pressed ministick flaps worked with mistake....

Bob Church
16th September 2010, 07:24 PM
Hi Nichtlanden,

Sounds like it has to be the wrong characters if it works the same. Make sure you only enter lower-case at first, e.g "a" not "A", unless the sim specifically asks for the shift. A lot of docs always use the upper-case, but unless you need to hold down the shift key on the keyboard to make it work, they really just want the key itself.

If it's the same type of function, there can't be too much wrong. but if you can't get it sorted post the .MAP file and let me take a look. If you "Go Advanced", you can attach the .MAP to the forum post.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

NichtLanden
17th September 2010, 11:52 AM
Hi Bob!
How is spoken in Russia - "If nothing doesn't help you, you have to read help documentation! (or forum)":)
I have looked for our forum of ch-hangar and have found some scripts for programming axis

No 1 Script Thread: Need Help Programming Axis on FS, PT, And PP (http://www.ch-hangar.com/forum/showthread.php?5673-Need-Help-Programming-Axis-on-FS-PT-And-PP&p=35034#post35034)

No 2 Script Thread: script to allow KB commands programmed to mini-stick on PT
(http://www.ch-hangar.com/forum/showthread.php?7286-script-to-allow-KB-commands-programmed-to-mini-stick-on-PT&p=43372#post43372)
No 1 Script I have tested for flaps - it worked charm, today I am going to test No 2 Script...How I am nub in CH programming I don't expect that timer (logical digital device) works in values of axis (analog data).
Bob thank you very much.
Now I think about realization script that can generate message on chat of IL1946 word "Caution, will carefully, you have six!" when I press only one button on CH
We have next sequence presses button (for sample)
press " ' " call/ a chat
press "Enter" call a chat menu
press "6" (for a example, first chat menu contains digits from "0" to "10")
press "Enter" call a chat menu for determination address message
press "2" (for a example, second chat menu contains digits from "0" to "10")

Bob Church
18th September 2010, 01:12 AM
Hi Nichtlanden,

You can put multiple characters on any button. Uncheck the "DX Mode" box for the button and just line them up:

C a u t i o n , SPC w i l l SPC c a r e f u l l y , SPC y o u SPC h a v e SPC s i x !

You have to leave a space between each character, and if you need an actual space to separate individual words, you need to put the the SPC character.

You can use the "List Mode" facility if it's a sequence of messages, but the sequence will always be the same, e.g. the first press will always send the first message, the second press will send the second message, etc.

If you need random access to the messages, then you have to find some way to put them on seperate buttons so you can get to the one you want. Using the Shift button and Modes can help. An 8-Way POV hat with shift and 4 modes can send 64 different messages, you just need to make sure you've got the shift button in the right position and are set to use the right mode.

How did you want it to work exactly?

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

NichtLanden
7th October 2010, 08:26 PM
Hi Bob
Unfortunately I have recently returned from vacancy and don't have enough time for flight in IL2 and experiments for writing new scripts - business and business....
I understood yours idea about writing messages on chat and near time add this command in mapper file and cmc file
Now I have little problem with changing function of keys when I press keys ALT+TAB for switching between IL2 1946 and another application at time work compiter
I started CM Control center and download in memory computer CMC and CMS files (see attach, I took CMC file written Michael Sexton and Edited by Kevin Watts IL-2 1946 04-01-2007 and inserted little modification), When I switch from IL21946 and return back I see that sometimes presses button changed
For sample - I press KBLEFT for Decrease_Sight_Velocity, after pressing ALT+TAB on keyboard I see when I press KBLEFT executes other command - Adjust_Sight_Control_To_Left which before determinates how combination Adjust_Sight_Control_To_Left ALT KBLEFT....
For repaired normal work JS I begin press key ALT TAB many times and checks normally works СН or no....
How I can solve this problem??

NichtLanden
9th October 2010, 09:38 PM
I am tried to solve problem stick keys ALT and TAB after pressing key combination "ALT + TAB" at keyboard

CMS.B5 = LALT
CMS.B6=TAB

wrote this sample script
SEQUENCE
WAIT( CMS.B5 AND CMS.B6);
CMS.B5 = TRUE; // press ALT
DELAY( 1 );
CMS.B5 = FALSE; // release ALT
CMS.B6 = TRUE; // press TAB
DELAY( 1 );
CMS.B6 = FALSE; //release TAB
ENDSEQUENCE

but it didn't work:( The script complied Ok, but ALT and TAB were stick