• 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.

FSXA Camera views and XML

Roy Holmes

Resource contributor
Messages
1,805
Country
us-virginia
I have built a recce aircraft where I can cycle VC views from left camera to forward view to nose camera to right camera. I'm doing this with a hat on the stick and it works fine.

At the bottom of the view I have a pop-up strip that shows present position, time to go to target and distance to target. When I take a screen shot this data is visible, but when looking at the shot afterwards it is not clear which camera was selected.

What I would like to be able to do is add a string to the strip that says which view is selected, but while there a zillion of Event ID's for views, I see no Vars for views. If I could do that I could add data showing the direction of view of the camera.

Is there a way to capture the last view selection and, if possible, where it is pointed from the specified direction due to panning with the stick hat buttons.

Roy
 
How about capturing the event with, for example, <On Event="PAN_LEFT">, and assigning a Local Var value to each one?

Tom
 
Tom,
What I'm doing is cycling through four cameras in category cockpit, so I'm not actually panning as such. I guess I'm using the equivalent of NEXT_SUB_VIEW and PREV_SUB_VIEW, so I could try to capture those events. The camera in use is indicated in red, at the top right of the view, by its title eg "Camera Right" for a short time after selection, but I know of no way to keep it there.

I could probably make the VC forward view a starting point, then trap changes from that in some kind of initialisation code.

Thanks for the input,
Roy
 
Roy,

You could use Doug's Event Logger gauge to detect which events are fired when cycling camera view, if any is actually fired at all.

Tom
 
Tom,
What I'm doing is cycling through four cameras in category cockpit, so I'm not actually panning as such. I guess I'm using the equivalent of NEXT_SUB_VIEW and PREV_SUB_VIEW, so I could try to capture those events. The camera in use is indicated in red, at the top right of the view, by its title eg "Camera Right" for a short time after selection, but I know of no way to keep it there.

I could probably make the VC forward view a starting point, then trap changes from that in some kind of initialisation code.

Thanks for the input,
Roy

This might do it for you. Let me know.
www.douglassdawson.ca/files/dsd_window_strings.zip

Doug
 
Tom and Doug,
Thanks for the ideas.
I have it working now
Code:
<Element>
	<Visible>(L:View,enum) -1 ==</Visible>
		<Element>
			<Position X="550" Y="0"/>
				<Text X="90" Y="8" Length="13" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Top" Bright="Yes">
				<String>Camera Left</String>
			</Text>
		</Element>
	</Element>
	<Element>
	<Visible>(L:View,enum) 1 ==</Visible>
		<Element>
			<Position X="550" Y="0"/>
				<Text X="90" Y="8" Length="13" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Top" Bright="Yes">
				<String>Camera Nose</String>
			</Text>
		</Element>
	</Element>
	<Element>
	<Visible>(L:View,enum) 2 ==</Visible>
		<Element>
			<Position X="550" Y="0"/>
				<Text X="90" Y="8" Length="13" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Top" Bright="Yes">
				<String>Camera Right</String>
			</Text>
		</Element>
	</Element>
	<Keys>
		<On Event="NEXT_SUB_VIEW">1 (>L:ViewChange,enum) (L:View,enum) (L:ViewChange, enum) + (>L:View,enum)</On>
		<On Event="PREV_SUB_VIEW">-1 (>L:ViewChange,enum) (L:View,enum) (L:ViewChange,enum) + (>L:View,enum)</On>
		<On Event="EYEPOINT_RESET">0 (>L:View,enum)</On>
	</Keys>

NEXT_SUB_VIEW from the VC forward view gives me the Nose camera, then the Right camera. Visually it moves views to the right
PREV_SUB_VIEW does the opposite and moves views left
EYEPOINT_RESET puts me back to the forward VC view and zeros the enum

The appropriate camera name is written on the strip by the rather inelegant three blocks of code. Nothing is written when in the VC forward view. I feel certain that one clever string format could do it, but I chose three blocks for simplicity. I also put the "visible" code in an outer element with the string in an inner element so it would always show. Tom thanks for that insight in a recent thread.

The camera sequence is contained in the aircraft.config file for example:
[CameraDefinition.4]
Title = "Camera Left"

[CameraDefinition.5]
Title = "Camera Nose"

[CameraDefinition.6]
Title = "Camera Right"

Which means that if I have Camera left selected and do a NEXT_SUB_VIEW, it goes to VC, then Nose, then right. If I then do another NEXT_SUB_VIEW, it selects camera left. The way I have the code written the enum would be 3 and no name shows. I'm OK with that, but I suppose I could use max or min to set the enum to -1.

Would appreciate comments

Roy
 
Roy,

You can simplify the code by writing something like:

Code:
<Element>
     <Position X="550" Y="0"/>
	 <Text X="90" Y="8" Length="13" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Top" Bright="Yes">
 	   <String>%( 2 1 0 -1 4 (L:View,enum) 1 + 'Camera Right' 'Camera Nose' ' ' 'Camera Left')%!s!</String>
	</Text>
</Element>

Tom
 
Tom,
Thanks.
As written, that gives me a permanent "Camera Left" for all views and values of (L:View,enum)

I'll try some changes and see what happens. It certainly is a lot more simple.

Roy
 
Last edited:
Code:
<String>%( 2 1 0 -1 4 (L:View,enum) 1 + 'Camera Right' 'Camera Nose' ' ' 'Camera Left')%!s!</String>

Hi Tom,

As far as I know, this is the first time I have ever seen such string syntax. Would you kindly explain it a bit more?.

Many thanks,

Bob
 
Hi Tom,

As far as I know, this is the first time I have ever seen such string syntax. Would you kindly explain it a bit more?.

Many thanks,

Bob

Oops! I forgot to write the case operator:eek: Please forgive my distraction Roy, :o and add it to the script. And thank you Bob for pointing it out:)

Tom
 
Tom,
Could you edit the post with case included. Since it is a string I'm not sure where case should go

Thanks
Roy
 
Roy,

Of course:

Code:
<String>%('Camera Right' 'Camera Nose' ' ' 'Camera Left' 4 (L:View,enum) 1 + case)%!s!</String>

Before I started writing the expected values for (L:View,enum) and the proper sentences to show as a pnemonic, but forgot to translate that to a valid case:eek:

Tom
 
Back
Top