Kerbal Aircraft Expansion (KAX)

Kerbal Aircraft Expansion (KAX)

523k Downloads

Finish the JumpJet

Lisias opened this issue · 9 comments

commented

The JumpJet is long forgotten on the back log.

Time to finish this thing.

Since the part was already published as is, I calling this one a bug.

commented

Hi, @BrettRyland . Thanks for the report.

It sounds like I forgot to initialise something on the config file. I will check it ASAP.

commented

Issue about Exceptions moved to #15

commented

@BrettRyland , this is not related to BDArmory. Vanilla KSP also raises that exceptions.

What's happening is that that engine is still configured to use the old ModuleEngines and not the newer ModuleEnginesFX - but something is missing on this configuration since long time, as it appears - I reproduced this Exception on KSP 1.3.1… What makes me wonder why this is happening just now.

You are using KSP 1.12?

commented

Hi. Yes, I'm using the latest KSP. I'm using the Linux version, but the reports I've had from others were using Windows.

Kerbal Space Program - 1.12.2.3167 (LinuxPlayer) en-us

The strange thing was that if you stage and throttle up the engine, then it produces thrust, despite throwing the exceptions.

The reports I got in BDArmory (note: it's this version https://spacedock.info/mod/2487/BDArmory%20for%20Runway%20Project#, not the old version of BDArmory that was maintained by jrodriguez) were due to the exception that's thrown when activating the engine, which stops the competition startup coroutine. So, I guess that this is why it's only being noticed now.

commented

HA!! Found the problem! Pretty silly, and somewhat embarrassing…

On the fx definitions, the JumpJet had

fx_exhaustLight_blue       = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, power

But apparently power is not a valid value for the activate field. I'm having some trouble on finding good documentation for this , but looking on the "competition", I found that they are using running - and this solved the problem of the Exceptions being thrown by ModuleEngines.SetupFXGroups.

This engine has this problem since forever, as it appears, and that exception gone unnoticed and/or uncared because until 1.8.0 (more or less), KSP were handling exceptions itself on initialisation. From 1.8.0 (or near it), the Dev Team start to remove try-catches from hot code in order to improve performance (what it's the right thing to do) - but it ended up that we lost some resilience on the initialisation, and so Exceptions that used to be harmless started to abort initialisation procedures - with side effects like this one on BDA.

This issue were created because I noticed the white smoke were being thrown on the wrong axis, so I knew I need to give this some care - but I didn't noticed that Exception (or forgot about, I'm handling too much issues at once on KSP-Recall and TweakScale - more on the former, less on the later). Curiously, this ended up fixing the plumes too. :D

Oh, well… So it's the life. I will commit the fix and issue a patch on Forum to workaround the problem until I issue a new release for KAX!

— —
Yep… The JumpJet had this configuration since KAX 2.2.1:

fx_exhaustLight_blue = 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, power

commented

Fixed on commit 676c11b

A temporary workaround to be used while a new release is not issued:

@PART[KAXjumpJet]:AFTER[KAX]
{
	@fx_exhaustLight_blue       = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, running
	@fx_smokeTrail_light        = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, running
}
commented

This is too good to let it go… While testing the patch above on a faulty KAX installation, the thing took off!! :D

screenshot46

@BrettRyland , please distribute this post for your users in the mean time.

commented

Awesome! Thanks! :-)

commented

Hi @Lisias,

FYI, I've had some bug reports in BDArmory about competitions failing to start when vessels are using engines based on this engine. In case it helps with fixing this engine, the exceptions I'm seeing in the KSP.log caused by this engine are:

I also tried the "Jump Jet Engine" in KAX that the ted is based on and got

[ERR 22:12:02.486] Module ModuleEngines threw during OnStart: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <9577ac7a62ef43179789031239ba8798>:0 
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at ModuleEngines.SetupFXGroups () [0x00757] in <4a4632fe4eb0471fa0f9f87bb7432bc2>:0 
  at ModuleEngines.InitializeFX () [0x00000] in <4a4632fe4eb0471fa0f9f87bb7432bc2>:0 
  at ModuleEngines.OnStart (PartModule+StartState state) [0x00063] in <4a4632fe4eb0471fa0f9f87bb7432bc2>:0 
  at Part.ModulesOnStart () [0x00120] in <4a4632fe4eb0471fa0f9f87bb7432bc2>:0 
  UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
  ModuleManager.UnityLogHandle.InterceptLogHandler:LogFormat(LogType, Object, String, Object[])
  UnityEngine.Debug:LogError(Object)
  Part:ModulesOnStart()
  <Start>d__323:MoveNext()
  UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

followed by a stream of

[EXC 22:12:04.578] NullReferenceException: Object reference not set to an instance of an object
  ModuleEngines.ThrustUpdate () (at <4a4632fe4eb0471fa0f9f87bb7432bc2>:0)
  ModuleEngines.FixedUpdate () (at <4a4632fe4eb0471fa0f9f87bb7432bc2>:0)
  UnityEngine.DebugLogHandler:LogException(Exception, Object)
  ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
  UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

and

[EXC 22:12:20.046] NullReferenceException: Object reference not set to an instance of an object
  ModuleEngines.Activate () (at <4a4632fe4eb0471fa0f9f87bb7432bc2>:0)
  BDArmory.Control.VesselSpawner+<SpawnAllVesselsOnceCoroutine>d__26.MoveNext () (at /home/brett/github/BDArmory/BDArmory/Control/VesselSpawner.cs:735)
  UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <2425394cf09642369e2109953e31f62b>:0)
  UnityEngine.DebugLogHandler:LogException(Exception, Object)
  ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
  UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

when trying to activate the engine, which is where the competition fails to start.

Cheers,
DocNappers.