net-lisias-ksp / DistantObject

Distant Object Enhancement (DOE) is a visual enhancement mod that makes objects realistically visible over large distances.
Other
11 stars 3 forks source link

Check the blinking lights on planet packs where the $HOME world is reparented. #18

Open Lisias opened 2 years ago

Lisias commented 2 years ago

As explained here by Tangle:

I've been seeing problems (that is, no distant object flares show up at all) with DOE in planet-pack systems where the homeworld is reparented to orbit other planets- is this a known issue, and if so is there any fix? Problem encountered using KSP 1.12.2 and the Whirligig World planet pack, but would likely be replicable in other reparented systems like Alternis Kerbol Rejiggered.

edit: respective KSP.log : KSP.log.zip

Lisias commented 2 years ago

The problem, unsurprisingly, is related to Kerbol being hard coded on DOE:

[EXC 04:50:18.175] Exception: Distant Object -- Unable to find Kerbin's relationship to Kerbol.
    DistantObject.FlareDraw.GenerateBodyFlares () (at <9b673f98181d4f2ab320f3a8099485cd>:0)
    DistantObject.FlareDraw.Awake () (at <9b673f98181d4f2ab320f3a8099485cd>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.GameObject:AddComponent(Type)
    AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
    AddonLoader:StartAddons(Startup)
    AddonLoader:OnLevelLoaded(GameScenes)
    AddonLoader:OnSceneLoaded(Scene, LoadSceneMode)
    UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

The FlareDraw is hard coded to the FlightGlobals data structure that, obviously, is not used on Kopernicus.

I need to rework FlareDraw in the same way I did on the VesselDraw: I need to create "engines" , so an engine to support Kopernicus could be written without compromising rigs that don't use it.