• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Modification of existing panel?

Messages
10
Country
unitedstates
Code syntax problems

99 FSDevelopers,

I downloaded a T-45C aircraft file from simviation.com (http://www.simviation.com/simviation/?ID=64&page=8&mark=2312), and it is almost dead accurate. However, the only way to effectivly change the Nav radio is to use the Communications Minipanel, because both of the nobs for tuning the frequency only change the numbers to the left of the decimal. Also, there is no way to change the OBS course.

I was wondering if there was a way to fix the Nav radio programming, and while I'm at it, add in or at least modify a non-used switch to change the OBS course (preferably using the Data Entry Pad below the HUD, since that is how it is in the plane, somewhat similar to the F-18 entry pad).

I currently fly the jet out of NAS Meridian, and it would be helpful to get these items to work, since right now I am limited to the F-18 (functions properly, however speeds vary somewhat). I have done the basic tutorial for creating XML gauges (the fuel pressure and stopwatch), but I don't have the first clue about getting into an exiting panel and making said changes.

Any help would be much appreciated!
Matt
 
Last edited:
Messages
10,088
Country
us-arizona
Hey Matt,

XML gauges are what is 'tuneable' where you can go in and modify them.

I cant help you out too much on this, but here is a basic breakdown on how gauges work.

Gauges 'read' what are called 'Parameters'. This is units of measure, things happening (flaps down, gear up, airspeed, etc) in and around an aircraft. Then you have Mouseclicks that operate what are called 'EventID's. An EventID is simply a 'command' or switch code. This will 'effect' a 'something' in or around the plane.

There is a FS2004 SDK pacakge, one of which is Panels. In there is the 'DOC' folder. That contains the "Parameters" list, which is the 'data' going on in the plane and the world. The next important Doc is 'EventID's. This is the list of 'commands' and switches.

So, Commands/switches, and Parameters. (Buttons list, and readouts/happenings). With those two documents, you can assemble, modify your gauges and change gauge code to diff gauges.

Now, when gauge code starts to get into sophisticated 'what if' scenarios, having several forms of readout under varied conditions, (its over my head right now), then you call those types of code Elements 'arguments'. I dont know why, but in code jargon, its an 'argument'.. What if, then this, or that, and that too, etc.

My advice is to find a gauge in a plane that in XML code (that will work in that sim, such as FSX code for FSX, and not FSX code for FS9), and modify that gauge into a new one, making your own graphics, and fitting/tuning the code to suit your 'new' gauge. Thus you would be using another gauge as a template to make your new gauge(s).


I hope that helps. I am up to my top head hairs in business or I would try to help you out more. At least this gives you some basic insite though on the 'big gauge picture'.




Bill
 
Last edited:
Messages
10
Country
unitedstates
Bill,

Thanks for your help. What I ended up doing was creating my own type of NAV panel to supply the functions that I needed. Unfortunately, I must open it as its own view since I can't seem to place it in the virtual cockpit. When I open up the Panel.cfg file, there really is not a lot of code for the virtual cockpits (as compared to the C-172), and I have tried adding in the gauges at the bottom of the gauge coding (gauge01...) but nothing shows up in the view. Also, the panel itself is a .mdl file, so I don't know if I can even add items to it.

I was able to put in the gauge coding on the C-172 panel file and they show up to a point where I can work the position to get it where I want, but with the T-45, no luck. Any suggestions on how I might be able to make those gauges appear?

Matt
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Unless you have the model's source code, you cannot modify the virtual cockpit at all. Period.

Every gauge must have a polygon surface upon which the gauge can be projected (think of a movie screen!) by the sim...

...no screen = no gauge!
 
Messages
497
Country
unitedstates
99 FSDevelopers,

I downloaded a T-45C aircraft file from simviation.com (http://www.simviation.com/simviation/?ID=64&page=8&mark=2312), and it is almost dead accurate. However, the only way to effectivly change the Nav radio is to use the Communications Minipanel, because both of the nobs for tuning the frequency only change the numbers to the left of the decimal. Also, there is no way to change the OBS course.

I was wondering if there was a way to fix the Nav radio programming, and while I'm at it, add in or at least modify a non-used switch to change the OBS course (preferably using the Data Entry Pad below the HUD, since that is how it is in the plane, somewhat similar to the F-18 entry pad).


Any help would be much appreciated!
Matt


Unfortunatly, the Radios in this Plane are a bit of a mess.

The VC panel displays them as Radios with an ACTIVE & STANDBY, but there is no ACTIVE/STANDBY switch, and the aircarft.cfg file is defining the radios as not having a standby !!

Not being able to tune Nav1 "Lower Digits" is tied up with the VC model, and there is no way for an end user to modify that.

HOWEVER, that being said, I have a SOLUTION. :)

(1) Replace the Radios with the KING AIR Radios, that do NOT have a Standby.
(2) You can then get around not being able to tune the Nav 1 "lower digits", by not attempting to use the KNOB, but instead, put your mouse over the digits, and use your MOUSE SCROLL WHEEL. ( same now applies to COM1 & COM2 if you choose to tune them that way in the VC )


To do the above, edit the Panel.cfg VC section, as shown below.

Code:
[Vcockpit05]
Background_color=0,0,0 
size_mm=512,512

visible=1
pixel_size=512,512
texture=$t45vc5

gauge00=Bendix_King_Radio!Bendix-King Radio Audio,        0,  0,512,50
gauge01=KingAir_Radio!Com1,   5, 50,256,94
gauge02=KingAir_Radio!Com2,   5, 144,240,83
gauge03=KingAir_Radio!Nav1,280, 50,100,94
gauge04=Bendix_King_Radio!Bendix-King Radio ADF,          0,226,512,90
//gauge05=Bendix_King_Radio!Bendix-King Radio DME,          0,180,512,41
//gauge06=Bendix_King_Radio!Bendix-King Radio Xpndr,        0,217,512,49
//gauge07=Bendix_King_Radio!Bendix-King Radio AP,           0,262,512,48
windowsize_ratio=1.000
window_pos=0.756,0.358
window_size=0.243,0.641

If you still NEED the Nav1 "lower Digit" knob fixed, the original author will have to do that. :wizard:

Note: The above change, also gets rid of displaying the Standby Freq, which is both confusing & not usable.
So you are only changing the ACTIVE Freq, as here is not ACTIVE/STANDBY switch.

However, I see little difference in using the Mouse Scroll wheel on the DIGITS, as opposed to the Knobs, and at least now, you will be able to tune all your Radios in the VC window.

Geoff_D
 
Last edited:
Messages
10
Country
unitedstates
One more programming issue.. hopefully the last!

Well, I have found a way around my other panel needs, but have one final modification to make. It is a fairly easy fix, but I can't quite find the right string of code to make it work. What I am trying to do is run a select case command to determine a certain nav frequency and set its corresponding tacan frequency. I have gotten a little of it to work, but the problem I am having seems to be in frequencies that don't end in .00 (ex: 114.45). I was able to make the switch from 117.0 to 117X but that's about it. Attached is a copy of my code, that hopefully someone will see the error and give me a hand.

<Gauge Name="Tacan" Version="1.0">
__<Image Name="VOR_Freq.bmp" />
__<Element>
____<Select>
_______<Value>(A:NAV ACTIVE FREQUENCY:2, MHz)</Value>
_______<Case Value="111.90">
__________<Image Name="OBS_Course.bmp" />
_______</Case>
____</Select>
__</Element>
</Gauge>

Thanks a bunch for everyone that has helped me out on all my other programming difficulties.

Matt

Edit: The problem I keep running into is that when the select string is set to a whole number (117.00) then when the frequency is anywhere from .5 under to .45 over (116.50 to 117.45) the code runs. There seems to be a number rounding that is occuring that I don't want to happen.
 
Last edited:
Messages
497
Country
unitedstates
Well, I have found a way around my other panel needs, but have one final modification to make. It is a fairly easy fix, but I can't quite find the right string of code to make it work. What I am trying to do is run a select case command to determine a certain nav frequency and set its corresponding tacan frequency. I have gotten a little of it to work, but the problem I am having seems to be in frequencies that don't end in .00 (ex: 114.45). I was able to make the switch from 117.0 to 117X but that's about it. Attached is a copy of my code, that hopefully someone will see the error and give me a hand.

<Gauge Name="Tacan" Version="1.0">
__<Image Name="VOR_Freq.bmp" />
__<Element>
____<Select>
_______<Value>(A:NAV ACTIVE FREQUENCY:2, MHz)</Value>
_______<Case Value="111.90">
__________<Image Name="OBS_Course.bmp" />
_______</Case>
____</Select>
__</Element>
</Gauge>

Thanks a bunch for everyone that has helped me out on all my other programming difficulties.

Matt

Edit: The problem I keep running into is that when the select string is set to a whole number (117.00) then when the frequency is anywhere from .5 under to .45 over (116.50 to 117.45) the code runs. There seems to be a number rounding that is occuring that I don't want to happen.

I don't know the answer here, but you might want to think about if you are comparing a STRING or FLOAT ?

If the VALUE is a string, is it "116.5" "116.50" or "116.500" ?

If you are dealing with COM frequencies , that are typically displayed to 2 DP, is the VALUE really to 3 DP.

ie 121.92 or 121.925

Maybe, force Value to a FLAOT with 2 Decimal Places

_______<Value>(A:NAV ACTIVE FREQUENCY:2, MHz)%!1.2f!</Value>

and then you will know for sure that you are dealing with a FLOAT with 2 digits after the DP


Geoff_D
 
Messages
10
Country
unitedstates
I don't know the answer here, but you might want to think about if you are comparing a STRING or FLOAT ?

If the VALUE is a string, is it "116.5" "116.50" or "116.500" ?

If you are dealing with COM frequencies , that are typically displayed to 2 DP, is the VALUE really to 3 DP.

ie 121.92 or 121.925

Maybe, force Value to a FLAOT with 2 Decimal Places

_______<Value>(A:NAV ACTIVE FREQUENCY:2, MHz)%!1.2f!</Value>

and then you will know for sure that you are dealing with a FLOAT with 2 digits after the DP


Geoff_D


When I try and put (A:NAV ACTIVE FREQUENCY:2, MHz)%!1.2f! in for the select string, it gives me an error: Empty parens or closing parens missing. When I put in ((A:... )%!1.2f!), the string doesn't work. No errors, but no results where previous actions occurred.

I have also tried it as you would display a frequency... %((A:NAV ACTIVE FREQUENCY:2, MHz))%!1.2f!, but would get the error: Invalid Script (no command is more than 4 characters) message. The string that you gave me should be the correct one to identify the frequencies (117.12, 115.00...) because I use it to display the NAV1 freq elsewhere in my gauge.

What I can't figure out is why the select string doesn't match up with the case string, even though there should be a match.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Try using a scmp (StringCoMPare) function...
Code:
<Value>(A:NAV ACTIVE FREQUENCY:2, MHz) scmp '111.900' == if{ 1 }</Value>
    <Case Value="1">
 
Messages
497
Country
unitedstates
When I try and put (A:NAV ACTIVE FREQUENCY:2, MHz)%!1.2f! in for the select string, it gives me an error: Empty parens or closing parens missing. When I put in ((A:... )%!1.2f!), the string doesn't work. No errors, but no results where previous actions occurred.

I have also tried it as you would display a frequency... %((A:NAV ACTIVE FREQUENCY:2, MHz))%!1.2f!, but would get the error: Invalid Script (no command is more than 4 characters) message. The string that you gave me should be the correct one to identify the frequencies (117.12, 115.00...) because I use it to display the NAV1 freq elsewhere in my gauge.

What I can't figure out is why the select string doesn't match up with the case string, even though there should be a match.

did you try

%((A:NAV ACTIVE FREQUENCY:2, MHz)%!1.2f!)

or is that just plain incorrect ( I am still learning this XML stuff !!)

Geoff_D
 
Messages
10
Country
unitedstates
Try using a scmp (StringCoMPare) function...
Code:
<Value>(A:NAV ACTIVE FREQUENCY:2, MHz) scmp '111.900' == if{ 1 }</Value>
    <Case Value="1">

Tried it, but I don't think the string from the frequency is either formatted like 111.900 (or 111.90... because I tried that format also). Unfortunately, there is no way (or at least I don't know how) to verify that (A:NAV ACTIVE FREQUENCY:2, MHz) is outputting the proper string.

Still in a holding pattern...
Matt
 
Top