February 3, 20188 yr I have several vintage WWI fighter aircraft and, although FSX will not allow you to shoot aircraft down (nor would I want to), I would like to have gun effects for them all. One, a Sopwith Camel, has a Gun.cab file with xml code inside within the panel folder that triggers the guns to fire when you pull the trigger on the joystick. Perfect! The muzzle flash is triggered by a "light effect" in the [lights] section of the aircraft.cfg and the sound comes from Doug Dawson's awesome DSD Sound xml file. All with a pull of the joystick trigger. Exactly what I want. Several of the vintage WWI aircraft that I have however have no gunfire effects whatsoever. I thought, being very inexperienced at this, that simply copying the gun.cab to the other aircrafts' panel folders, the gauge entries to the other aircrafts' panel.cfg vcockpit01 section, and the effect entries to the other aircrafts' [lights] entries would give me guns...and it does. Marvelous. But, they fire by pressing the "L" button on the keyboard, not the trigger. So, one gauge, identical in every way, generates the same effect using the exact same entries, but has to use two different inputs from me to be visible. Sopwith Camel I pull the trigger. Hitting the "L" key does nothing. All others I have to hit the "L" key, pulling the trigger does nothing. Yet the gauge hasn't been altered in any way, the xml code is identical word for word and character for charter, the panel.cfg entries and aircraft.cfg entries are identical and in the same section from aircraft to aircraft. The end result is all aircraft fire guns, but only one does so with the trigger. Coded in to the model? If not... Why? Here's the xml code... Quote <Gauge Name="guns6"> <Update Frequency="7"/> <Element> <Select> <Value>(P:Absolute time, seconds) (G:Var1) == if{ 1 (>L:paused,bool) } els{ 0 (>L:paused,bool) } (P:Absolute time, seconds) (>G:Var1)</Value> </Select> </Element> <Element> <Select> <Value> (A:BRAKE RIGHT POSITION, part) 0.4 > (A:SIM ON GROUND,bool) 0 == && (A:GEAR LEFT POSITION,percent) 5 < && (L:paused,bool) 0 == && if{ (A:LIGHT TAXI,bool) ! if{ (>K:TOGGLE_TAXI_LIGHTS) } (L:wwi_guns,enum) 2 < if{ 2 (>L:wwi_guns,enum) } } </Value> </Select> </Element> <Element> <Select> <Value> (A:BRAKE RIGHT POSITION, part) 0.4 < (A:SIM ON GROUND,bool) || (A:GEAR LEFT POSITION,percent) 5 > || (L:paused,bool) || if{ (A:LIGHT TAXI,bool) if{ (>K:TOGGLE_TAXI_LIGHTS) } (L:wwi_guns,enum) 0 > if{ 0 (>L:wwi_guns,enum) } } </Value> </Select> </Element> </Gauge> In that code, what is the entry that "executes" the effect (muzzle flash), for lack of a better word, and what is the entry that identifies the "actuator" (the button push/trigger pull)? I assume the same entries are listed twice because there are two guns mounted on the cowling. Randy Randy Tyndall You never lose the buzz of flying. Every time you take off, it feels a bit naughty, as if you're doing something you shouldn't do...Matt Jones, Boultbee Flight Academy
February 3, 20188 yr Randy, I hope this will help you. 1) Make sure the gun effect is tied to the Taxi lights in the aircraft.cfg [LIGHTS] section. light.X = 6, zzzz, xxxx, yyyy, my gun effect, 2) The trigger is actually the brakes. Have a button/trigger on your hardware to do that. 3) HOLY MOLY that is some old code! (Love it!) The pause detection routine is from FS2002 or 4 I believe. (I wrote it) It also relies on an airplane with retractable gear. You do not have that, it will never work. The following code will also answer your question of 2 hours ago, Ramjett said: In that code, what is the entry that "executes" the effect (muzzle flash), for lack of a better word, and what is the entry that identifies the "actuator" (the button push/trigger pull)? I assume the same entries are listed twice because there are two guns mounted on the cowling. 1 half is the "fire" code, the other half is the "stop firing" code. The pause detect & retractable gear code has been removed. In my opinion a little over done. (pause wise) <Gauge Name="guns6"> <Update> <!-- FIRE MY GUNS --> (A:BRAKE RIGHT POSITION, part) 0.4 > (A:SIM ON GROUND,bool) ! (A:LIGHT TAXI,bool) ! if{ (>K:TOGGLE_TAXI_LIGHTS) } <!-- STOP FIRING GUNS --> (A:BRAKE RIGHT POSITION, part) 0.4 < (A:SIM ON GROUND,bool) || (A:LIGHT TAXI,bool) and if{ (>K:TOGGLE_TAXI_LIGHTS) } </Update> </Gauge> A little cleaner yes? In a nutshell you can only use this code with an aircraft that DOES NOT have any type of taxi lights (type 6) as a stock (supplied) light. FS RTWR SHRS F-111 JoinFS Little Navmap
February 3, 20188 yr Author Thanks for that reply.. Your code, huh? Amazing how things come full circle and everything "old" is "new" again. I will give it a try and report back. Thanks again, sir. By the way, I just took a look at the F-111 Beta link in your sig. Saw them every day in the air above Mountain Home and had the sad duty of responding as part of the Disaster Preparedness Crash Recovery Team to one that went down on takeoff. Awesome bird...miss her. Randy Randy Tyndall You never lose the buzz of flying. Every time you take off, it feels a bit naughty, as if you're doing something you shouldn't do...Matt Jones, Boultbee Flight Academy
February 3, 20188 yr Author Worked very, very well and now have guns firing from the joystick trigger on 7 of 9 vintage WWI aircraft. One, the Bristol F2B I am sure is because the gauge entry is supposed to go in the vcockpit01 section and although there is a virtual cockpit in it, there is no vcockpit01 (or any XX) section, just the typical window01, 02, etc entries. I placed the gauge line for the guns.cab in the [window.00] section, but no joy. It is the only one that has lights, although the [lights] section is empty of any parameters except for the gun muzzleflash effects line (came that way). Pressing the "L" key does get the guns effect to fire, but pressing the joystick trigger still does not. It's okay though, not so concerned with that one. It has a sperry AP, gps, and more bells and whistles than they had in WWI so I do not fly it much. The other one not working is the Vought VE-7. That one is a very pretty and clean looking bird and a joy to fly, so I will have to play with it somewhate, but I'm very pleased with 7 out of 9 when I only had 1 out of 9 before! Thank you so very much. Randy Randy Tyndall You never lose the buzz of flying. Every time you take off, it feels a bit naughty, as if you're doing something you shouldn't do...Matt Jones, Boultbee Flight Academy
February 3, 20188 yr Hi Randy, You are welcome. I can almost bet that the Bristol & Vought don't have brakes. -or- No electrical system to provide power to the taxi lights IE guns. ( A must have ) Do you, by any chance, use a registered FSUIPC? If so, it is much easier to do via LUA. Then all you have to do is to install the lights entry (guns) in the aircraft.cfg and the "global" LUA will take care of the rest. FS RTWR SHRS F-111 JoinFS Little Navmap
February 3, 20188 yr SHOOT! So very sorry! I wrote that code last night after a 20 hour day and it was not tested. Forgot something very important. Please try this. <Gauge Name="guns6"> <Update> <!-- FIRE MY GUNS --> (A:BRAKE RIGHT POSITION, part) 0.4 > (A:SIM ON GROUND,bool) ! (A:LIGHT TAXI,bool) ! and and if{ (>K:TOGGLE_TAXI_LIGHTS) } <!-- STOP FIRING GUNS --> (A:BRAKE RIGHT POSITION, part) 0.4 < (A:SIM ON GROUND,bool) || (A:LIGHT TAXI,bool) and if{ (>K:TOGGLE_TAXI_LIGHTS) } </Update> </Gauge> FS RTWR SHRS F-111 JoinFS Little Navmap
Archived
This topic is now archived and is closed to further replies.