On Demand Fuel Cells (ODFC) by Orum

On Demand Fuel Cells (ODFC) by Orum

3.1k Downloads

NRE related to capacitors

reseune opened this issue ยท 2 comments

commented

Describe the bug
Receiving NRE spam when parts / vessels with ODFC are loaded, in conjunction with Near Future Electrical

[ERR 14:36:33.172] Module DischargeCapacitor threw during OnFixedUpdate: System.NullReferenceException: Object reference not set to an instance of an object at NearFutureElectrical.DischargeCapacitor.get_CurrentCharge () [0x00000] in <filename unknown>:0 at NearFutureElectrical.DischargeCapacitor.OnFixedUpdate () [0x00000] in <filename unknown>:0 at Part.ModulesOnFixedUpdate () [0x00000] in <filename unknown>:0

To Reproduce
Steps to reproduce the behavior:

  1. Load a vessel with ODFC (like a Mk 1-3 pod or a fuel cell)
  2. Make sure you also have NFE installed
  3. Check logs
  4. See NREs filling them

Expected behavior
ODFC would make coffee for me. And possibly scones.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 10

Smartphone (please complete the following information):

Additional context
https://forum.kerbalspaceprogram.com/index.php?/topic/155465-17x-near-future-technologies-nfc-update-oct-4th/&do=findComment&comment=3680834

commented

corrected in next set of patches.

commented

thank you @reseune .
fixed internally.

patch you requested:
`// Percolator.cfg v1.2
// On Demand Fuel Cells Refueled
// created: 31 Aug 19
// updated: 09 Oct 19

RESOURCE_DEFINITION
{
name = JebsCoffee
displayName = Jeb's Coffee
density = 0.0010000000
volume = 1
hsp = 41830
unitCost = 0.0008
color = 0.67, 0.17, 0.17
flowMode = ALL_VESSEL
transfer = PUMP
isTweakable = true
isVisible = true
ksparpicon = TriggerTech/KSPAlternateResourcePanel/Icons/ExoticMatter
}

RESOURCE_DEFINITION
{
name = JebsScones
displayName = Jeb's Scones
density = 4.0
volume = 1
hsp = 41830
color = 1.0, 1.0, 1.0
unitCost = 0.238874700854701
flowMode = ALL_VESSEL
transfer = PUMP
isTweakable = True
isVisible = true
ksparpicon = TriggerTech/KSPAlternateResourcePanel/Icons/ExoticMatter
}

@part[mk1pod]:NEEDS[ODFC,KGEx/JatwaaDemolitionsCo]:AFTER[ODFC]
{
// @name ^= :^:ODFC:
@cost += 50
@title ^= :$: <color=#6495ED> ODFC:
@description ^= :$:<#6495ED>ODFC Percolator installed. Beware of hot scones and don't for the love of all that is kerbal - DON'T DRINK THE COFFEE:
@mass += 0.001
@tags ^= :$: odfc demand jeb coffee scones:

!MODULE[ModuleResourceConverter] {}
MODULE:NEEDS[CommunityResourcePack]
{
	name = ODFC
	MODE
	{
		MaxEC = -18
		FUELS
		{
			MonoPropellant = 0.018
			LiquidFuel = 0.02025
			Oxidizer = 0.055
			Snacks = 1.0
			Food = 1.0
		}
		BYPRODUCTS
		{
			JebsScones = 1.0
		}
	}
	MODE
	{
		MaxEC = 18
		FUELS
		{
			LiquidFuel = 0.02025
			Oxidizer = 0.055
		}
	}
	MODE:NEEDS[CommunityResourcePack]
	{
		MaxEC = -428
		FUELS
		{
			Hydrogen = 3.75353458622189
			Oxygen = 2.83903913718094
			LiquidFuel = 0.0017
			Karbonite = 0.0001
			EnrichedUranium = 0.000017
			Antimatter = 0.00000000000000001
			ChargedParticles = 0.00000000000000001
			Salt = 0.045
			CoffeeBeans = 0.0042
		}
		BYPRODUCTS
		{
			JebsCoffee = 0.00303630919748661
		}
	}
	MODE
	{
		MaxEC = 18
		FUELS
		{
			LiquidFuel = 0.00153
			IntakeAir = 0.3672
		}
	}
	MODE:NEEDS[CommunityResourcePack]
	{
		MaxEC = 3.2
		FUELS
		{
			Hydrazine = .00782
			Oxygen = .00591
		}
		BYPRODUCTS
		{
			Water = .00000633
		}
	}
}

%RESOURCE[JebsScones]
{
	&amount = 5
	%amount += 5
	&maxAmount = 5
	%maxAmount += 5
	flowState = False
}

%RESOURCE[JebsCoffee]
{
	&amount = 5
	%amount += 5
	&maxAmount = 5
	%maxAmount += 5
}

}

// CC BY-NC-SA-4.0
// zer0Kerbal
`