plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

f99mlu avatar image
f99mlu asked Mr_LiamT commented

RequestTeleportAction works partly

After using RequestTeleportAction to with a correctly set altitude, the plane spawns at the correct position but not the correct altitude.. Also, the plane comes crashing down.

bugmission
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

BuffyGC avatar image
BuffyGC answered

I can confirm this issue to for BushTripInjector.

RequestTeleportAction is working for 0.5 seconds, then the plane falls to ground immediately and crashes (if no-crash-mode is off). If no-crash-mode is on, the plane is on correct lat/lon, but grounded. Also speed and powersettings are ignored.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

SonantAlpaca avatar image
SonantAlpaca answered

Hello,

The developer behind missions design is out of the office at the moment. I'll make sure he takes a look at this when he gets back!

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FunkyUnc avatar image
FunkyUnc answered

@SonantAlpaca - Any update from the developer on this one as well. Thanks!

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FunkyUnc avatar image
FunkyUnc answered

This is still broken in SU7. Any news from the developer behind missions design?

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Mr_LiamT avatar image
Mr_LiamT answered Mr_LiamT commented

For the RequestTeleportAction to work properly you need to specify a SimState file, which is just an .FLT file that defines state of the aircraft after the teleport. Variables you don't define in the SimState file will be filled in from the last used .FLT, usually the .FLT that loaded the flight. This means that after teleport, things like lights, flaps, and crucially simvars, will be reset to the state at the start of the flight.

The simvars contain the coordinates, altitude, orientation, speeds, and a variable called SimOnGround:

[SimVars.0]
Latitude=N37° 57' 15.09"
Longitude=W107° 54' 7.20"
Altitude=+015009.81
Pitch=-1.7961822304756200896
Bank=0
Heading=67.595765396585463236
PVelBodyAxis=0
BVelBodyAxis=0
HVelBodyAxis=0
XVelBodyAxis=-8.3283299715813328135
YVelBodyAxis=-12.848052061414350078
ZVelBodyAxis=465.00570101166533732
SimOnGround=False
OnPlatformHeight=-9999999999

The coordinates, altitude, and orientation can be defined by the RequestTeleportAction, but the speeds and SimOnGround will be reset to the start. So if the flight started on the ground and the teleport was in the air, SimOnGround will be reset to True, and the plane will be put on the ground immediately after teleport.


To fix this, you should use a SimStateFile. This is the configuration that worked for me:

        <SimMission.RequestTeleportAction InstanceId="{858FF2F5-D5DA-42D6-BB25-0DADB7204774}">
            <SimStateFilename>offground</SimStateFilename>
            <AttachedWorldPosition>
                <WorldPosition>N41° 1' 52.45",W113° 44' 27.00",+007000.00</WorldPosition>
                <AltitudeIsAGL>False</AltitudeIsAGL>
                <Orientation>0.000,0.000,145.000</Orientation>
                <IsOnGround>False</IsOnGround>
            </AttachedWorldPosition>
        </SimMission.RequestTeleportAction>

offground.FLT:

[SimVars.0]
SimOnGround=False
XVelBodyAxis=0
YVelBodyAxis=0
ZVelBodyAxis=200.000

This will make sure the plane doesn't teleport to the ground and has forward speed, but still reset things changed after spawn such as flaps, gear, and lights, but you can add them to the .FLT as well.


I don't think this is the best way for the teleport to work. I think it would be better it the RequestTeleportAction didn't reset variables to the state at the start, but kept them the same as immediately before the teleport.


PS: You can specify Airspeed in the RequestTeleportAction, but it didn't work properly in my experience.

2 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

BuffyGC avatar image BuffyGC commented ·
Nice finding. I'm wondering if this will work with multi-leg bush trips, too. Or did we run in the same issue as with soundfiles.

MSFS is searching them only in the saved_missions folders and not in the base folder of the trip.

0 Likes 0 ·
Mr_LiamT avatar image Mr_LiamT BuffyGC commented ·

Maybe you can try putting the .FLT in a folder called SimStates, like the official missions do (e.g. the power settings tutorial). Then reference them like SimStates\TheFTLName in the script.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.