PDA

View Full Version : New to CMS questions



mirage 94
26th January 2008, 02:22 AM
Hi all,


I wanted to try incorporating some of these fine scripts into my current IL2 map. Can I use scripts while in the mapped mode - i.e., I have a fighter stick, flight stick pro, pro throttle, and pro peds set up in mapped mode.

If so, I wanted to try one of DonULFonso's trigger scripts (http://www.ch-hangar.com/forum/showthread.php?t=2372). However, my "shift button" is B4 on the throttle instead of the fighter stick. Would I call that js2.b4? js3.b4?

I'm also stuggling a bit with figuring out how to assign those cms virtual buttons to the trigger. In my current, nonscripted map, I don't have the trigger in DX mode - rather, I have assigned the normal press to weapon 1 and the shifted press to weapons 1 and 2 (via the CMC). I want to assign normal press as weapon 1, shifted press as weapon 2, and normal press followed by depressing the shift button to activate weapon 1 and 2 together.

I had another idea to expand on the 2-stage trigger. It would be nice to have an option to toggle weapon 2 on and off while shooting weapon 1. For instance, weapon 2 fires only when the shift key is pressed and it stops when released. Or the shift could be a toggle - first press enables cannon, second press disables it, etc, all while weapon 1 is firing. I'm sure anything is possible with scripting but thought I'd throw that out.

Bob Church
26th January 2008, 05:39 AM
Hi mirage 94all,

>> I wanted to try incorporating some of these fine scripts into my current IL2 map. Can I use scripts while in the mapped mode - i.e., I have a fighter stick, flight stick pro, pro throttle, and pro peds set up in mapped mode.

If so, I wanted to try one of DonULFonso's trigger scripts (http://www.ch-hangar.com/forum/showthread.php?t=2372). However, my "shift button" is B4 on the throttle instead of the fighter stick. Would I call that js2.b4? js3.b4? <<

he JSx part depends on the position of the tab that the controller appears on. The left-most tab is called "Program Settings", then they work to the right. Whatever is on the first tab to the right of "Program Settings" is "JS1", the next tab is "JS2", and so on. If the stick is on the first tab and the throttle on the second, then JS2 would be right. The "Bx" part (Ax if you're using axes) is the same as is shown on the programming screen. Button 1 is "B1", Button 2 is "B2", the X Axis is "A1", etc. There are some other references, numbers for the POV positions, etc. that the CMS file can reference, too. If you need those, it's in the Users Guide or you can just ask.

>> I'm also stuggling a bit with figuring out how to assign those cms virtual buttons to the trigger. In my current, nonscripted map, I don't have the trigger in DX mode - rather, I have assigned the normal press to weapon 1 and the shifted press to weapons 1 and 2 (via the CMC). I want to assign normal press as weapon 1, shifted press as weapon 2, and normal press followed by depressing the shift button to activate weapon 1 and 2 together.

I had another idea to expand on the 2-stage trigger. It would be nice to have an option to toggle weapon 2 on and off while shooting weapon 1. For instance, weapon 2 fires only when the shift key is pressed and it stops when released. Or the shift could be a toggle - first press enables cannon, second press disables it, etc, all while weapon 1 is firing. I'm sure anything is possible with scripting but thought I'd throw that out. <<

I think you could work it out so that the trigger fires #1 and the shift button fires weapon #2. It would simplify things if the button wasn't the shift button since it's going to end up shifting everything in the whole map that has a shifted function. Do the weapons have DX Mode assignments available? It's kind of obscure, but as I recall you can't change shift states on a character command once it starts but DX Mode stuff will track shift right away. It might be easier if DX Mode were available, as it is I think that the trigger sending the Weapon #1 command, the shift button won't change it until the trigger is released.

Figure out exactly how you want it to work, probably it can be done.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

El Hefe
26th January 2008, 07:34 AM
Bob do you know if it's possible to make the FS trigger send two commands at the same time?

I want the trigger to send ENT and BKSPC so I can fire weapon 1 and weapon 2 in IL2-1946 at the same time with just 1 button.

Bob Church
26th January 2008, 01:11 PM
Hi El Hefe,

Try programming it as:

HOLD ENT BKSPC

and see if that will do the trick.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

mirage 94
26th January 2008, 02:02 PM
Thanks Bob! You've clarified the JS part for me. I should have been more specific about the "shift" part. I meant "shift-trigger". El Heffe, that's exactly what I have programmed now for my trigger (HOLD ENT BKSPC) to shoot guns and cannons simultaneously.

One more question I had: does a button need to be assigned "DX mode" in order for the script to work? and how can I find out the button number assignment? i.e. left tick on the FS POV, etc?

Bob Church
26th January 2008, 03:04 PM
Hi mirage 94,

It's just a little messy because you're using characters. You can change character while the button was press. If there are DX buttons that will do the same thing, I think it would be a lot easier since the shift could just "add" to it. When you use characters, the shift has to be pressed before the character button or all you can get is the unshifted command. I think it can be done either way, though. Just that using DX commands would probably be easier. Are there button command for both weapons or do they have to be characters?

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Bob Church
26th January 2008, 04:16 PM
Hi mirage94,

Try this, maybe it will do what you want. First add the CMS Controls to the map. Use the "Add" button, they're at the bottom of the list of controls. Then open the CM Editor by clicking the button on the toolbar, there will be an empty script, just the "script" and "endScript" statements and some header line. Make the script look like this:


script
cms.b1 = js1.b1;
cms.b2 = js1.b1 AND js2.b4;
endScript

Close the editor and go back to the GUI. Select the CMS Control tab. Program Button 1 there to send a press string like this:

KEYS +ENT

and a release string of:

KEYS -ENT

Next select Button 2 on the CMS controls and program that to send:

KEYS +BKSPC

on the press side and:

KEYS -BKSPC

on the release side.

Save and download the map, see if it does the trick. What it does is send the ENT character when the trigger is pushed, and if you press the shift button "js2.b4" while the trigger is in it will send the BKSPC. If the trigger isn't pulled, then the shift button won't send the BKSKPC command.

I don't know if that's exactly what you had in mind, but maybe it will give you a place to start.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

mirage 94
26th January 2008, 07:11 PM
I figured a few things out and got the 2-stage trigger going. First, I put the trigger in DX Mode - CM Device 1 Button 1 (normal and shifted action). Then I added DonULFonso's script to the CM Script file:

SCRIPT

PULSE ( D4 ) = JS2.B4; // generate a single short PULSE when depressing the 'pinkie'

// CMS.Bx ( <-------------------------on--------------------> ) OR ( <--------------off-------------> )

CMS.B1 = ( NOT CMS.B1 AND JS1.B1 AND NOT (JS2.B4 AND NOT D4) ) OR ( CMS.B1 AND JS1.B1 );

CMS.B2 = ( NOT CMS.B2 AND JS1.B1 AND (JS2.B4 AND NOT D4) ) OR ( CMS.B2 AND JS1.B1 AND JS2.B4 );

ENDSCRIPT

JS2.B4 is my shift key (button 4 on the throttle). I then assigned CMS control button 1 to the keystroke that fires weapon 1 (ENT) and CMS control button 2 to the keystorke that fires weapon 2 (BKSPC). By gosh it worked!

Trigger = weapon 1; Shift + Trigger = weapon 2; Trigger + Shift = weapon 1 and weapon 2.

__________________________________________________ _______________

Now I'm fooling around with a manual raise and lower gear script that DonULFonso wrote:

// Manual Gear

SCRIPT

PULSE ( D10 ) = JS1.B26;
PULSE ( D20 ) = JS1.B30;
B11 = (NOT B11 AND D10) OR (B11 AND NOT D11 AND NOT D10 AND NOT D20);
B21 = (NOT B21 AND D20) OR (B21 AND NOT D21 AND NOT D10 AND NOT D20);
TIMER (ONDELAY, D11, 100 ) = B11;
TIMER (ONDELAY, D21, 100 ) = B21;
TIMER (INTERVAL, D12, .5, .5) = B11;
TIMER (INTERVAL, D22, .5, .5) = B21;
CMS.B3 = D12;
CMS.B4 = D22;

ENDSCRIPT

I think I get it - elegant! But not quite working yet. I assigned keystroke alt g (raise gear manually) to CMS.B3 and keystroke shf g (lower gear manually) to CMS.B4. The logic is if JS1.B26 is pressed once (as I understand it - i.e., not held down), the script triggers CMS.B3 at 0.5 sec intervals. If I hit it again, it stops hitting CMS.B3. and so on.

DonULFonso
26th January 2008, 07:32 PM
Not if you hit the same button again, but if you use the opposite way. The purpose of this routine (as I intended it) is to mimic the automatic gear function and provide the same functionality of only having to press a button once instead of holding it even if the sim wants you to ;) - kind of a "lazy man's gear".
When using it you'd map the key to toggle the gear to both positions, too, and then just use which ever you might need - but without having to deal with one-press-or-holding-it-down questions :) : if the sim at that moment allows the toggle then fine, if not it'll work your gear the way you expect it to nonetheless :D !

BTW, the INTERVAL TIMERs' on/off periods are specified in "character times"(*), so they need to be "5" (char. times) not ".5" (seconds).
(* That's the rate at which new button presses are scanned. The default setting is 50ms, so 5 char. times = 250ms, and 1 cycle of 250ms "on" plus 250ms "off" makes 0.5s. This setting can be adjusted on the "Program Settings" tab of the CM's GUI. Note that the smallest useful value is 30ms since Windows won't be able to pick up and process anything faster anyway.)

mirage 94
27th January 2008, 03:03 AM
Thanks Don,


Changed that and got it working! Very nice. I also changed the time from 100 to 350. That seems to cover the entire manual gear cycle (at least on the F4F). My biggest problem was that I thought the POV left and right buttons were 26 and 30. It turns out they are 27 and 31. I ran my CM list utility and it has POV up assigned as 24 (instead of 25)? So the script was working fine all day, I just had the wrong buttons assigned. Is there a definitive list of button numbers and locations available? It's probably somewhere right under my nose - but any advice is greatly appreciated!

Bob Church
28th January 2008, 03:42 AM
Hi mirage 94,

Somebody reported the problem with the POV numbers in CMList awhile back and it has been fixed, but there hasn't been a release since then so it hasn't been distributed yet. The POVs are always 25 through 32.

Anyway, the next release will have the updated version. Sorry for the inconvenience.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

mirage 94
30th January 2008, 12:17 AM
Fantastic!

Mag_Maverick
3rd February 2009, 07:24 AM
Could not get DonULFonso's script to work. What I want to do is assign fire weapon 1 (ENT) + weapon 2 (BKSPC) to fire with Button 1 (trigger) in shift mode. Unshifted (Normal Action) is fire weapon 1. Shifted Actions is both weapon 1 + weapon 2. Need some assistance on how to do this.


Thanks,
MM

Bob Church
3rd February 2009, 07:58 AM
Hi Mag_Maverick,

I don't know why you'd need CMS for that. Set up one button to be the shift button and then uncheck the "DX Mode" box on Button 1 program it by putting:


ENT

in the "Normal Action" "Press" box and programming it to send:


HOLD ENT BKSPC

in the "Shifted Action" "Press" Box. That should work unless there's something else you need to happen.

It doesn't matter whether you leave the shift button in DX mode or uncheck the box so it's in character mode. If you do leave it in DX mode, Set the DX Device and DX Control boxes on the right side of the screen to "NONE", if you switch to characters, just leave them blank. If you program it you'll get that as well as whatever action you were trying for.

If there's something else going on that requires the script, let me know what you're trying to do and we can probably work it out.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Mag_Maverick
3rd February 2009, 04:22 PM
Thanks Bob!

That worked! Actually I had previously tried that without success. What I had failed to do was to remap the trigger in IL2 from JoyButton1 ID2 to ENT. The guns+cannon would work (shifted) but not the guns (normal). I should know better but it was late and was very tired.

Again thanks for the help. You're a great resourse!

MM

Bob Church
3rd February 2009, 11:11 PM
>> I should know better but it was late and was very tired. <<

Hehe. Story of my life. :)

>> Again thanks for the help. You're a great resourse! <<

You're quite welcome! I'm glad it was as easy as it was!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com