Sign in to follow this  
phjvh

Reading Views in XML Gauges

Recommended Posts

The XML tokens used to be able to read which view you were in like 2D panel view or VC view. Seeing how these (and some more) XML tokens don't work any more (In FSX), can anyone suggest a cunning way of reading when in VC view. I basically want to turn off a beacon light in VC. It used to look alright in fs9, but in FSX the flashing over illuminates everything. In fact a lot of my lighting is ####-up in FSX.cheers, and thanks for any help.nick

Share this post


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

Hi Nick.I also have problems with my cockpit sounds because P:ACTIVE VIEW MODE is mising in fsx. For lighting I believe that you can to add 'Properties' section in your fx file and set VirtualCockpit=0. You can see 'Properties' in many default fx.hth,L.

Share this post


Link to post
Share on other sites

Although carefully explained in the SDK, I am reliably informed that the 'Properties' section does not function. cheers,nick :-(

Share this post


Link to post
Share on other sites

It can not be done in XML with FSX.There is a rumor that a future release of SimConnect may provide information regarding the active view... however, since XML doesn't interact with SimConnect I don't think that will help much.

Share this post


Link to post
Share on other sites

>It can not be done in XML with FSX.>>There is a rumor that a future release of SimConnect may>provide information regarding the active view... however,>since XML doesn't interact with SimConnect I don't think that>will help much. Yet another example of the "improvements" made: one step forwards, three steps backwards... :-erks

Share this post


Link to post
Share on other sites

Yes, thanks, I've seen that thread and tried it out. I made an XML gauge top switch off the beacon and placed it in the VC section of the panel.cfg only. It switches off the beacon in any view, in other words, the gauge seemed to be active all the time.cheers,nick

Share this post


Link to post
Share on other sites

Maybe to try with ?This is my last idea. I'm working on simple C gauge for identify when particularly panel is open or closed. I need it to manipulate with panels for front and rear cockpit, and Working fine in fs9. Mmaybe help you in VCockpit, I hope.When you put this gauge to WindowXX in panel.cfg, this will set (L:panel_1,enum) to 1 when panel defined in WindowXX is open and to 0 when closed. May to have more similar gauges for different panels (with unique variable name). "panel_1" and "pnl1_id" are custom variable names, you may name them what you want - I use L:panel_1, L:panel_2, etc. ...double pnl1 = 0 ; // C variableID pnl1_id; // pointer address to the XML variable ... case PANEL_SERVICE_PRE_INITIALIZE: register_named_variable ( "panel_1" ); break; case PANEL_SERVICE_PANEL_OPEN: pnl1_id = check_named_variable("panel_1"); set_named_variable_value ( pnl1_id, 1 ); // "1 (>L:panel_1,enum)" break; case PANEL_SERVICE_PANEL_CLOSE: pnl1_id = check_named_variable("panel_1"); set_named_variable_value ( pnl1_id, 0 ); // "0 (>L:panel_1,enum)" break; ...L.

Share this post


Link to post
Share on other sites

Hi, and thanks for all the useful info.I tried,(A:Light beacon,bool) if{ (>K:TOGGLE_BEACON_LIGHTS) }And placed it in the Vcockpit01 section.It did not work, and did not switch the beacon off. However if I removed the and , then it worked in any view, that is, when you try to switch the light on, it immediately switches off.So the Update commands are doing something, but in effect making the code ineffctive in all views.I'll try and dig out my compiling software and make a C gauge from your code.Interesting stuff,cheers,nick

Share this post


Link to post
Share on other sites

Hi Nick,I guess that code shouldn't work in FS9 as well...(amazing if it does indeed!) because elements won't work if included whithin section. That is, code and then the nest of is the proper coding sequence. Besides, if you put two ... structures in a gauge, only the last one will be processed.Tom

Share this post


Link to post
Share on other sites

Thanks Tom,I tried this,(A:Light beacon,bool) if{ (>K:TOGGLE_BEACON_LIGHTS) }Is this what you meant?When starting the aircraft in 2D view, the beacon can be switched on and off as much as you like.I go to VC view and the beacon has switched off and cannot be switched back on (which is what I want).I go back to 2D view and the beacon lights cannot be switched on again. In 2D view I want to be able to switch the beacon as I like, so it's not quite right.I also tried (similar to the gps_500 gauge's use)(A:Light beacon,bool) if{ (>K:TOGGLE_BEACON_LIGHTS) }This just keeps the beacon light off all the time.cheers,nick

Share this post


Link to post
Share on other sites

Nick,You won't be able to keep the beacon on with this code:(A:Light beacon,bool) if{ (>K:TOGGLE_BEACON_LIGHTS) }because as soon as the light is on (value=1), it will be toggled to off. While it is off (value=0), it does nothing (remains off).If this code is placed in a VC gauge, and you start in 2D, as it has an it is possible that the event won't fire up in FSX, as somebody stated in an earlier thread (I believe it was Rob) so you can manage the beacon as wished as long as you don't switch to VC. Try removing the "Hidden" tag; even so it is still possible that coded Events won't fire at all within an unvisible view mode in FSX...Tom

Share this post


Link to post
Share on other sites

Nick,Does(>K:VIEW_MODE) and(>K:VIEW_MODE_REV) work?In that case one could make a clickspot, icon in 2D and VC for changing vieuws:2D-->VC(>K:VIEW_MODE) (A:Light beacon,bool) if{ (>K:TOGGLE_BEACON_LIGHTS) }VC-->outside(>K:VIEW_MODE) (A:Light beacon,bool) ! if{ (>K:TOGGLE_BEACON_LIGHTS) }VC-->2D(>K:VIEW_MODE_REV) (A:Light beacon,bool) ! if{ (>K:TOGGLE_BEACON_LIGHTS) }Don't go back from outside-->VC!It isn't ideal of course (for the time being no FSX for me)Jan"Beatus ille qui procul negotiis..."

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