Jump to content

[KSP 1.12.4] On Demand Fuel Cells (ODFC) - 1.2.99.1-prerelease - `<BlackOut>` edition [26 Dec 2022]


zer0Kerbal

Recommended Posts

On 6/20/2021 at 9:26 PM, Ender65535 said:

Was ODFCMaxEC something from the latest dev branch?

been something I have been mulling around.

Issue is late in the patch I deleted the variable key, and Module Manager doesn't like that.

Spoiler


		!ODFCMaxEC = dummy // clean up

 

removing that fixes the patch. wasted so much time trying to fix something that technically wasn't broken. :cry:

the full working patch: 

Spoiler

// StockFuelCells.cfg v1.2.2.2
// On Demand Fuel Cells (ODFC)
// created: 13 Aug 19
// updated: 22 Jun 2021

@PART[FuelCell,FuelCellArray]:NEEDS[ODFC]:FOR[ODFC]
{
	@cost += 50
	@title ^= :$: <color=#6495ED> ODFC</color>:
	@description ^= :(.)$:$0\n<#6495ED><i>ODFC installed.</i></color>:
	@mass += 0.001
	@tags ^= :$: odfc demand:

	!MODULE[ModuleResourceConverter] {}
	MODULE,0
	{
		name = ODFC
		ODFCMaxEC = 1.0
		// scaleFactor = 1
		// threshold = 0.33
		// rateLimit = 0.75
		// fuelCellIsEnabled = false
		// fuelMode = 2
		MODE
		{
			name = MP
			MaxEC = 1.0
			FUELS
			{
				MonoPropellant = 0.001
			}
		}
		MODE
		{
			name = LFO
			MaxEC = 1.0
			FUELS
			{
				LiquidFuel = 0.001125
				Oxidizer = 0.0030555555555556
			}
		}
		MODE
		{
			name = LFIA
			MaxEC = 1.0
			FUELS
			{
				LiquidFuel = 0.000085
				IntakeAir = 0.0204
			}
		}
		MODE:NEEDS[CommunityResourcePack]
		{
			name = H2OW
			MaxEC = 1.0
			FUELS
			{
				Hydrogen = 0.20852969923455
				Oxygen = 0.1577243965100526
			}
			BYPRODUCTS
			{
				Water = 0.0001686838444
			}
		}
		MODE:NEEDS[CryoTanks]
		{
			name = LH2O
			MaxEC = 1.0
			FUELS
			{
				LqdHydrogen = 0.020625 //0.02063
				Oxidizer = 0.001375 // 0.00138
			}
			BYPRODUCTS
			{
				Water = 0.00773
			}
		}
		MODE:NEEDS[CommunityResourcePack]
		{
			name = Hydrazine
			MaxEC = 1.0
			FUELS
			{
				Hydrazine = 0.01564
				Oxygen = 0.01182
			}
			BYPRODUCTS
			{
				Water = 0.00001266
			}
		}
	}
}

@PART[FuelCell]:NEEDS[ODFC]:AFTER[ODFC]
{
@MODULE[ODFC]
	{
		ODFCMaxEC = 5
		@MODE[MP]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@MonoPropellant *= #$../MaxEC$
			}
		}
		@MODE[LFO]
		{
			@MaxEC =#$../ODFCMaxEC$
			@FUELS
			{
				@LiquidFuel *= #$../MaxEC$
				@Oxidizer *= #$../MaxEC$
			}
		}
		@MODE[LFIA]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@LiquidFuel *= #$../MaxEC$
				@IntakeAir *= #$../MaxEC$
			}
		}
		@MODE[H2OW]:NEEDS[CommunityResourcePack]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@Hydrogen *= #$../MaxEC$
				@Oxygen *= #$../MaxEC$
			}
			@BYPRODUCTS
			{
				@Water *= #$../MaxEC$
			}
		}
		@MODE[LH2O]:NEEDS[CryoTanks]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@LqdHydrogen *= #$../MaxEC$
				@Oxidizer *= #$../MaxEC$
			}
			@BYPRODUCTS
			{
				@Water *= #$../MaxEC$
			}
		}
		@MODE[Hydrazine]:NEEDS[CommunityResourcePack]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@Hydrazine *= #$../MaxEC$
				@Oxygen *= #$../MaxEC$
			}
			@BYPRODUCTS
			{
				@Water *= #$../MaxEC$
			}
		}
	}
	
	@RESOURCE[electricCharge]
	{
		&amount = 5
		%maxAmount = #$amount$
		flowState = False
	}

	@RESOURCE[MonoPropellant]
	{
		&amount = 5
		%maxAmount = #$amount$
		%maxAmount += 5
	}
}

@PART[FuelCellArray]:NEEDS[ODFC]:AFTER[ODFC]
{
	@MODULE[ODFC]
	{
		ODFCMaxEC = 32
		@MODE[MP]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@MonoPropellant *= #$../MaxEC$
			}
		}
		@MODE[LFO]
		{
			@MaxEC =#$../ODFCMaxEC$
			@FUELS
			{
				@LiquidFuel *= #$../MaxEC$
				@Oxidizer *= #$../MaxEC$
			}
		}
		@MODE[LFIA]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@LiquidFuel *= #$../MaxEC$
				@IntakeAir *= #$../MaxEC$
			}
		}
		@MODE[H2OW]:NEEDS[CommunityResourcePack]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@Hydrogen *= #$../MaxEC$
				@Oxygen *= #$../MaxEC$
			}
			@BYPRODUCTS
			{
				@Water *= #$../MaxEC$
			}
		}
		@MODE[LH2O]:NEEDS[CryoTanks]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@LqdHydrogen *= #$../MaxEC$
				@Oxidizer *= #$../MaxEC$
			}
			@BYPRODUCTS
			{
				@Water *= #$../MaxEC$
			}
		}
		@MODE[Hydrazine]:NEEDS[CommunityResourcePack]
		{
			@MaxEC = #$../ODFCMaxEC$
			@FUELS
			{
				@Hydrazine *= #$../MaxEC$
				@Oxygen *= #$../MaxEC$
			}
			@BYPRODUCTS
			{
				@Water *= #$../MaxEC$
			}
		}
	}
	
	@RESOURCE[electricCharge]
	{
		&amount = 32
		%maxAmount = #$amount$
		flowState = False
	}

	@RESOURCE[MonoPropellant]
	{
		&amount = 15
		%maxAmount = #$amount$
		%maxAmount += 5
	}
}
// GPLv2
// zer0Kerbal

 

 

Edited by zer0Kerbal
Link to comment
Share on other sites

  • 7 months later...

Soon.™er™ish™

I still like ODFC and it apparently works just fine in 1.12.x

I am working toward a new pass - and am trying to fit it in, just, well, its code and I loose whole weeks to `code blackout` :P

The next pass will do away with the copy/modify patches - (won't be updating those) - rather I want to have modify the norm, and if I can figure out (and tolerate the GUI) Patch Manager - include the options that way.

Also much better patch flow coming up, that requires me to do way less math and spreadsheets. :D

Track progress below:

issue here. Project here.

 

The Short List


zer0Kerbal | Twitter zer0Kerbal | YouTube zer0Kerbal | Twitch

On Demand Fuel Cells (ODFC)

 

Link to comment
Share on other sites

  • 5 months later...

On Demand Fuel Cells Version
KSP version License
AVC .version files Pages

Version 1.2.99.0-prerelease - <NextMode> edition

05 Aug 2022
Released for Kerbal Space Program 1.12.x

DO A CLEAN INSTALL:
DELETE EXISTING INSTALLATION THEN RE-INSTALL

Download from CurseForge

Summary 1.2.99.0

  • Recompiled for KSP 1.12.3 (NET 4.5.2 - C# 5.0)
  • internal updates and changes to prepare for further updates
  • Now includes modify patches and no longer compatible with
    • modify patches
    • copy patches
    • will update those releases if enough demand

 

Spoiler

Code

  • Recompiled
    • .NET 4.5.2
    • C# 5.0
    • KSP 1.12.3
    • <OnDemandFuelCells.dll>
      • file version 1.2.99.100
  • Renamed
    • <ODFC.dll> to <OnDemandFuelCells.dll>

Config

  • Update
    • all configs to reflect dll namechange
    • AllYAll-Removal.cfg v1.2.0.0
    • OnDemandFuelCells.cfg v1.0.0.0
    • <OnDemandFuelCells.version>
      • remove "KSP_VERSION_MAX"

Compatibliity

  • Update
    • all patches to reflect dll namechange
    • StockPods v1.9.0.0
    • StockFuelCells.cfg v1.3.0.0

Status 1.2.99.0

  • Issues
    • closes #65 - OnDemandFuelCells 1.2.99.0-prerelease <EDITION>
    • closes #66 - 1.2.99.0 Verify Legal Mumbo Jumbo
    • closes #67 - 1.2.99.0 Update Documentation
    • closes #68 - 1.2.99.0 Update Social Media

 

 


See More

  • Changelog Summary for more details of changes : See ChangeLog
  • Discussions and news on this mod : See Discussions or KSP Forums
  • Known Issues for more details of feature requests and known issues : See Known Issues
  • GitHub Pages : See Pages

Localization

  • English English
  • your translation here

HELP WANTED - See the README in the Localization folder or the Quickstart Guide for instructions for adding or improving translations. GitHub push is the best way to contribute. Additions and corrections welcome!

red box below is a link to forum post on how to get support

How to get support

Be Kind: Lithobrake, not jakebrake! Keep your Module Manager up to date


How to support this and other great mods by zer0Kerbal

Support Patreon Github Sponsor Buy zer0Kerbal a snack

Link to comment
Share on other sites

  • 1 month later...

Hi @zer0Kerbal,

I'm having a problem which Nertea thinks may be related to ODFC.

I'm getting constant NRE spam apparently from DBS whenever i fly a vehicle with a MK1 or MK1-3 capsule.

Module DischargeCapacitor threw during OnFixedUpdate: System.NullReferenceException: Object reference not set to an instance of an object
  at NearFutureElectrical.DischargeCapacitor.get_CurrentCharge () [0x00025] in <81c4957bdce64bef809a1ac06ed71d14>:0
  at NearFutureElectrical.DischargeCapacitor.OnFixedUpdate () [0x00204] in <81c4957bdce64bef809a1ac06ed71d14>:0
  at Part.ModulesOnFixedUpdate () [0x000bd] in <39c0323fb6b449a4aaf3465c00ed3c8d>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

These capsules show a Discharge Rate slider which shouldn't be present (no capacitors involved), and Nertea thinks it may be ODFC patching the DischargeCapacitor module into these parts.

Modlist

4Gijl2L.jpg

Logs and MM cache :-

https://www.dropbox.com/s/7bnhngz1ptaw9zx/KSP Logs.zip?dl=0

I've patched this for myself, but let me know if I can get you any more details.

Link to comment
Share on other sites

1 hour ago, Ravlain said:

I'm having a problem which Nertea thinks may be related to ODFC.

@Ravlain:

Kindly try the newest version of ODFC:   Version 1.2.99.0-prerelease-CF - `<NextMode>` edition

As always - don't try on live saves. Backup you save games!

This newest version doesn't need the Modify Patches installed (they come with) - so if you have the modify/copy patches installed - should remove.

Thank you for the logs - a very good selection of all the greatest hits! I will review in the next 24-36 hours.

Link to comment
Share on other sites

  • 3 months later...

On Demand Fuel Cells Version
KSP version License
AVC .version files Pages

Version 1.2.99.1-prerelease - <BlackOut> edition

  • Released

    • 26 Dec 2022
    • for Kerbal Space Program 1.12.4
    • by zer0Kerbal
  • youtube

For best results - DO A CLEAN INSTALL; DELETE EXISTING INSTALLATION THEN RE-INSTALL

Download from CurseForge

Summary

Spoiler
  • Recompiled for KSP 1.12.4 (NET 4.5.2 - C# 5.0)
    • <OnDemandFuelCells.dll> 1.2.99.100 --> 1.2.99.120
  • Code is fully localized.
  • Adds KerbalXMAS (XMAS) compatibility
  • Now includes modify patches and no longer compatible with
    • modify patches
    • copy patches
    • will update those releases if enough demand
  • youtube

Localization

  • Add
    • <en-us.cfg> v1.0.2.0
    • <readme.md> v2.1.2.0
    • <quickstart.md> v1.0.1.1
  • closes #52 - Add localization code.
  • closes #88 - Code Localization
  • closes #87 - Part Localization
  • closes #70 - English <us-en.cfg>
  • updates #69 - Localization - Master

Code

  • Recompiled
    • KSP 1.12.4
    • .NET 4.5.2
    • C# 5.0
    • <OnDemandFuelCells.dll> 1.2.99.100 --> 1.2.99.120
  • Bug Fixes
  • closes #51 - [BUG 1.2.0.0a] fuel consumption and byproduct production should be seen on PAW

Compatibliity

  • Add
    • <KerbalXMAS.cfg> v1.0.0.0

Status 1.2.99.0

  • Issues
    • closes #94 - On Demand Fuel Cells (ODFC) 1.2.99.1-prerelease <BlackOut>
    • closes #95 - 1.2.99.1 Verify Legal Mumbo Jumbo
    • closes #96 - 1.2.99.1 Update Documentation
    • closes #97 - 1.2.99.1 Update Social Media

See More

Spoiler

Localization

  • English English
  • your translation here

HELP WANTED - See the README in the Localization folder or the Quickstart Guide for instructions for adding or improving translations. GitHub push is the best way to contribute. Additions and corrections welcome!

red box below is a link to forum post on how to get support

How to get support

Be Kind: Lithobrake, not jakebrake! Keep your Module Manager up to date


How to support this and other great mods by zer0Kerbal

Support Patreon Github Sponsor Buy zer0Kerbal a snack

compiled with: KSP 1.12.4 — .NET 4.5.2 — C# 5.0

Release Schedule

Spoiler
  1. GitHub, reaching first manual installers and users of KSP-AVC. Right now.
  2. CurseForge. Right now.
  3. SpaceDock (and CKAN users). Soon™
Edited by zer0Kerbal
update links and lasso the birds
Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...
On 8/24/2019 at 4:03 PM, zer0Kerbal said:

Whilst I agree CKAN is a great mod for those that can't use zip tools.

Whilst I understand not wanting to do the extra work, we all can use zip tools. The vast majority of us who use CKAN are not retards and I personally resent mod authors who imply as such when we have 100's of mods to manage and keep up to date. I'm not going to check everyone on of your and the countless other modders' threads, githubs, and spacedocks for updates every time I want to play KSP. That's why we use CKAN, not because we're stupid troglodytes like you imply, so please stop.

Edited by Publius Kerman
Link to comment
Share on other sites

The Mod is not longer available. Link is broken.

The version that you can get via ckan doesn't work:
1. not all fuel cells are recognized
2. those that are detected do not turn on/off.

Edited by MaikC
Link to comment
Share on other sites

2 hours ago, MaikC said:

The Mod is not longer available. Link is broken.

The version that you can get via ckan doesn't work:
1. not all fuel cells are recognized
2. those that are detected do not turn on/off.

If you search the CurseForge KSP section it's there, link is just broken for some reason. The CKAN version if you'll notice is the previous version before the "BlackOut" edition, which says it's the version that makes it work with 1.12.4+. Not sure if he just forgot to "press the button", but I'm going to be honest with you @zer0Kerbal not using and then insulting the people who do use the most popular, and also only dedicated mod manager for the game you're modding is very unwise.

Testing the CurseForge "BlackOut" edition now, will update with results.

Edited by Publius Kerman
Link to comment
Share on other sites

On 12/28/2022 at 3:00 AM, zer0Kerbal said:

For best results - DO A CLEAN INSTALL; DELETE EXISTING INSTALLATION THEN RE-INSTALL

Download from CurseForge

Nah this link is broken, which is the one most people will naturally go to after your un-updated CKAN version doesn't work. They'll come here and go to the back page and look for the last build posted just in case, only to find your dead link.

Link to comment
Share on other sites

Guys, we all have our opinions on CKAN, and we are welcome to share such opinions, but everyone is expected to treat each other with respect.

When all is said and done, if Zer0kerbal doesn't want to support CKAN, that's just the way it is and we have to accept that. 

 

Link to comment
Share on other sites

55 minutes ago, Publius Kerman said:

link is broken

corrected link. finding the incorrect link would have much easier if a link to the broken link would have been supplied. :D

 

20 minutes ago, Deddly said:

support CKAN

I wanted to support CKAN, they just choose to not support my addons.

Link to comment
Share on other sites

This is brilliant. I only discovered KSP1 a little over a year ago and am so happy to see such a dedicated modding community.

Still actively modding a decade later? 
I am looking forward to having fuel cells that dont destroy a mission when i forget to turn them off and come back a week later!!

Link to comment
Share on other sites

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...