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 9: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?
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Reposition aircraft from nasal space

Postby Thorsten » Sat Dec 16, 2017 10: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: 10693
Joined: Mon Nov 02, 2009 8:33 am

Re: Reposition aircraft from nasal space

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

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

Or are you talking solely about aircraft-specific stuff?
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Reposition aircraft from nasal space

Postby wlbragg » Sun Dec 17, 2017 5: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 1:54 pm, edited 1 time in total.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4754
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Reposition aircraft from nasal space

Postby D-EKEW » Sun Dec 17, 2017 8: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: 161
Joined: Mon Jan 10, 2011 8:22 pm
Callsign: D-EKEW, ELLX-TWR
Version: git
OS: Linux

Re: Reposition aircraft from nasal space

Postby benih » Sun Dec 17, 2017 9: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?
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Reposition aircraft from nasal space

Postby wlbragg » Sun Dec 17, 2017 1: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(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4754
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Reposition aircraft from nasal space

Postby Hooray » Sun Dec 17, 2017 4: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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: Reposition aircraft from nasal space

Postby benih » Thu Dec 21, 2017 4: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...
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am


Return to Nasal

Who is online

Users browsing this forum: No registered users and 0 guests