Jump to content

[1.6] Davon Throttle Control systems mod [v088]


PrivateFlip

Recommended Posts

Thanks for the reply. I will read it and go through it once I am able to in game. For now I will say, thanks for the pointer about the sync button. I thought that pressing said button would only ensure that the throttle group picked would be propagated to the other engines. Being able to make changes to other aspects of an engine and get them pushed out to the rest of the engines of that type sounds like something very handy.

Link to comment
Share on other sites

I can confirm this behaviour.

Situation:
I have 3 different engine types. I set each engine type to a different throttle. I set each throttle to its lowest setting. I have all 3 engines deactivated. TC is active, ie I can see a pop up for TC and an entry in the info for each engine which tells me which throttle group that engine belongs to. I have the throttle as seen in the navball set to zero (press x).
At this point I have zero thrust. This is expected and is due to all engines being deactivated.

I click deactivate module.
At this point the pop ups for TC vanish, as do the entries in the engines info. Thrust is zero.
I activate engine group, in this case engine group 2. I have thrust despite navball thrust still set to zero.

I click on the TC button. Again I see a pop up window for TC and entries reappear in engines infos. Thrust vanishes.

I have to set the throttle group to zero for the engines to behave as expected once TC is deactivated.

KSP 1.4.4.2215. DAVON 087.

Link to comment
Share on other sites

  • 1 month later...

I have a question about engines. I see engines with MODULE { name = MultiModeEngine } which have primary and secondary EngineIDs'. Those EngineIDs' appear in MODULE { name = ModuleEnginesFX }. For example:

Spoiler

        MODULE
        {
            name = MultiModeEngine
            primaryEngineID = AirBreathing
            secondaryEngineID = ElectricalDrive
            primaryEngineModeDisplayName = Air Breathing
            secondaryEngineModeDisplayName = Electrical Drive
        }
        MODULE
        {
            name = ModuleEnginesFX
            engineID = AirBreathing
// snip
        }
        MODULE
        {
            name = ModuleEnginesFX
            engineID = ElectricalDrive
// snip
        }

I also see in the source code tests for both ModuleEngines and ModuleEnginesFX. For example:

Spoiler

                    if (pm is ModuleEngines || pm is ModuleEnginesFX)
                    {
// snip
                   }

However I see that only ModuleEngines are interacted with after such tests. For example:

Spoiler

                    //check if SRB
                    if (pm is ModuleEngines || pm is ModuleEnginesFX)
                    {
                        ModuleEngines cModuleEngines;
                        cModuleEngines = (ModuleEngines)pm;
                        if (cModuleEngines.throttleLocked == false) { couldadd = true; };
                    }
                    ////check if SRB
                    //if (pm is ModuleEnginesFX)
                    //{
                    //    cModuleEngines = p.Modules.OfType<ModuleEnginesFX>().FirstOrDefault();
                    //    if (cModuleEngines.throttleLocked == false) { couldadd = true; };
                    //}

I am curious therefore how this mod works with multimode engines that are only described in terms of ModuleEnginesFX, that is to say, if the engine has no ModuleEngines in its definition?

If I examine my modulemanager.configcache I can see that the engine as used in game still has no ModuleEngines but does have ModuleEnginesFX.

I ask because I am trying to track down why a dual mode fan seems not to respond to this mod.

edit.

I do get a lot of this though:

Spoiler

Module DifferentialThrustEngineModule threw during OnUpdate: System.NullReferenceException: Object reference not set to an instance of an object
  at DifferentialThrustMod.DifferentialThrustEngineModule.boot () [0x00000] in <filename unknown>:0
  at DifferentialThrustMod.DifferentialThrustEngineModule.OnUpdate () [0x00000] in <filename unknown>:0
  at Part.ModulesOnUpdate () [0x00000] in <filename unknown>:0

 

Edited by Apaseall
Link to comment
Share on other sites

  • 3 months later...
On 8/25/2018 at 8:26 PM, Apaseall said:

I have a question about engines. I see engines with MODULE { name = MultiModeEngine } which have primary and secondary EngineIDs'. Those EngineIDs' appear in MODULE { name = ModuleEnginesFX }. For example:

  Reveal hidden contents

        MODULE
        {
            name = MultiModeEngine
            primaryEngineID = AirBreathing
            secondaryEngineID = ElectricalDrive
            primaryEngineModeDisplayName = Air Breathing
            secondaryEngineModeDisplayName = Electrical Drive
        }
        MODULE
        {
            name = ModuleEnginesFX
            engineID = AirBreathing
// snip
        }
        MODULE
        {
            name = ModuleEnginesFX
            engineID = ElectricalDrive
// snip
        }

I also see in the source code tests for both ModuleEngines and ModuleEnginesFX. For example:

  Reveal hidden contents

                    if (pm is ModuleEngines || pm is ModuleEnginesFX)
                    {
// snip
                   }

However I see that only ModuleEngines are interacted with after such tests. For example:

  Reveal hidden contents

                    //check if SRB
                    if (pm is ModuleEngines || pm is ModuleEnginesFX)
                    {
                        ModuleEngines cModuleEngines;
                        cModuleEngines = (ModuleEngines)pm;
                        if (cModuleEngines.throttleLocked == false) { couldadd = true; };
                    }
                    ////check if SRB
                    //if (pm is ModuleEnginesFX)
                    //{
                    //    cModuleEngines = p.Modules.OfType<ModuleEnginesFX>().FirstOrDefault();
                    //    if (cModuleEngines.throttleLocked == false) { couldadd = true; };
                    //}

I am curious therefore how this mod works with multimode engines that are only described in terms of ModuleEnginesFX, that is to say, if the engine has no ModuleEngines in its definition?

If I examine my modulemanager.configcache I can see that the engine as used in game still has no ModuleEngines but does have ModuleEnginesFX.

I ask because I am trying to track down why a dual mode fan seems not to respond to this mod.

edit.

I do get a lot of this though:

  Hide contents

Module DifferentialThrustEngineModule threw during OnUpdate: System.NullReferenceException: Object reference not set to an instance of an object
  at DifferentialThrustMod.DifferentialThrustEngineModule.boot () [0x00000] in <filename unknown>:0
  at DifferentialThrustMod.DifferentialThrustEngineModule.OnUpdate () [0x00000] in <filename unknown>:0
  at Part.ModulesOnUpdate () [0x00000] in <filename unknown>:0

 

ModuleEnginesFX is a class which inherits from ModuleEngines. This means ModuleEnginesFX expands on the functionality of ModuleEngines, but can still do the same stuff. When ModuleEnginesFX were introduced I didn't know this and wrote all these separate sections of code to interact with either ModuleEngines or ModuleEnginesFX. Later when I was also a little more familiar with C#, I noticed this. Since all of these separate block were unnecessary I corrected this everywhere in the mod, since ModuleEnginesFX can be treated as ModuleEngines so there was never a reason do duplicate all this code.

To answer your question, the mod works equally with both ModuleEngines and ModuleEnginesFX. Don't know why your getting this error. Don't see your issue when using the rapier engine. Which multi mode engine are you using? Is this from a mod?

 

Update:

-compiled against 1.6.0 libraries

Link to comment
Share on other sites

  • 2 years later...
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...