Jump to content

What event can be used to know when a vessel is landed?


Recommended Posts

Subject says it.  There doesn't seem to be a good event to use.  I've found the following:

 

 

This event is called by FlightGlobals when a vessel is changed in any way:

     EventData<Vessel> GameEvents.onVesselStandardModification = new EventData<Vessel>("onVesselStandardModification")

 

I also found this, and was excited about it for a moment, but it seems to only be for contracts:

void Contracts.Parameters.LandOnBody.OnVesselLand(Vessel vessel, CelestialBody body)

 

 

I have something implemented, but it isn't detecting bounces all the time.

Ideas?

 

Or, is this the only way:

if (vessel.LandedOrSplashed)

 

Edited by linuxgurugamer
Link to comment
Share on other sites

22 minutes ago, linuxgurugamer said:

Or, is this the only way:

if (vessel.LandedOrSplashed)

That was the only way that I could find when working on KSPWheel landed detection and updating.

Stock code updates that field every game tick, so it should be up to date for the current status.  I'm unaware of any events that are triggered when it changes state.

Link to comment
Share on other sites

19 minutes ago, Shadowmage said:

That was the only way that I could find when working on KSPWheel landed detection and updating.

Stock code updates that field every game tick, so it should be up to date for the current status.  I'm unaware of any events that are triggered when it changes state.

ok, thanks.  I'll just have to check it myself.

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...