May 26, 200719 yr Never managed to control the Bright/Luminous flags successfully using macros in XML. I know this is an old issue but I could not find any post related to it. So here goes:A plain 1 or 0 works, like this:1but not this:%('1' '0' 2 (L:SWITCH,enum) case)Why? /Tom
May 26, 200719 yr Moderator >Never managed to control the Bright/Luminous flags>successfully using macros in XML. I know this is an old issue>but I could not find any post related to it. So here goes:>>>>A plain 1 or 0 works, like this:>1>>but not this:>%('1' '0' 2 (L:SWITCH,enum) case)Remove the single quote marks... :)(Macro Name="Lit">1 0 2 (L:SWITCH,enum) case) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 26, 200719 yr Author Hi,See:http://forums.avsim.net/dcboard.php?az=sho...ing_type=searchJan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
May 27, 200719 yr Bill: Sorry, that won't fly. :( First thing I tried. I believe the value must be a boolean, and any sort of operation in the macro makes it a float? Would be easier in C I think. The reason I tried with a string macro btw was that it works with Color/FillColor attribs. Jan: That method is what I have been using for years now, it works fine but is cumbersome for large gauges with dozens of bitmaps. I need to toggle the bright flag when I change bitmaps, so a macro just for bitmap names is not enough. Thanks a bunch anyway!/Tom
May 27, 200719 yr Moderator >Bill: Sorry, that won't fly. :( First thing I tried. I>believe the value must be a boolean, and any sort of operation>in the macro makes it a float? Would be easier in C I think. >The reason I tried with a string macro btw was that it works>with Color/FillColor attribs.That is a bit odd, isn't it? Have you tried using "bool" as the type rather than "enum"? How about actual strings? I'm just batting some suggestions here. I'm in the middle of working on an FSX XML gauge, and the syntax is completely different, so I can't really test these myself at the moment... ;)(Macro Name="Lit">'True' 'False' 2 (L:SWITCH,string) case) If you think this is challenging, wait 'till you get to FSX XML gauges with alternate _night bitmaps (which fortunately, work automatically!) which present some rather "interesting challenges" with regards to getting the 2d and VC panel lighting balanced! Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 27, 200719 yr Thanks Bill, I will follow your suggestions and experiment.The FSX SDK actually scared the living daylights out of me. I have to reconsider if I really have time for all this... Maybe it's time to hand this bloody aircraft (Saab 35) over to people with more brain cells left. ;) Cheers /Tom
May 28, 200719 yr Tom,"Bright" property doesn't accept stack evaluation or coditionals.as it happens with almost all of the structures' properties (there are a bunch of exceptions)So, for example, Bright="@Lit" will work using only these kind of macros:1YesHope this helps.Tom
May 28, 200719 yr Moderator >So, for example, Bright="@Lit" will work using only these kind>of macros:>>1>Yes...which is - of course - completely useless... ;)What I've had to do is essentially clone all of the completed "lighted" and change their Bright flags to zero, then encapsulate both non-lighted and lighted as children of their controlling "Parents..." ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 28, 200719 yr >...which is - of course - completely useless... ;)>You bet...:-hmmm >What I've had to do is essentially clone all of the completed>"lighted" and change their Bright flags to zero,>then encapsulate both non-lighted and lighted as children of>their controlling "Parents..." ;)...using in a single element, that's the way to switch between lighted-non lighted bitmaps IMHO. :-)Tom
May 28, 200719 yr Author Hi,Like:(L:capt instr bus AC volts,number) 100 > (L:panellights,bool) 2 * [email protected]"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
May 28, 200719 yr ..or better :-)(L:capt instr bus AC volts,number) 100 > (L:panellights,bool) 2 * +@powerPity this wouldn't work in FSX as is...(I think)Tom
May 29, 200719 yr Author Hi,That is a good one, but doesn't work when eg.:@power@current if{ (A:Indicated Altitude,feet) s3 100000 + 100000 % 10000 / flr s0 l3 100000 + 10000 % s1 9980 >= if{ l1 100 % 80 - 20 / } els{ 0 } l0 + } els{ 0 } Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
May 29, 200719 yr Try putting the nonlinearity table inside the SHIFT statement instead. Works for me./Tom
May 29, 200719 yr Hi Jan, why is that? it should work with:@power@current if{ (A:Indicated Altitude,feet) s3 100000 + 100000 % 10000 / flr s0 l3 100000 + 10000 % s1 9980 >= if{ l1 100 % 80 - 20 / } els{ 0 } l0 + } els{ 0 } Tom
May 29, 200719 yr Author Tom,That is new for me and certainly worth a try.Much more efficient and may be fps...?Thanks!Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
Create an account or sign in to comment