View Full Version : Using %define to seperate two stage trigger outputs
Aceweepop
24th May 2010, 07:48 PM
Hi Bob,
Can you help me with some scripting.
I have successfully completed snomhf's hardware mod on my FS.
I have added the scripting suggested to allow me to seperate js1.b1 from js1.b4 but it is not working!
%define Primary_Trigger JS1.B1
%define Secondary_Trigger CMS.B1
%define Pinky_Button JS1.B4
Secondary_Trigger = (Primary_Trigger and Pinky_Button);
All I get as I squeeze trigger is firstly primary o/p followed by Pinky o/p when full in.
I am trying to make two detent trigger for use in FF5 where first movement gives Laze or Record and gun only fires with full movement.To achieve this I have programmed CMS.B1 to give fire js1.b1 to give laze and js1.b4 to be pinky. The pinky also has scripting to allow varius o/ps but this is not the cause of my problem.
Regards David
Bob Church
24th May 2010, 09:55 PM
Hi David,
I don't see anything wrong with what you're doing syntacticly, and if it downloads the CM doesn't either. A couple of things come to mind, though. First, does it matter if you press js1.b4 before you pull the trigger or is it the same either way. Secondly, are the command on js1.b1 or js1.b4 characters? if they're single characters, they'll repeat, but if they're multiples they'll only play once, and any single character will "break" when another another comes along. If js1.b1 were to send a single character and js1.b4 we're to be any character command, it would kill the js1 character. If you could clear the js1.b4 and mark it as the shift button, you could just put Laze on cms.b1 directly in the unshifted box and then fire on shifted cms.b1 box, or the other way round. They would have to be DX Mode commands though since, with character, you have to release the shift and the button and then press the button again. It won't simply replace one character with the others.
In general, it's kind of difficult to create a button that's not really there. If none of the above helps and you want to post a copy of the MAP, CMS and any CMC files you're I'd be glad to take a look. I'm not really sure what he did, it looked like he was tying the pinky not only to itself but also to another button. Of course, you could just program cms.b1 to fire and the pinky to Laze. It wouldn't be a two-stage trigger really, just separate command, but you could fire and Laze at the same time which is, I think, what you want to be able to do.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Aceweepop
24th May 2010, 10:39 PM
Thanks for quick reply Bob.
Firstly it is the same both ways. Secondly js1.b1 sends (CTL + /) CMS.B1 sends (ALT + /) and jsi.b4 starts a timer cct to send either (ALT + V) for short click or (CTL + 3) for long press.
Not too sure what you mean when you say shifted or unshifted box but I will study it further tommorow, its getting late now.
I dont like your suggestion to use pinky as laze as I do not want to give up normal functions of pinky button.
If I am still struggling I will send you a copy so you can see the whole picture.
Thanks again David
Bob Church
25th May 2010, 08:32 AM
Hi David,
>> Not too sure what you mean when you say shifted or unshifted box but I will study it further tommorow, its getting late now. <<
Over on the right side of the screen for any button, there's a check box marked "Shift". If you check it then it becomes the "Shift" button. There can only be one unless you want to do some logic and OR more than one button to a CMS button, then mark the CMS button as the "Shift".
On the right side of the screen for most any function, DX Mode or Programmed Mode, there a Normal action and a Shifted action. If you hold down the "Shift" button, then you get whatever is in the shifted section. If you don't press the shift button (or don't assign one) then it always sends the Normal action.
The Pinky is probably the most-used button for the Shift button since you can hold it with your pinky finger and still press any other button or hat position on the stick. You can also put it on the throttle, one of those along the front, and still work the rest of the buttons and hats.
I think it goes back to the original Air Warrior, late 80's and early 90's. You could use it to get the 45 degree UP version of the view with the pinky switch.
Did snomhf actually add a switch to the stick for the second stage? I'm not really sure what the mod is.
Anyway, let me know if you need anything.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Aceweepop
25th May 2010, 01:04 PM
Hi Bob,
Thanks for shift explanation,something I dont use,I just have timer ccts to get more out of the buttons.
See( http://www.ch-hangar.com/forum/showthread.php?4026-Dual-Stage-Trigger-Design) for snomhf's mod, also note that the suggestion to keep the pinky by using scripting came from you!
Back to my problem , you hit the nail on the head with the suggestion about not using multiple characters.
I have simply changed my first detent o/p to be a single character and it now works perfect.Had to alter in FF5 game also .
Also I had to add extra scripting(and not js1.b1) to my timer ONDELAY and OFFDELAY statements in the pinky script to stop it outputting unless it was the only one pressed.
Also I could not see why I should use DEFINE statements so I just simplified to:- cms.b1 = js1.b1 AND js1.b4; and it still works.Tell me if this is bad practice.
Thanks for your help, you are the KING
David
snomhf
25th May 2010, 04:33 PM
Hi David,
Not using DEFINEs is not bad practice really. I use them so I can place them at the top of my script and easily tell what buttons the script is using. Also, using DEFINEs allow me to easily change the button assignments without having to locate every place in the script where I reference them. Just makes programming a little easier. No big deal.
Good work on the mod! Glad that worked out.
Aceweepop
25th May 2010, 06:08 PM
Hi snomhf,
Thanks for that reply and thank you for the mod, my CH setup gets more like a Cougar one every day (God Forbid) I don't want one of them again.
I've got the 2stage trigger and my pinky is scripted to imitate the Cougar paddle switch,all I need now is rotaries on the PT.
What does a Potato cost these days and who do I contact?
Thanks again
David
Bob Church
25th May 2010, 06:08 PM
Hi David,
Great! I'm glad it worked for you!
What snomfh said it write, there is really no difference in script that gets generated whether you used %defines or not. When the compiler runs across the name of th %define, it just replaces it with the definition before it processes. It make it a bit more readable, and if you use the value 20 places in the script because timers or something have to have the same setting, you can change the %define and not have to go over a long script and find the references each time.
Anyway, have fun with it!
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Aceweepop
25th May 2010, 06:17 PM
TA Bob
snomhf
25th May 2010, 06:21 PM
Ken "Ghost" King is the FrankenPotato master. I don't know if his pricing has changed since this web page or not:
http://snomhf.exofire.net/FrankenPotato.html
531_Ghost
25th May 2010, 10:21 PM
Pricing has gone a wee bit up. The F-P III is now (has been really) $200.00
Aceweepop
26th May 2010, 11:58 AM
Hi Ghost tried to PM you but your letter box is full!!
531_Ghost
26th May 2010, 02:59 PM
Empty
Powered by vBulletin® Version 4.1.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.