Board index FlightGear Development Nasal

Reposition aircraft from nasal space

Nasal is the scripting language of FlightGear.

Reposition aircraft from nasal space

Postby benih » Sat Dec 16, 2017 10:30 am

Hello,
i'm thinking about a new aircraft feature where the plane initializes at the position where the simulator was shut down the last time.
How can i reposition the aircraft in nasal?
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Reposition aircraft from nasal space

Postby Thorsten » Sat Dec 16, 2017 11:13 am

By writing the position properties basically.

Whether that's a good idea is a different question, because this will probably break quite a few things dependent on how far the teleport is done.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Reposition aircraft from nasal space

Postby benih » Sat Dec 16, 2017 1:31 pm

What is usually broken when teleporting?
What do i need to think about?

Or are you talking solely about aircraft-specific stuff?
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Reposition aircraft from nasal space

Postby wlbragg » Sun Dec 17, 2017 6:09 am

Look at the AirCrane (development version) and also commented out in the J3Cub are implementations of exactly what your talking about. Like Thorsten stated, it can be very buggy. Make sure you have a way to shut it off even after a failed loading as that can and more than likely will happen. If the ground your trying to start up on is not level, that is all it takes to break it. If you are trying to start up over water, that wont work. Be cautious if your planning on allowing normal users access to it. i shut it off in the fgaddon J3Cub because it was too dangerous and unpredictable. I leave it available in the development version of the AirCrane. You can cause an instance where it crashes upon startup and puts you in an infinite crash state upon startup requiring a code revision to get out of it.

The AirCrane has a GUI choice to allow you to shut it down if you end up in an infinite crashed startup state.
Last edited by wlbragg on Sun Dec 17, 2017 2:54 pm, edited 1 time in total.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Reposition aircraft from nasal space

Postby D-EKEW » Sun Dec 17, 2017 9:21 am

If you need an other example how it _can_ be done, find the Extra500 repo on github and look for commit 2a434dd6 (about 3 months ago) in the 'next' branch.
It is a bit awkward as you need to activate it before you leave FG.

Eric
D-EKEW
 
Posts: 174
Joined: Mon Jan 10, 2011 9:22 pm
Callsign: D-EKEW, ELLX-TWR
Version: git
OS: Linux

Re: Reposition aircraft from nasal space

Postby benih » Sun Dec 17, 2017 10:55 am

Thank you, but that sounds not too good. Is there a way to detect the current positions ground level and slope degree? Woukd i be a solution to init the position slightly above the ground, depending in slope?
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Reposition aircraft from nasal space

Postby wlbragg » Sun Dec 17, 2017 2:58 pm

Ground elevation yes, slope I'm not sure of. You could check the pitch and roll of the aircraft and not allow a save unless it is in a level attitude. There may be other quirks I haven't stumbled onto yet.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Reposition aircraft from nasal space

Postby Hooray » Sun Dec 17, 2017 5:51 pm

Regarding the slope question, search the forum for "ridge lift" - which was originally using a Nasal-based way to compute the slope for coming up with plausible ridge lift.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Reposition aircraft from nasal space

Postby benih » Thu Dec 21, 2017 5:16 pm

I try to view into the code.
Another option that came to my mind could be to get geo objects for the three wheels and so be able to get the elevation below it. From that i could calculate pitch/yaw and initialize this very precise...
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit


Return to Nasal

Who is online

Users browsing this forum: No registered users and 3 guests