I am lost in a seemingly simple problem, so please help somebody ...
I dug "views.nas" hundred times from top to bottom to find my way, but fail ...
In an aircraft specific code I want to switch current view to a self defined view. i.e. view[101]
As far as I see, there is no available function in FG to do that ?
So I need the number of the view, which is not the number 101 but the counted number of available view nodes.
How can I get this number ?
What I tried is the following and it fails obviously, but what do I need to add in order to fix it ?
- Code: Select all
var views = nil; # list of all view branches (/sim/view[n]) as props.Node
forindex(i; views) {
if (i.getNode("name") == "Co-Pilot View") {
setprop("/sim/current-view/view-number", i);
exit;
}
}
"Co-Pilot View" ... is the predefined view name in the view definition
101 would be the number assigned to this view
I just can't find how to fill the views vector, or however this is named ?
Thanks
Mike-DE