View Full Version : Modifying effects files?
DaveKDEN
12-26-2003, 01:35 PM
Does anyone know how to modify the contrails effects file to activate the wingtip vortice effect to come on at a specific G? I have the FSD T-38 wingtip vortice effect "fx_contrail_t38.fx" and the wingtip vortice effect file "fx_contrail_s.fx." Both effects generate the wingtip vortice at 7 G's regardless of which aircraft I've implemented the effect in. I'd like to adjust them so they come on at a more realistic G force of ~3-4 G's. BTW, both files seems to be identical with the exception of the added line of "Shade=1" in the "fx_contrail_t38.fx" file.
Edit; Seems the wingtip vortice effect is generated in a different fashion on the FSD T-38. Seems to be on nearly all the time for some reason, whereas on other aircraft, it comes on at 7 G. Curious. Maybe it's controlled by another factor or file???
Thanks,
DaveKDEN
12-26-2003, 02:10 PM
For anyone who's interested, the solution was very simple. The effect is controlled by the "gforce.xml" utility in the "...\FS9\Gauges\keffect\" folder. You need to have that utility installed for the implementation of the effect at a specific G. If I recall, the utility is included in the DSB Tornado package available at Simviation. You also need proper entries in the panel.cfg and aircraft.cfg file for the particular aircraft you want the effect to display.
The panel.cfg needs the the following added to a section at the end of the VC section;
gauge00=keffect!gforce, 1,1,1,1
Here's how it is on the recently relesed CoralFLT F-15;
{VCockpit06} -----this line should be enclosed by brackets
size_mm=32,32
pixel_size=32,32
texture=$exhaust
background_color=0,0,0
visible=0
gauge00=keffect!gforce, 1,1,1,1
gauge01=DSBXML!DSBAburner, 1,1,1,1
gauge02=rcb-gauges!FlameAndAfterburnerEffectControl, 0,0,1,1
gauge03=keffect!kexhaust, 1,1,1,1
Note: the other entries are for different effect types (flame and afterburner).
You also need to add an entry under the {Smokesection} in the aircraft.cfg file.
Here's how it is in the same F-15;
{SMOKESYSTEM} -----once again, this should be enclosed by brackets
smoke.0=0.00, -21.00, 21.60, fx_contrail_s.fx
smoke.1=0.00, -21.00, -21.60, fx_contrail_s.fx
Since I discovered the control for the effect was obviously not included in the effect file (through trial and error experimentation), I figured it must be controlled by something else. By comparing the F-15 and the FSD T-38, I noted the panel.cfg entry was in the F-15 but not in the FSD T-38. I added the entry in the T-38 panel.cfg and the wingtip vortice then appeared at the 7G mark (instead of all the time). I then figured the effect must be controlled by the "keffect!gforce" gauge. That particular .xml gauge is located in the above mentioned "...\FS9\Gauges\keffect\" folder. I opened that .xml gauge up and edited it to read;
<Gauge Name="kexhaust">
<Element>
<Select>
<Value>
(A:G FORCE, gforce) 4 > (A:INDICATED ALTITUDE,feet) 20000 < && if{ (>K:SMOKE_ON) } els{ (>K:SMOKE_OFF) }
</Value>
</Select>
</Element>
</Gauge>
The original settings had the G force at 7 and the altitude at 12,000 feet. This implemented the effect at and above 7 G's and below 12,000 feet altitude. I decided I liked 4 G's and altitudes up to 20,000 feet for the effect to show.
I saved the changes and the effect is now implemented as I like.
I know this seems like a lot of information, but if you have aircraft that already have the appropriate aircraft.cfg and panel.cfg entries, the edit consists of modifying the gforce.xml gauge only.
Hope this helps,
rcbarend
12-26-2003, 08:37 PM
Hi Dave,
Although your change is correct by itself, be aware that this (and many other gauges) contains a bad way of programming.
In this gauge, there's a construction like:
...... if{ (>K:SMOKE_ON) } els{ (>K:SMOKE_OFF) }
The following construction should be used instead:
...... if{ (A:SMOKE ENABLE,bool) ! if{ (>K:SMOKE_ON) } }
els{ (A:SMOKE ENABLE,bool) if{ (>K:SMOKE_OFF) } }
Although it does the same function (setting the SMOKE function off/on) , there's a big difference:
- The first coding continously writes a SMOKE event every time the gauge is scheduled (every 55 msec.)
- The second coding only writes an event when needed (i.e. the current value needs to be changed).
The original coding will give a problem in FS with multi-keystroke commands, like:
- Pushback, e.g. Shift-E followed by "1" or "2"
- Select Engine 2; e.g. "E" followed by "2"
- Select COM freq. digit, like "C" followed by another "C"
- Select Exit 2, e.g. "Shift-E", followed by "2"
Etc. Etc.
The reason is that for these multi-keystroke commands, FS times a delay between the first keystroke and an optional second keystroke. When another event is given in between, FS stops this delay-timer and never relates the second keystroke to the first one anymore. Hence no pushback turning, no possibility to select the 2nd engine, etc...
And that's exactly what the original coding does: it gives an event every 55 msec, so there will always be an event in between two keystrokes of an multi-keystroke command !!
So if you ever run into these "select" problems, you know where it comes from :-)
Regards, Rob
DaveKDEN
12-26-2003, 08:52 PM
Ahh, makes sense. The original coding will interrupt any other event if it uses multiple keystrokes to command (eg., shift+E then 2 for a secondary door open/close). By changing the coding as you listed, it won't interrupt other multi-keystroke commands. Good to know and I've made the appropriate modification. Going to check it out now.
Thanks for the tip and the great .xml utilities Rob!
Dave
rcbarend
12-26-2003, 09:19 PM
Hi Dave,
Welcome to the wonderfull world of gauge designing :-)
And all you really need is Notepad and a little common sence :-)
That's how I started out about 2 years ago; just the way you do now !!.
Cheers, Rob
Good work. I was able to get the FSD T-38 contrails working off G's nicely. However for the KO F-16, GMax F-15, and DR F-18 no go.
Can't figure out what is different. Panel.cfg and aircraft.cfg were set up the same as for the T-38 as described above.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.