Jump to content

[1.8.x-1.12.x] Module Manager 4.2.3 (July 03th 2023) - Fireworks season


sarbian

Recommended Posts

22 hours ago, sarbian said:

This should do it. I added a check for Ore since checking for ModuleFuelJettison only seem a bit hazardous. And I fixed the variable syntax (# is only used once per line) and variable search (../ for a variable in a lower context)


@PART[*]:HAS[@MODULE[ModuleFuelJettison],@RESOURCE[Ore]]
{
	%SimpleAm = #$RESOURCE[Ore]/maxAmount$
	%DoubleAm = #$SimpleAm$
	@DoubleAm *= 2
	%Weight = #$mass$
	
	MODULE
	{
		name = InterstellarFuelSwitch
		resourceNames = Ore;Metal;RocketParts
		resourceAmounts = #$../SimpleAm$;$../SimpleAm$;$../DoubleAm$
		tankMass = #$../Weight$;$../Weight$;$../Weight$
		basePartMass = 0.0
		displayCurrentTankCost = true
		hasGUI = true
		availableInFlight = false
		availableInEditor = true
		showInfo = true	
	}
}

 

 

So this is where all that amazing code is coming from. 

I'm indebted to you guys, you've basically written half the mod!

Link to comment
Share on other sites

Just wanted to say thanks for Module Manager.

 

Loading RO I notice I have 17,800 patches all of which worked without a hitch and I thought that one unfair thing about making mods is you only hear from users when something goes wrong so I thought I`d say thanks because nothing is going wrong.

 

thank-you.jpg

Link to comment
Share on other sites

If I want to add X.- resource-converter-option to the stock ISRU, and modded ones too, would it be possible to bind the ratios to the size of the part?

I was thinking about something like this:

Spoiler

@PART[*]:HAS[@MODULE[ModuleResourceConverter]]:FINAL
{
	@MODULE
	{
		@name = ModuleResourceConverter
		%A = #$INPUT_RESOURCE[Ore]/Ratio$
		%B = #$INPUT_RESOURCE[ElectricCharge]/Ratio$
		%C = #$OUTPUT_RESOURCE[MonoPropellant]/Ratio$	

	MODULE
	{
		name = ModuleResourceConverter
		
		//...All the stuff that usually goes here...

		INPUT_RESOURCE
		{
			ResourceName = Ore
			Ratio = #$../A$*2
			FlowMode = STAGE_PRIORITY_FLOW
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = #$../B$*2
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Metal
			Ratio = #$../C$*0.5
			DumpExcess = false
			FlowMode = STAGE_PRIORITY_FLOW
	}

 

I'm a bit confused about variables and levels of the patch where is the best way to get their values and how to specific adress a Module wich exists 3 times in cfg. and can only be told a diffeent one by the thing it produces.

Edited by maculator
Link to comment
Share on other sites

9 hours ago, maculator said:

If I want to add X.- resource-converter-option to the stock ISRU, and modded ones too, would it be possible to bind the ratios to the size of the part?

I was thinking about something like this:

  Hide contents


@PART[*]:HAS[@MODULE[ModuleResourceConverter]]:FINAL
{
	@MODULE
	{
		@name = ModuleResourceConverter
		%A = #$INPUT_RESOURCE[Ore]/Ratio$
		%B = #$INPUT_RESOURCE[ElectricCharge]/Ratio$
		%C = #$OUTPUT_RESOURCE[MonoPropellant]/Ratio$	

	MODULE
	{
		name = ModuleResourceConverter
		
		//...All the stuff that usually goes here...

		INPUT_RESOURCE
		{
			ResourceName = Ore
			Ratio = #$../A$*2
			FlowMode = STAGE_PRIORITY_FLOW
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = #$../B$*2
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Metal
			Ratio = #$../C$*0.5
			DumpExcess = false
			FlowMode = STAGE_PRIORITY_FLOW
	}

 

I'm a bit confused about variables and levels of the patch where is the best way to get their values and how to specific adress a Module wich exists 3 times in cfg. and can only be told a diffeent one by the thing it produces.

If you want to EDIT node, use @MODULE[ModuleName] {...

If you want toCREATE node, use MODULE {...

And you can add check for ORE converter, isn't is?

@PART:HAS[@MODULE[ModuleResourceConverter]:HAS[@INPUT_RESOURCE[Ore]]]:FINAL

 

Link to comment
Share on other sites

@Jenyaza Checking for ore isn't a bad idea since the fuelcells also convert resources, thanks. The rest of my patch works just fine, exept I can't get my variables to work.

 

So I tracked down my problem to one specific line:

%BasicFactor = #$../ModuleResourceConverter/OUTPUT_RESOURCE_RESOURCE[Monoprop]/Ratio$

I need to get a value for my variabel out of the ModuleResourceConverter wich exists 3 times .... :/

I'm stuck. Can I some how just adress the stock ISRU and get the variabel via index and then use it in my patch?

 @MODULE[ModuleResourceConverter],2 { ... }

Here is the full patch as it is right now:

Spoiler

@PART[ISRU] //For testing only adress stock IRSU
{

	//This is what I'm worried about:
	%BasicFactor = #$../ModuleResourceConverter/OUTPUT_RESOURCE_RESOURCE[Monoprop]/Ratio$
	//If the line above works the rest should too
	%MetalFactor = #$BasicFactor$
	@MetalFactor *= .5
	%ECFactor = #$BasicFactor$
	@ECFactor *= 2
	%OreFactor = #$BasicFactor$
	@OreFactor *= 2

	@description ^= :$: After alot of tinkering this beauty is now capable of turning ore into metal!:

	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = Metal
		StartActionName = Start Metal Refining
		StopActionName = Stop Metal Refining 
		AutoShutdown = true

		TemperatureModifier
		{
			key = 0 100000
			key = 750 50000
			key = 1000 10000
			key = 1250 500
			key = 2000 50
			key = 4000 0
		}

		GeneratesHeat = true
		DefaultShutoffTemp = .8

		ThermalEfficiency 
		{
			key = 0 0 0 0
			key = 500 0.1 0 0
			key = 1300 1.0 0 0
			key = 1700 0.1 0 0
			key = 3000 0 0 0 
		}

		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		SpecialistBonusBase = 0.05
		Specialty = Engineer
		EfficiencyBonus = 1

		//If the setup fo the variabels worked, this should too.
		INPUT_RESOURCE
		{
			ResourceName = Ore
			Ratio = #$../OreFactor$
			FlowMode = STAGE_PRIORITY_FLOW
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = #$../ECFactor$
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Metal
			Ratio = #$../MetalFactor$
			DumpExcess = false
			FlowMode = STAGE_PRIORITY_FLOW
		}
	}
}

 

 

Edited by maculator
Link to comment
Share on other sites

On 7/3/2016 at 9:55 AM, maculator said:

@Jenyaza Checking for ore isn't a bad idea since the fuelcells also convert resources, thanks. The rest of my patch works just fine, exept I can't get my variables to work.

 

So I tracked down my problem to one specific line:


%BasicFactor = #$../ModuleResourceConverter/OUTPUT_RESOURCE_RESOURCE[Monoprop]/Ratio$

I need to get a value for my variabel out of the ModuleResourceConverter wich exists 3 times .... :/

I'm stuck. Can I some how just adress the stock ISRU and get the variabel via index and then use it in my patch?


 @MODULE[ModuleResourceConverter],2 { ... }

Here is the full patch as it is right now:

  Hide contents


@PART[ISRU] //For testing only adress stock IRSU
{

	//This is what I'm worried about:
	%BasicFactor = #$../ModuleResourceConverter/OUTPUT_RESOURCE_RESOURCE[Monoprop]/Ratio$
	//If the line above works the rest should too
	%MetalFactor = #$BasicFactor$
	@MetalFactor *= .5
	%ECFactor = #$BasicFactor$
	@ECFactor *= 2
	%OreFactor = #$BasicFactor$
	@OreFactor *= 2

	@description ^= :$: After alot of tinkering this beauty is now capable of turning ore into metal!:

	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = Metal
		StartActionName = Start Metal Refining
		StopActionName = Stop Metal Refining 
		AutoShutdown = true

		TemperatureModifier
		{
			key = 0 100000
			key = 750 50000
			key = 1000 10000
			key = 1250 500
			key = 2000 50
			key = 4000 0
		}

		GeneratesHeat = true
		DefaultShutoffTemp = .8

		ThermalEfficiency 
		{
			key = 0 0 0 0
			key = 500 0.1 0 0
			key = 1300 1.0 0 0
			key = 1700 0.1 0 0
			key = 3000 0 0 0 
		}

		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		SpecialistBonusBase = 0.05
		Specialty = Engineer
		EfficiencyBonus = 1

		//If the setup fo the variabels worked, this should too.
		INPUT_RESOURCE
		{
			ResourceName = Ore
			Ratio = #$../OreFactor$
			FlowMode = STAGE_PRIORITY_FLOW
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = #$../ECFactor$
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Metal
			Ratio = #$../MetalFactor$
			DumpExcess = false
			FlowMode = STAGE_PRIORITY_FLOW
		}
	}
}

 

 

Probably the fast way for solve it is use mass instead of ratio

@PART:HAS[@MODULE[ModuleResourceConverter]:HAS[@OUTPUT_RESOURCE[MonoPropellant]]]:FINAL

@description ^= :$: After alot of tinkering this beauty is now capable of turning ore into metal!:

	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = Metal
		StartActionName = Start Metal Refining
		StopActionName = Stop Metal Refining 
		AutoShutdown = true

		TemperatureModifier
		{
			key = 0 100000
			key = 750 50000
			key = 1000 10000
			key = 1250 500
			key = 2000 50
			key = 4000 0
		}

		GeneratesHeat = true
		DefaultShutoffTemp = .8

		ThermalEfficiency 
		{
			key = 0 0 0 0
			key = 500 0.1 0 0
			key = 1300 1.0 0 0
			key = 1700 0.1 0 0
			key = 3000 0 0 0 
		}

		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		SpecialistBonusBase = 0.05
		Specialty = Engineer
		EfficiencyBonus = 1

		//If the setup fo the variabels worked, this should too.
		INPUT_RESOURCE
		{
			ResourceName = Ore
			Ratio = 0.235 		//Default 1
			@Ratio *= #$/mass$
			FlowMode = STAGE_PRIORITY_FLOW
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 14.117 		// Default 60
			@Ratio *= #$/mass$
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Metal
			Ratio = 0.117		// Default 0.5 
			@Ratio *= #$/mass$
			DumpExcess = false
			FlowMode = STAGE_PRIORITY_FLOW
		}
	}
}
Edited by Badsector
Link to comment
Share on other sites

I figured out why the cache so rarely is used on my system, I have several mods installed that write data to files in the mod folder every game session, so running the SHA check is a waste of CPU cycle, as something has always changed.

 

To make things even better, the rare times the cache get loaded, it result in a game that is missing parts.

 

Seems to me the best would be for me to have the cache system turned off entirely.

 

Edit: Well, thats weird, the first post has 2.6.18 in the download link, CKAN seems to have installed 2.6.20?

Edited by Miravlix
Link to comment
Share on other sites

1 hour ago, Miravlix said:

I figured out why the cache so rarely is used on my system, I have several mods installed that write data to files in the mod folder every game session, so running the SHA check is a waste of CPU cycle, as something has always changed.

 

To make things even better, the rare times the cache get loaded, it result in a game that is missing parts.

 

Seems to me the best would be for me to have the cache system turned off entirely.

 

Edit: Well, thats weird, the first post has 2.6.18 in the download link, CKAN seems to have installed 2.6.20?

The cache seems to work fine for everyone else.  And mods shouldn't be writing data that way.  Any config that is going to be modified by a plugin should be in a PluginData folder, which means that it won't get added to the game database and ModuleManager won't touch it.

Link to comment
Share on other sites

If you want to totally remove right-down portraits, use

@PART[*]  // if any part contains INTERNAL {} node, it will be removed 
{
!INTERNAL {}
}

Then go to the GameData/Squad/ and remove the Props and Spaces folders (or place it in... Screenshots. Why not? Game doesn't look here ).

 

Maybe, you may nterest in this  http://forum.kerbalspaceprogram.com/index.php?/topic/99287-105-crew-portraits-13dec-12-2015/

Download link is on KerbalStuff, which is dead... but i have local copy, so 

@PART:HAS[#CrewCapacity[>0],!INTERNAL[*]]:Final
{
    INTERNAL
    {
        name = Placeholder
    }
}

or even more "hardcore"

@PART:HAS[#CrewCapacity[>0]]:Final

In this case, you also can delete \Props\ and all except Placeholder in \Spaces\

Edited by Jenyaza
Shorten the post
Link to comment
Share on other sites

Thank you, I appreciate your help. That might become helpful after I got a bit more familiar with this mod. At this point it all looks a bit cryptic to me, I'll have to read up on this thread and then muster the courage and play around with this on a test install maybe.

Link to comment
Share on other sites

On 11.3.2016 at 8:31 AM, Dafni said:

Hey!

Is there a video or a tutorial on how to use this mod? I want to learn how to use this to do things like getting rid of the IVAs and Kerbal portraits etc.

Thanks

Daf

I just started learning how to do all these awesome things but I also thought about and searched for a video.

Since I didn't found any, I thought about doing an own one. But it would take quite some while until I could've finished the video. If there's demand for it I'm going to double my efforts! 

Link to comment
Share on other sites

On 10/3/2016 at 6:12 AM, blowfish said:

The cache seems to work fine for everyone else.  And mods shouldn't be writing data that way.  Any config that is going to be modified by a plugin should be in a PluginData folder, which means that it won't get added to the game database and ModuleManager won't touch it.

Really? You're going to say what modders "should and shouldn't do" when most can't code their way out of a wet paper bag?

 

You might as well claim people shouldn't drink alcohol because it makes them stupid.

 

Like ETT that creates a virtual MM name of zETT and then uses :FINAL, so it get sorted last... You can whine all you want about what people should or shouldn't do, someone will do the worst possible thing every SINGLE TIME.

 

BTW: I think MechJeb 2 is one of the mods creating files in the GameData/MechJeb2 folder, config files pr. craft?

Link to comment
Share on other sites

1 minute ago, Miravlix said:

BTW: I think MechJeb 2 is one of the mods creating files in the GameData/MechJeb2 folder, config files pr. craft?

Yes. And it does it in a PluginData sub-folder, where the game ignore them at loading.

I can't change what other mods do. But I won't change how MM handles its cache because starting to ignore files leads to really complex interaction.

 

And clearly you proved that people do the worst possible things. Thank you for that ground breaking discovery, it was never done before on Internet. Now move along.

 

Link to comment
Share on other sites

3 minutes ago, sarbian said:

I can't change what other mods do. But I won't change how MM handles its cache because starting to ignore files leads to really complex interaction.

 

Never even remotely suggested you should, I didn't even ask you to do anything, if you go back and check my post you will see that all I said was that it would be best for me if I could turn off the cache, as it's unfortunately just increasing load times for me and I can't figure out enough details of the problem to give you a useful bug report.

Link to comment
Share on other sites

24 minutes ago, Miravlix said:

 

Never even remotely suggested you should, I didn't even ask you to do anything, if you go back and check my post you will see that all I said was that it would be best for me if I could turn off the cache, as it's unfortunately just increasing load times for me and I can't figure out enough details of the problem to give you a useful bug report.

Ok, fair point. Now can you open your log file, search for "[ModuleManager] SHA generated in" and paste the line on the forum ?

Edited by sarbian
Link to comment
Share on other sites

Spoiler

[LOG 19:05:22.664] [ModuleManager] SHA generated in 26.954s
[LOG 19:05:22.665] [ModuleManager]       SHA = 00-B9-C1-0B-24-49-45-ED-F5-A9-7A-A6-63-E5-67-94-9B-4E-7F-47-E7-00-07-1D-EB-C3-98-2F-CB-CD-E2-05
[LOG 19:05:24.659] [ModuleManager] Changes :
Changed : Diazo/AGExt/AGExt.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_0.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_1.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_10.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_11.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_12.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_2.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_3.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_4.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_5.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_6.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_7.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_8.cfg
Changed : PersistentRotation/PersistentRotation_Mün or Bust_9.cfg
Changed : RCSBuildAid/settings.cfg
Changed : RemoteTech/RemoteTech_Settings.cfg
Changed : ScienceAlert/settings.cfg
Changed : TriggerTech/KerbalAlarmClock/settings.cfg
Changed : TriggerTech/KSPAlternateResourcePanel/settings.cfg
Changed : TriggerTech/TransferWindowPlanner/settings.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_13.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_14.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_15.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_16.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_17.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_18.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_19.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_20.cfg
Added   : PersistentRotation/PersistentRotation_Mün or Bust_21.cfg
Deleted : ContractPacks/CleverSat/CleverSat.cfg
Deleted : ContractPacks/CleverSat/CleverSatConstellation.cfg
Deleted : ContractPacks/CleverSat/CleverSatConstellationShift.cfg
Deleted : ContractPacks/CleverSat/CleverSatCore.cfg
Deleted : ContractPacks/CleverSat/CleverSatProbeMalfunction.cfg
Deleted : ContractPacks/CleverSat/CleverSatRandomShift.cfg
Deleted : ContractPacks/KFiles/KFiles.cfg
Deleted : ContractPacks/KFiles/KFilesKamikaze.cfg
Deleted : ContractPacks/KFiles/KFilesMinmus.cfg
Deleted : ContractPacks/KFiles/KFilesMunUFO.cfg
Deleted : ContractPacks/KFiles/KFilesTheBeginning.cfg
Deleted : ContractPacks/KFiles/KFilesTrial.cfg
Deleted : ContractPacks/KFiles/KFilesUFO.cfg
Deleted : ContractPacks/KFiles/KFilesVoyager.cfg
Deleted : Diazo/AutoAction/AutoAction.cfg
Deleted : Diazo/AutoAction/part.cfg
Deleted : TweakableEverything/TweakableControlSurfaces.cfg
Deleted : TweakableEverything/TweakableDecouplers.cfg
Deleted : TweakableEverything/TweakableDockingNode.cfg
Deleted : TweakableEverything/TweakableEVA.cfg
Deleted : TweakableEverything/TweakableFuelPumps.cfg
Deleted : TweakableEverything/TweakableGimbals.cfg
Deleted : TweakableEverything/TweakableIntakes.cfg
Deleted : TweakableEverything/TweakableLadders.cfg
Deleted : TweakableEverything/TweakableParachutes.cfg
Deleted : TweakableEverything/TweakableReactionWheels.cfg
Deleted : TweakableEverything/TweakableSAS.cfg
Deleted : TweakableEverything/TweakableSolarPanels.cfg

[LOG 19:05:24.693] [ModuleManager] Cache SHA = 5D-5D-7B-D2-24-CB-A4-C7-88-E5-27-60-A8-73-10-77-3E-55-E2-54-E4-8F-F1-AD-CB-F1-EA-59-E1-D5-54-A9
[LOG 19:05:24.695] [ModuleManager] useCache = False
 

 

Around 30 seconds, but I had to not erase the cache to ensure to get that. I've yet to encounter a situation where the game loaded from the cache without parts missing in game, so my only option when not testing, is to erase the cache before starting to the game, to be sure it's not loaded. 

[LOG 19:11:34.585] PhysicsGlobals: Loading database
[LOG 19:20:32.414] [ModuleManager] Total loading Time = 496.406s
 

Really don't want to have to start over more than I have to, with that kind of loading times.

 

Link to comment
Share on other sites

34 minutes ago, sarbian said:

Err, sorry but I find that hard to believe. I just asked a couple of RSS/RO players who launch KSP from HDD (not SSD) and their SHA time is under 1s.  

 

Life happened... and I'm stuck on using something like a first generation 64 bit computer, at least it's not my old IBM PC with tape outlet anymore. It's actually better than it used to be, the old gaming machine gave up and died, on that one most modern stuff was having trouble accepting it was a 64bit machine.

 

This one can still run most stuff, XCOM 2 is fine on it, it is an AMD Athlon 64 X2 Dual Core 5000+ 2.6 Ghz used to be my Linux Workstation. The world has actually progressed so far, I should prolly have kept it as Linux, but I just wasn't up for trying to start over.

Link to comment
Share on other sites

Spoiler

[ModuleManager] Total loading Time = 697.358s

That's mine, but is for over 130 mods, with nearly 50,000 MM patches running under linux 64bit.  

What would be really nice, is having MM, and DTL for that matter, not output to the ksp.log and players.log.  My ksp.log is 18.6Meg, and players.log is 31.8Meg just getting to the main menu. Most of it is from MM configs and DTL loading/unloading textures.  Makes for a pain when I need to upload a log for a bug.

Link to comment
Share on other sites

32 minutes ago, armegeddon said:
  Hide contents

[ModuleManager] Total loading Time = 697.358s

That's mine, but is for over 130 mods, with nearly 50,000 MM patches running under linux 64bit.  

What would be really nice, is having MM, and DTL for that matter, not output to the ksp.log and players.log.  My ksp.log is 18.6Meg, and players.log is 31.8Meg just getting to the main menu. Most of it is from MM configs and DTL loading/unloading textures.  Makes for a pain when I need to upload a log for a bug.

This was about SHA time, not total MM time.  MM can take quite a while, but the SHA should be generated relatively quickly:

[ModuleManager] SHA generated in 0.633s

 

Link to comment
Share on other sites

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