Board index FlightGear Support Compiling

Set default property "current-view"

Building FlightGear from source, and in the need for help?

Set default property "current-view"

Postby 1ife3.1 » Tue Jun 08, 2021 8:37 pm

Hi all,
please tell me how to set some view, as a default starting view?

In oldest versions FG in file "preferences.xml" it work with:
<current-view>
<view-number type="int">2</view-number>
</current-view>

but in latest version in file "defaults.hml" it doesn't work.
And in menu/settings something like:
"--prop:/sim/current-view/view-number=2" doesn't work too.

I am sorry in advance if this is not the right sub-forum to ask this question. I did some search in the forum but could not find anything.
Thanks!
1ife3.1
 
Posts: 4
Joined: Tue Jun 08, 2021 7:43 pm

Re: Set default property "current-view"

Postby cgdae » Tue Jun 08, 2021 10:27 pm

I think you also need to set /sim/current-view/view-number-raw, e.g.:

<view-number type="int">2</view-number>
<view-number-raw type="int">2</view-number-raw>

On next we install listeners for both of these and each of them sets the other.

The listener for view-number-raw seems to have precedence so actually setting /sim/current-view/view-number-raw alone works for me, but it's probably best to set both to avoid problems.

[view-number-raw should have been named view-number-index, but i didn't understand the property system very well when i created it.]

Hope that helps,

- Jules
cgdae
 
Posts: 117
Joined: Tue May 31, 2016 8:35 pm

Re: Set default property "current-view"

Postby 1ife3.1 » Tue Jun 08, 2021 10:52 pm

Unfortunately, even simultaneously, it doesn't work for me.
But i find the other way - "FlightGear 2020.3\data\Nasal\view.nas".
In file "view.nas" i added a string:
var fdm_init_listener = setlistener("/sim/signals/fdm-initialized", func {
...
setprop("/sim/current-view/view-number", "2"); # <---this one
});
Im sooo happy now:)
Thanks!
1ife3.1
 
Posts: 4
Joined: Tue Jun 08, 2021 7:43 pm


Return to Compiling

Who is online

Users browsing this forum: No registered users and 3 guests