KSP Interstellar Extended

KSP Interstellar Extended

1M Downloads

**FATAL** issues with the upcoming TweakScale 2.5

Lisias opened this issue ยท 1 comments

commented

Hi.

TweakScale is going through some refactoring to be out of the LEGACY MM patching, improving resilience and trouble shooting.

However, some patches that still relies on the LEGACY way of patching is going to break, and WarpPlugin unfortunately is one of them.

The patching events come to this:

[LOG 10:54:12.301] [ModuleManager] INFO: Deleting root node in file WarpPlugin/Parts/Engines/IonEngine/IonEngine node: @PART[ionEngine]:AFTER[RealismOverhaul] as it can't satisfy its AFTER
[LOG 10:54:17.382] [ModuleManager] INFO: Applying update WarpPlugin/Parts/Engines/IonEngine/IonEngine/@PART[ionEngine]:NEEDS[!RealismOverhaul] to Squad/Parts/Engine/ionEngine/ionEngine.cfg/PART[ionEngine]
[LOG 10:56:51.802] Config(@PART[ionEngine]:FOR[TweakScale]) TweakScale/patches/Squad/Squad_Engines/@PART[ionEngine]:FOR[TweakScale]
[LOG 10:56:51.816] Config(PART) WarpPlugin/Parts/Engines/FissionSail/FissionSailBoostedFusionEngine/FissionSailBoostedFusionEngine
[LOG 10:56:51.816] Config(@PART[ionEngine]:AFTER[RealismOverhaul]) WarpPlugin/Parts/Engines/IonEngine/IonEngine/@PART[ionEngine]:AFTER[RealismOverhaul]
[LOG 10:56:51.816] Config(@PART[ionEngine]:NEEDS[!RealismOverhaul]) WarpPlugin/Parts/Engines/IonEngine/IonEngine/@PART[ionEngine]:NEEDS[!RealismOverhaul]
[LOG 11:00:11.817] [TweakScale] ERROR: **FATAL** Part ionEngine (IX-6315 "Dawn" Electric Propulsion System) has a fatal problem due having duplicated properties - see issue [#34]( https://github.com/net-lisias-ksp/TweakScale/issues/34 ). at error:0

And the ModuleManager.ConfigCache for the ionEngine came to to this:

UrlConfig
{
	parentUrl = Squad/Parts/Engine/ionEngine/ionEngine.cfg
	PART
	{
		name = ionEngine
		module = Part
		author = NovaSilisko
		<cut>
		subcategory = 0
		title = IX-6315 "Dawn" Electric Propulsion System
		manufacturer = Ionic Symphonic Protonic Electronics
		description = By emitting ionized xenon gas through a small thruster port, Dawn can produce incredibly efficient propulsion, but with a downside of very low thrust and high energy usage. According to ISP Electronics sales reps, the rumours of this engine being powered by "dark magic" are largely exaggerated.
		<cut>
		tags = (dawn deep drive efficient engine (ion probe thruster vacuum xenon
		<cut>
		MODULE
		{
			name = TweakScale
			type = stack
			defaultScale = 0.625
			scaleFactors = 0.2, 0.3, 0.45, 0.625, 0.95, 1.25, 1.875, 2.5
			type = stack
			defaultScale = 0.625
		}
		<cut>
		MODULE
		{
			name = TweakScale
			TWEAKSCALEEXPONENTS
			{
				mass = 2.5
			}
		}
		<cut>
	}
}

What would not only triggered the FATALity, but it's also one of the really bad ones as it would induce the part to behave in a way unexpected (the EXPONENTS is not being applied to the module that will be in use!).

The fix is simple: on the -MODULE[TweakScale] add an :BEFORE[WarpPlugin], and change the TweakScale info to be a patch with :FOR[WarpPlugin] and :AFTER[TweakScale] on it.

This will guarantee the order of patching (not only when TS 2.5 is on the wild, but also right now as empiric tests proved that even TS 2.4.3 works with this scheme).

A pull request is being worked out right now, I will submit the changes for the whole TweakScale patching soon.

Ideally all the patching should be updated to this scheme, however I'm only testing for TweakScale so prudence recommends to postpone any changes of this kind until time to proper testing that changes can be spared.

commented

While correcting the mentioned problem, I found some other potential troublemakers and fixed them too.