Jump to content

The official unoffical "help a fellow plugin developer" thread


Recommended Posts

1 hour ago, royying said:

I want to know how to detect what DLC is installed

To check a specific expansion you’ll want the ExpansionsLoader static method IsExpansionInstalled.

Expansions.ExpansionsLoader.IsExpansionInstalled(string name)

The string to check is the same as the folder name in GameData/SquadExpansions. “MakingHistory” and “Serenity” (Breaking Ground). 

There are similar methods under that same class to check if any expansions are installed or to check a list if you need more than one. 

Link to post
Share on other sites
5 hours ago, royying said:

quickly reload a dll file for testing

Not really possible in general, I've seen some half baked attempts at this but they all mess up under some circumstances, the fundamental problem is that there may be instances of objects from the old DLL still present, and there's no way to guarantee that they can be converted to new objects.

I recommend creating a minimal test install so that the reloads are less time consuming.  You might even consider removing some parts of GameData/Squad if you want really fast startup.

Link to post
Share on other sites

Vessel.patchedConicSolver is a PatchedConicSolver, the patches property of which is a list of 150 Orbit objects reflecting the vessel's current orbit, as well as any future SOI transitions it will make on its current trajectory. The "real" orbits are at the start of the list, and most of the subsequent objects just have all their internal pointers set to null (presumably this was done for performance, to avoid re-allocating the list).

Vessel.patchedConicRenderer is a PatchedConicRenderer, the patchRenders property of which is a list containing one PatchRendering object for each orbit in PatchedConicSolver.patches (including the nulled-out ones). The structure here is clear enough: the solver holds the data, the renderer draws it.

PatchedConicSolver.flightPlan is just like the patches property but for the hypothetical "dotted line" orbits generated by maneuver nodes. Orbits are added to and removed from this list as you create and delete maneuver nodes.

PatchedConicRenderer.flightPlanRenders looks like it would be parallel to the patchRenders property, with objects for drawing the orbits in the flight plan, but here the symmetry breaks down; it's always empty.

Does anybody know where the objects to render flight plans live?

EDIT: Maybe these are leftover cruft from a previous design? Continuing to expore the API, I see Orbit.DrawOrbit, which might make an orbit rendering class unnecessary if it does what it says on the tin.

Edited by HebaruSan
Link to post
Share on other sites

How can I work inertially in a rotating reference frame? Is there a sane way to convert between the rotating frame near a planet and the inertial frame above it? How do I even tell whether the present reference frame is inertial or rotating?

For context: I'm trying to operate on things stored as orbital elements, and I want them to interact with worldspace in a sensible and consistent way. I'd like to keep it all inertial.

Link to post
Share on other sites

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...