KavindaJD: Yup, the tool does parse the file. What I've been doing, just to make sure that the tool does not crash, is modify the .cfg file to only point to the .texture folder, where I put all the common texture files. Then I use .texture.1, .2, .3 etc. for the livery-specific files & thumbnails (I've found that these folders often have duplicates of common files). It also means copying one or two textures, such as those for fresnel & chrome, from the FSX root/texture folder, but then I know if the tool crashes, it is not due to a missing texture.
I did not spend much time on the Baron this week, but did work out why one anomaly was occurring.
Radios
w.r.t my comment last week about the Undefined Simulation Variable: "Avionics.AudioPanel", it appears that one can get this message in two scenarios:
1. The variable does not exist, or
2. The variable does exist, but one is trying to write to a variable type that is read-only (i.e., is not settable).
So, just changing the script from:
varget ('S:somevariablename', 'variable units', index)
to
varset ('T:somevariablename', 'variable units', index, value)
won't work in many cases. You need to know the variable names for both "getting" & "setting" the value. For example, for reading & setting the transponder, these would be:
decodeBco16 (varget ('S:Avionics.Transponder.GetCode', 'Bco16', 1))
and
varset ('T:Avionics.Transponder.Set', 'Number', 1, '0x'..<somevalue> )
The complete code to increase the 1000 digit of the transponder can be accomplished thus:
local currentSetting = decodeBco16 (varget ('S:Avionics.Transponder.GetCode', 'Bco16', 1))
local newSetting = currentSetting + 1000
varset ('T:Avionics.Transponder.Set', 'Number', 1, '0x'..newSetting )
Note that, logically ( to me, anyway), the "opposite" of "GetCode" would be "SetCode", but that is not the name of the writable instance of this variable.
This is often the case. Another example of "logical oddities" is when increasing or decreasing radio settings. Two of the variables (in this case, to decrease the setting) are:
varset ('T:Avionics.Nav1.WholeDec') and varset ('T:Avionics.Nav1.FractDec')
You can do the same for the COM radios, e.g. to increase the setting, the code is:
varset ('T:Avionics.Com2.WholeInc') and varset ('T:Avionics.Com2.FractInc')
but if you replace "NAV" or "COM" with "ADF" to increase or decrease the ADF setting:
varset ('T:Avionics.ADF1.WholeDec'), varset ('T:Avionics.ADF1.FractDec'), varset ('T:Avionics.ADF1.WholeInc'), varset ('T:Avionics.ADF1.FractInc')
the Content.log with record the variables as unknown /undefined.
Switches
I also did some more investigative work on the magneto switch Issue:
Looking in the converted Baron interior model with Granny Viewer, Addon Builder converts the magneto switches as follows:
Left engine magneto-starter switch: ('S:Engine.LeftMagneto', 'bool', 1)
Right engine magneto-starter switch: ('S:Engine.LeftMagneto', 'bool', 2)
The conversion also reduces the animation by 50% (I'm not sure why this is). The full code is:
local result result = (varget ('S:Engine.LeftMagneto', 'bool', 1) *50) return (result *0.010000)
local result result = (varget ('S:Engine.LeftMagneto', 'bool', 2) *50) return (result *0.010000)
Also note that, as only one engine instance is modeled in flight, the variables ('S:Engine.LeftMagneto', 'bool', 2) & ('S:Engine.LeftMagnetoSwitch', 'bool', 2) are inoperative in Flight (at least, I cannot get them to work!)
Furthermore, as far as I can tell, in Flight, the Engine.Left/Right Magneto variables cannot be set, irrespective of the index #. So, if I'm understanding what is going on here correctly, a better mapping would be to just to map all the engine magnetos in FSX to one magneto variable in Flight, without the 50% reduction in the animation:
return varget ('S:Engine.LeftMagnetoSwitch', 'bool')
Lights
Again, based on some investigative work, light and light switch indices appear to be mapped based on the index value given to the animation within the model file. I'm not 100% sure of this, though, as in the Baron, the conversion has skipped over indices 1 & 2, starting at #3 and continuing to #7. Numbers 3, 4 & 5 work fine, but 6 & 7 do not work, a problem that I'm still trying to resolve.
On the plus side, I took the aircraft up for a test flight a couple of evenings ago, climbing to 15,000 ft without any problems, so aerodynamically, it is flying quite well, though with no lights, I was pushing my luck on this late-evening flight!
FYI, progress will be somewhat slower in future, as I have some other work that I need to focus on in the months ahead.
regards,
FS-Tester