Jump to content

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


sarbian

Recommended Posts

1 hour ago, captinjoehenry said:

Is there a way to apply a patch before all other patches?  Or at least in a group of the first patches in the list

Append :FIRST

@PART[somePartName]:HAS[some-has-stuff]:FIRST
{
  <config stuff>
}

I think also that if you don't schedule the patch that it schedules it even further, in the LEGACY pass.

Order of execution is: 

  • :LEGACY
  • :FIRST

(some-mod-name)

  • :BEFORE[some-mod-name]
  • :FOR[some-mod-name]
  • :AFTER[some-mod-name]

(some-mod-name finished its patches, rinse and repeat for the next mod being patched)

  • :FINAL
Link to comment
Share on other sites

is it possible to do this with MM?....

 

 

 

I want to read 2 lines from a module node

resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;MonoPropellant

resourceAmounts = 1,2;3;4;5

 

 

 

this is a basic setup of a tank using Interstellar Fuel Switch.

what I would like to somehow get the  fuel tank volume.

as in can read the "resourceNames" line and see the word LiquidFuel, or any other resource for that matter, and then compare it to the resourceAmounts line and set some variable to the amount of liquid fuel, or what ever resource I pick, that the part is able to hold?

Link to comment
Share on other sites

1 hour ago, Bit Fiddler said:

is it possible to do this with MM?....

 

 

 

I want to read 2 lines from a module node

resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;MonoPropellant

resourceAmounts = 1,2;3;4;5

 

 

 

this is a basic setup of a tank using Interstellar Fuel Switch.

what I would like to somehow get the  fuel tank volume.

as in can read the "resourceNames" line and see the word LiquidFuel, or any other resource for that matter, and then compare it to the resourceAmounts line and set some variable to the amount of liquid fuel, or what ever resource I pick, that the part is able to hold?

It's a bit convoluted but it should be possible

I'll write you an example as soon as I have a pc

 

Link to comment
Share on other sites

9 hours ago, Bit Fiddler said:

Another question..  Can MM modify my Texture replacer @default.cfg?

Yes.  MM really doesn't have any knowledge of how any specific configs are used in KSP - KSP loads all configs in GameData (but not inside a folder called PluginData) into memory, then MM looks at which ones are patches and applies them.  Then KSP actually does things with them, like creating parts etc.  I took a quick peak at Texture Replacer's code and it is set up in a way that allows all of this to work.

Actually looks like it might not work since TextureReplacer accesses that stuff before MM has a chance to process it.

Edited by blowfish
Link to comment
Share on other sites

44 minutes ago, blowfish said:

Yes.  MM really doesn't have any knowledge of how any specific configs are used in KSP - KSP loads all configs in GameData (but not inside a folder called PluginData) into memory, then MM looks at which ones are patches and applies them.  Then KSP actually does things with them, like creating parts etc.  I took a quick peak at Texture Replacer's code and it is set up in a way that allows all of this to work.

Last time I tried to edit TR node it didn't work, are you sure?

I mean, it works if I write the node, but the mm patches don't seem to affect it

Edited by Sigma88
Link to comment
Share on other sites

49 minutes ago, Sigma88 said:

Last time I tried to edit TR node it didn't work, are you sure?

Can confirm, just checked my cache file and I see the changes.

@TextureReplacer
{
  @paths = KSPRC/PluginData/ KSPRC/Textures/
  @visorReflectionColour = 0.55 0.40 0.03
}

But @Bit Fiddler you don't have to modify @default with MM - if you just create your own config file TR will overwrite any of its default values with the ones you provide

Edited by Drew Kerman
Link to comment
Share on other sites

21 minutes ago, Drew Kerman said:

Can confirm, just checked my cache file and I see the changes.


@TextureReplacer
{
  @paths = KSPRC/PluginData/ KSPRC/Textures/
  @visorReflectionColour = 0.55 0.40 0.03
}

But @Bit Fiddler you don't have to modify @default with MM - if you just create your own config file TR will overwrite any of its default values with the ones you provide

when I tried it, the changes were of course applied by MM and the cache file did in fact show them

the problem was that TR seemed to either read the cfg directly from the file or anyways read it before MM had a chance to edit it

just to be on the safe side I'm going to test it right now

Link to comment
Share on other sites

Just now, Sigma88 said:

the problem was that TR seemed to either read the cfg directly from the file or anyways read it before MM had a chance to edit it

oh! I see what you are saying now. To be honest I never checked if the patch I posted was actually working beyond checking the changes were made via MM

Link to comment
Share on other sites

3 minutes ago, Drew Kerman said:

oh! I see what you are saying now. To be honest I never checked if the patch I posted was actually working beyond checking the changes were made via MM

I would love to have that functionality, but honestly I'm not even sure that it would be possible for TR to do that.

I feel like when MM applies the patches is too late to edit the textures succesfully

Just now, Bit Fiddler said:

but do I need to put this config in the texture replacer folder?  or can I keep it separate so reinstalls do not erase it? 

I guess this is more a question for texture replacer thread.

yes you can put a cfg in your folder, but it can't be a MM patch, it has to be a complete node so it gets loaded by KSP at startup

Link to comment
Share on other sites

7 hours ago, Sigma88 said:

when I tried it, the changes were of course applied by MM and the cache file did in fact show them

the problem was that TR seemed to either read the cfg directly from the file or anyways read it before MM had a chance to edit it

just to be on the safe side I'm going to test it right now

Oh wait, you're right.  I looked at what TR was doing, but not when it was doing it.  The game database is accessed in a KSPAddon which starts up instantly, so MM won't have run at that point

https://github.com/ducakar/TextureReplacer/blob/866fc7388412ef7ce6d2a9d6eb453befe3af0364/TextureReplacer/TextureReplacer.cs

Edited by blowfish
Link to comment
Share on other sites

Okay, can someone please explain how to use :AFTER properly, because i cant see any issue with what im doing. but it does nothing to the node im trying to edit.

@TechTree:NEEDS[AirplanePlus]
{
    @RDNode:HAS[#id[bigPlanes]]:AFTER[STT_Core]
	{
		@id = TEST
		@title = TEST
		@description = Rocket Engines that use Liquid Hydroned and oxygen to run and provide much greater eficiency.
		@cost = 100
		@hideEmpty = False
		@nodeName = node60_TEST
		@anyToUnlock = False
		@icon = RDicon_rocketry-advanced
		@pos = 0,0,0
		@scale = 0.6
		!Parent,* {}
		Parent
		{
			parentID = betterEngines
			lineFrom = RIGHT
			lineTo = LEFT
		}
	}
}

Location of mod im trying to edit:   C:\...\Desktop\Folders\KSP\Installs\STT Testing\GameData\STT_Core

This Patch:   C:\...\Desktop\Folders\KSP\Installs\STT Testing\GameData\STT_ModSupport

and yes, airplane plus is installed

Link to comment
Share on other sites

2 minutes ago, Sigma88 said:

@ThePhoenixSol I think the AFTER has to go on the uppermost node

swear to god i tried that and nothing, but now i ask for help, and do it to double check, and it works XD. Thanks sigma. I guess i needed it on the upper node, AND some other fixes i tried... idk what ones, but its working. thanks.

Link to comment
Share on other sites

Apologies if this has been asked before, had a rake around and couldn't find something exactly what I'm after - is there a way to add additional resource toggle options to the stock drill?

Would like to add an option on the stock drill to mine MetalOre from EPL while retaining the option to mine Ore as well. Something along the lines of the stock IRSU where you have multiple actions that can be toggled on or off independently of each other.

 

Have added the following to DrillUpdates.cfg in the root of the GameData folder - am I missing something very obvious as to why this wouldn't work?

 

@PART[RadialDrill]

MODULE,0
        MODULE {
        name = ExExtractor
        ConverterName = Metal Ore
        ResourceName = MetalOre
        Rate = 4
        INPUT_RESOURCE {
            ResourceName = ElectricCharge
            Ratio = 24
                        }
                }

Edited by Das_Sheep
Further Detail
Link to comment
Share on other sites

how can I find the proper "name" for    :needs[ ]

my understanding is that if a mod has a .dll the name of that .dll is used here.  however I am also led to believe that if a mod does not have a .dll the mod author can somehow still give MM a "name" so others can use :For[ ] or :After[ ] etc.

 

the question is how can I find this name?  how and where is that defined?

 

 

Edited by Bit Fiddler
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...