Sign in to follow this  
taguilo

More questions about vars, textures and tooltips

Recommended Posts

Hi all,I'm working on a set of panels for multi-monitor use. Here, for example is a shot of one for the Cessna Grand Caravan (still very much "work in progress"):http://www.mikesteven.pwp.blueyonder.co.uk...essna_GC_01.jpgMy intention is to make panels for all the default single engine a/c using the same layout, so that those using a cover in front of their monitor with holes cut out for the instruments will be able to swap planes without having to also swap covers. I've more or less got everything working now (thanks partly to some help from you guys in my earlier thread), but there are a few more things I couldn't find in the SDK docs which I'd really appreciate some help with:1. I can't find any vars related to failures of any radios other than Com 1 & 2, so atm all my radios are tied to COM STATUS:1 - if it fails they all fail. Does anyone know the equivalent vars for Nav 1/2, ADF, transponder etc?2. Is there an event for toggling carb heat only? (I found ANTI_ICE_TOGGLE, but that also toggles prop heat and structural heat).3. The docs mention a font called "Digital" which is used for the default radio stack but it doesn't exist in my FSX fonts folder so I've been using "Quartz" which is similar. Does anyone know where the Digital font is hidden?4. I've been using 24 bit bitmaps for my textures during development which seem to work fine, though FSX appears to do some kind of conversion on them automatically to a lower quality. The docs say textures should be converted to 8 bit colour depth but I seem to remember reading somewhere that Acceleration has problems with older textures (8 bit ones?). What's the best format to use in terms of quality/efficiency?5. I've made some modifications to some of the default FSX gauges I'm using in my panels. For example, I've made a version of the GPS which only displays the unit's screen without any of the surrounding buttons etc. Less drastically, I've moved the position of the course and heading knobs on the HSI in the shot above. To do this I copied the files the gauges use to my own custom gauge folder and modified them there (to avoid any problems which editing the originals might have caused). When it comes to distribution I obviously don't want to needlessly include duplicates of all the files which haven't changed so is there some way to have my modified gauge refer to the textures in their original location or do the bitmaps and my new xml file all have to be in the same folder/cab file?6. If I make a gauge which starts with "" then I can use something like the following:Engine Failure Light...to specify a custom tooltip. However, for gauges which begin with "0.000,0.00028,32NormalTOOLTIPTEXT_NAV_DISPLAY..but that only seems to let me use the predefined tooltips. What's the correct syntax for a custom one?Many thanks,DD

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I forgot one more:7. What's the correct syntax for using the value of one variable as an index for another? For example, I'm using (A:NAV DME:x, Nautical miles) where I want x to be the value of (A:SELECTED DME, number). I've tried:(A:NAV DME:(A:SELECTED DME, number), Nautical miles)..and several variants, without success. (I've managed to work round this by using a load of conditional statements, but it would simplify things considerably if I could use something like the above).Cheers,DD

Share this post


Link to post
Share on other sites

Hi,It's not possible to use that syntax. Var names only accept a direct reference or a macro replacement whitin its descriptor.Plain text example (A:NAV DME:1, Nautical miles)(A:NAV DME:2, Nautical miles)Macro Example(A:NAV DME:@1, Nautical miles)(A:NAV DME:@1, Nautical miles)(You might search "macro" within this forum to learn about how they work)Tom

Share this post


Link to post
Share on other sites

As far as I've been able to discover, using the FSX XML schema doesn't allow for "custom tooltips" any longer... :(At least, I've never managed to get any combination of things to work!

Share this post


Link to post
Share on other sites

Tom, thanks for the tip -following your suggestion, I tried:1...and then (A:NAV DME:@SELDME, Nautical miles) gives me the value of NAV DME:1. So far so good, but when I change the MacroValue to a variable like this:(A:SELECTED DME, number)...then (A:NAV DME:@SELDME, Nautical miles) no longer gives me the value of NAV DME:1 even when (A:SELECTED DME, number) is equal to 1. Not sure what I'm doing wrong here - I had a look at the macros bit of the SDK docs and tbh it's about as much use as a chocolate teapot. I also found some examples of macros on the forum which are using vars in the "MacroValue" line but I can't see why they work but the above doesn't.Bill, that's weird but it certainly ties in with my experience -I tried all sorts of custom tooltip syntax variants without success. The whole idea of having a list of default tooltips seem pretty pointless to me when all that's needed is the ability to write your own. If this functionality no longer exists at all it's a pretty major oversight by MS imho.Cheers,DD

Share this post


Link to post
Share on other sites

DD,A macro structure is nothing more than a literal replacement of text.So, in your example, the dll parser reads,(A:NAV DME:@SELDME, Nautical miles) it detects @SELDME as a macro identifier that must exists in the previous code. Then it finds its value is 1:1and therefore makes the proper replacement of @SELDME with 1 in the executing code:(A:NAV DME:1, Nautical miles) Now, figure what happens when the macro contains this:(A:SELECTED DME, number)The parser replaces @SELDME with (A:SELECTED DME, number), giving(A:NAV DME:(A:SELECTED DME, number), Nautical miles)which is precisely what you were trying to achieve in your previous post, and of course is an invalid expression.Macros are very useful in order to save repetitive code and also very powerful when dealing with complex syntax, but require a bit of practice and good understanding to make an efficient use of them within a gauge.Tom

Share this post


Link to post
Share on other sites

I'm not sure if you ever actually got the solution to your DME question, but this should work for what you're trying to do while still avoiding unnecessary conditionals.(A:NAV DME:2, nmiles) (A:NAV DME:1, nmiles) (A:SELECTED DME, enum) 2 == ? If the selected DME is 2, it will choose the top (former) value, otherwise it will choose the latter. Of course this only works for 2 possible values.If you had a series of values you needed to check, you could use the case structure:(A:NAV DME:3, nmiles) (A:NAV DME:2, nmiles) (A:NAV DME:1, nmiles) 3 (A:SELECTED DME, enum) 1 - casecase is limited to a linear series between 0 and 23 (possibly 24), so the value you're checking against must conform to that (hence the 1 -).--Jon

Share this post


Link to post
Share on other sites

Many thanks for the further tips guys -I understand macros a little better now. One more question on the subject: Is it possible to assign different values to a macro depending on the value of a variable? e.g. something along the lines of the following pseudocode:IF (A:SELECTED DME, number) = 2 THEN macrovalue = 2 ELSE macrovalue =1As to the other questions I was asking, I've stumbled upon a few of the answers myself -here they are in case they're of use to anyone else:1. Failure variables for the adf, nav1, nav2 and transponder radios are (A:PARTIAL PANEL ADF:1,enum), (A:PARTIAL PANEL NAV:1,enum), (A:PARTIAL PANEL NAV:2,enum) and (A:PARTIAL PANEL TRANSPONDER:1,enum) respectively.2. To toggle only carb heat without structural or prop heat use ANTI_ICE_TOGGLE_ENG1.6. In order to create a custom tooltip using the new syntax use the following:Insert your custom text hereSo the only outstanding questions I have now are:3. The docs mention a font called "Digital" which is used for the default radio stack but it doesn't exist in my FSX fonts folder so I've been using "Quartz" which is similar. Does anyone know where the Digital font is hidden?4. I've been using 24 bit bitmaps for my textures during development which seem to work fine, though FSX appears to do some kind of conversion on them automatically to a lower quality. The docs say textures should be converted to 8 bit colour depth but I seem to remember reading somewhere that Acceleration has problems with older textures (8 bit ones?). What's the best format to use in terms of quality/efficiency? and what program/settings to you guys use for conversion? (I've experimented with Photoshop with less than satisfactory results).5. I've made some modifications to some of the default FSX gauges I'm using in my panels. For example, I've made a version of the GPS which only displays the unit's screen without any of the surrounding buttons etc. Less drastically, I've moved the position of the course and heading knobs on the HSI in the shot above. To do this I copied the files the gauges use to my own custom gauge folder and modified them there (to avoid any problems which editing the originals might have caused). When it comes to distribution I obviously don't want to needlessly include duplicates of all the files which haven't changed so is there some way to have my modified gauge refer to the textures in their original location or do the bitmaps and my new xml file all have to be in the same folder/cab file?Anyone fancy taking a stab at any of these?Cheers,DD

Share this post


Link to post
Share on other sites

Thanks for the "cure" for the custom tooltips... That is a great find!All bitmap resources must be in the same folder/cab file.All the "Partial Panel" failure tokens are listed in the SDK:(A:PARTIAL PANEL ADF,enum) Gauge fail flag (0 = ok, 1 = fail, 2 = blank)(A:PARTIAL PANEL TRANSPONDER,enum) Gauge fail flag (0 = ok, 1 = fail, 2 = blank)

Share this post


Link to post
Share on other sites

Hi Bill,Just edited the bit about the adf and transponder as you were typing - it seems the reason they hadn't worked for me was that I didn't include an index (the only ref I found to them didn't mention one). Now that I've added an index my radios are now working fine, or rather not working when they shouldn't :).Cheers,DD

Share this post


Link to post
Share on other sites

"Thanks for the "cure" for the custom tooltips... That is a great find!" doesn't exists in propgauge.xml, not even in SP1.I guess it must come with Acceleration?, if so then it will be included in SP2 for sure. I'm from the ones who'll have to wait...hope not so much.Tom

Share this post


Link to post
Share on other sites

"IF (A:SELECTED DME, number) = 2 THEN macrovalue = 2 ELSE macrovalue =1"You can code something like(A:SELECTED DME, number) 2 == if{ @Macro1 } els{ @Macro2 }Is this what you were thinking?Tom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this