I hope i can get some help here, i've stumbled across this setup file when i was searching for a method to use the secondary trigger button for either shoot weapons maped on second trigger in game or to use it as a macro button for the dss honk (like you pull the trigger to the first stage it starts scanning or firing, if you pull it further to the second stage and let it go it scans / fires automatically for a set amount of time).
i've tried to figure this out by looking at the files but i cant![]()
Hi Certhas,
The code around the firing is a bit messy due to the multiple variables being tracked (does make it hard to follow even for me!) & then also using a combo function to change the mappings from single to combo fire. Thinking about what you are trying to achieve, I don't think you would need to go down that route as your requirements are a bit more straight forward.
I would probably try to tackle this using a simple modifier (say without modifier it fires weapons, with modifier it uses the scanner). You could do this in-line. If you load up the older version of my script 2.3.0 it should be before I introduced the newer complicated function (To give you an idea anyways).
The logic may follow something along these lines (just off the top of my head, & its 1am so excuse any brevity/mistakes):
MapKey(&Joystick, TG1, EXEC(
"if(!Modifier1) Actkey(KEYON+PULSE+Primary Fire)
"if(Modifer1) Actkey(KEYON+PULSE+Scanner))
MapKey(&Joystick, TG2, EXEC(
"if(!Modifier1) Actkey(KEYON+DOWN+Secondary Fire)
"if(Modifer1) Actkey(KEYON+DOWN+Scanner))
MapKeyR(&Joystick, TG2, EXEC(
DeferCall(TimerDelay, &ActKey, KEYON+UP+Secondary Fire)
DeferCall(TimerDelay, &ActKey, KEYON+UP+Scanner))
You could also look at a variable to track the state for the 'hold' action on the secondary trigger, rather than using a set time 'TimerDelay' such as a 6 sec I use for scanners, and do it manually. This may be better for combat oriented stuff vs scanners as it would need you to press the trigger again to release the hold.
Example:
MapKey(&Joystick, TG2, EXEC(
"if(!Modifier1 & Var1) Actkey(KEYON+DOWN+Secondary Fire)
"if(Modifer1 & Var1) Actkey(KEYON+DOWN+Scanner)
"if(!Modifier1 & !Var1) Actkey(KEYON+UP+Secondary Fire)
"if(Modifier1 & !Var1) Actkey(KEYON+UP+Scanner)
Var1=!Var1
Hope it helps
AD
Last edited: