Jump to content

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


sarbian

Recommended Posts

Hello,

I'm having a little trouble working out how to create a new part using an MM patch. I want to duplicate the two Ore Holding Tanks and then change the resource it holds. So in game i'll have the two ore tanks PLUS two copies that hold a different resource. Is this possible?

Cheers 

Link to comment
Share on other sites

@sarbian I have a patch which was working nicely with MM 2.6.24, but version 2.6.25 says that it has errors:

My patch:

@PART[*]:HAS[@MODULE[ModuleDeployableSolarPanel]]
{
    %node_stack_root = #$node_attach$
    @attachRules = 1,1,0,0,1
    @bulkheadProfiles = size1, srf
}

The excerpt from the outputlog.txt

[ModuleManager] Errors in patch prevents the creation of the cache
 
[ModuleManager] ModuleManager: 10689 patches applied, found 7 errors
7 errors related to GameData/_MyMods_/AttachmentNodes.cfg

Is there something I can do to make it work?

Edited by Enceos
Link to comment
Share on other sites

6 minutes ago, Enceos said:

@sarbian I have a patch which was working nicely with MM 2.6.24, but version 2.6.25 says that it has errors:

My patch:


@PART[*]:HAS[@MODULE[ModuleDeployableSolarPanel]]
{
    %node_stack_root = #$node_attach$
    @attachRules = 1,1,0,0,1
    @bulkheadProfiles = size1, srf
}

The excerpt from the outputlog.txt


[ModuleManager] Errors in patch prevents the creation of the cache
 
[ModuleManager] ModuleManager: 10689 patches applied, found 7 errors
7 errors related to GameData/_MyMods_/AttachmentNodes.cfg

How do I make my patch work?

That part of the log is useless

But I bet your error stems from the fact that you want to copy "node_attach" but you don't check if that value actually exists

Try using this:

@PART[*]:HAS[#node_attach[*],@MODULE[ModuleDeployableSolarPanel]]

Not sure if the underscore might mess it up tho

Link to comment
Share on other sites

I'm trying to read something from one place and put it into another, and getting errors about interpolating variables.  Simplified example case:

// File 1
PART
{
// Standard part stuff
  
  MODULE
  {
    name = Container_Solids
    objectNames = Kontainer
    baseVolume = 160000
  }
}

// File 2
@PART[*]:HAS[@MODULE[Container_Solids]]
{
    @MODULE[Container_Solids]
    {
        &halfVolume = #$baseVolume$  // No errors here
        @halfVolume *= 0.5
    }
  
  	MODULE
	{
	    name = testing_module
        objectNames = #$/@MODULE[Container?Solids]/objectNames$  // Error interpolating value here.
    }
}

I've also tried with an underscore, and using `#$/Container_Solids/objectNames$`, as well as using relative paths (`../`) instead of absolute.  Is there a way to do this?

Link to comment
Share on other sites

Unfortunately, I've read enough stuff on MM and it doesn't seem to be making much sense. My only defense here is that I'm a newbie or just plain dumb. I'd go with the latter. My question refers to parts and how that's handled. I'll also refer to these two mods in particular Kerbalism + Universal Storage (<- this is tied to TACLS). Granted, US is well known and famous, but Kerbalism just showed up on the LS playing field. Within Kerbalism is a profile system that lets users pick and choose how the mod behaves (All of which follow MM protocal). Currently, mod devs are supporting only the Kerbalism default profile, and that is how it should be, but things go awry when using any other profile. I'll try and keep this as brief as possible:

So when I have kerbalism with the 'realism' profile as well as US, the food bag doesn't show up. I'd assume its because of this line in US part config: (Part name is US_1R320_Wedge_Food)

PART:NEEDS[TacLifeSupport|IFILifeSupport|Snacks|USILifeSupport] < It's at the very top of the file.

Is there any way I can bypass that line and make the part show up regardless of its needs? Maybe some way to make it happen before US kicks in? Or is altering the US part file the only way to do this?

Also, I don't want to use MM trickery with @Kerbalism:FOR[TacLifeSupport] {}, cuz that opens up a huge can of worms. None of which Kerbalism deals with properly.

Any suggestions appreciated,

Thanks

Link to comment
Share on other sites

6 hours ago, Sigma88 said:

That part of the log is useless

But I bet your error stems from the fact that you want to copy "node_attach" but you don't check if that value actually exists

Try using this:

@PART[*]:HAS[#node_attach[*],@MODULE[ModuleDeployableSolarPanel]]

Not sure if the underscore might mess it up tho

You know what, that totally works. And you're awesome!

Link to comment
Share on other sites

11 hours ago, DStaal said:

I'm trying to read something from one place and put it into another, and getting errors about interpolating variables.  Simplified example case:


// File 1
PART
{
// Standard part stuff
  
  MODULE
  {
    name = Container_Solids
    objectNames = Kontainer
    baseVolume = 160000
  }
}

// File 2
@PART[*]:HAS[@MODULE[Container_Solids]]
{
    @MODULE[Container_Solids]
    {
        &halfVolume = #$baseVolume$  // No errors here
        @halfVolume *= 0.5
    }
  
  	MODULE
	{
	    name = testing_module
        objectNames = #$/@MODULE[Container?Solids]/objectNames$  // Error interpolating value here.
    }
}

I've also tried with an underscore, and using `#$/Container_Solids/objectNames$`, as well as using relative paths (`../`) instead of absolute.  Is there a way to do this?

Oh, just to add the relevant line from the log appears to be:

[LOG 15:21:42.730] [ModuleManager] Error - Cannot parse variable search when inserting new key objectNames = #$/@MODULE[Container?Solids]/objectNames$

I can post more of the log if you want, but as far as I can tell that's the only place it mentions anything on this.  (Besides the line saying there was 1 error in $hugenum$ patches.)

Link to comment
Share on other sites

On 6/4/2016 at 11:21 AM, dboi88 said:

Hello,

I'm having a little trouble working out how to create a new part using an MM patch. I want to duplicate the two Ore Holding Tanks and then change the resource it holds. So in game i'll have the two ore tanks PLUS two copies that hold a different resource. Is this possible?

Cheers 

Hi guy's i still can't work this out. Does anyone know if this is possible?

Link to comment
Share on other sites

On 6/4/2016 at 6:21 AM, dboi88 said:

Hello,

I'm having a little trouble working out how to create a new part using an MM patch. I want to duplicate the two Ore Holding Tanks and then change the resource it holds. So in game i'll have the two ore tanks PLUS two copies that hold a different resource. Is this possible?

Cheers 

+PART[PartName]
{
	// You must rename the new part
	@name = NewPartName
	
	// Delete the Ore resource
	!RESOURCE[Ore]{}
	
	// Add your new resources here
}

 

Link to comment
Share on other sites

2 hours ago, CoriW said:

Quick question, would this work?


@PART[part1,part2,part3]
{
	...do stuff...
}

 

I don't know if commas work there but I know that | does work:

@PART[part1|part2|part3]
{
	...do stuff...
}

 

Link to comment
Share on other sites

32 minutes ago, Starwaster said:

I don't know if commas work there but I know that | does work:


@PART[part1|part2|part3]
{
	...do stuff...
}

 

even if commas worked that would require the part to have

name = part1 AND name = part2 AND name = part3

:)

Link to comment
Share on other sites

4 minutes ago, Vermil said:

Tell me if I understand this correctly: If I use this Modulemanager.2.6.25.dll, it won't work together with the KSP 64-bit client, right? Only with the 32-bit client, right?

64 bit is fine now.  But MM never disabled itself entirely on 64 bit, whereas some other mods did.

Link to comment
Share on other sites

5 hours ago, Starwaster said:

I don't know if commas work there but I know that | does work:


@PART[part1|part2|part3]
{
	...do stuff...
}

 

Oh, yeah I suppose that'd make more sense than using "and" due to the issue @Sigma88 mentioned. So by using | I'll be able to edit multiple parts at the same time in the "...do stuff..." part of that, correct?

Link to comment
Share on other sites

18 minutes ago, CoriW said:

Oh, yeah I suppose that'd make more sense than using "and" due to the issue @Sigma88 mentioned. So by using | I'll be able to edit multiple parts at the same time in the "...do stuff..." part of that, correct?

Yes, exactly as I did it in that example. part1, part2 and part3 would all have the same config applied to them. I don't know if there are any real limits as to how many parts you can do at once but there are practical limits in that you might find it inconvenient do cram too many on one line.

Link to comment
Share on other sites

How complex can math get in ModuleManage configs? I'd like to use this equation in an SRB config to input the burn time for the SRB, but I just want to make sure that first of all MM can do these kinds of equations in configs and secondly I'm unsure how exactly to convert this equation into something MM will understand. (As it'll need to check several of the properties of the SRB in order to do the calculation)

(TotalMass - DryMass) / (N / (Isp * 9.81))

Also assuming that this can be done, I would like the output to be put into a floatCurve in the config... Can you do calculations in floatCurve keys? Or somehow output the result of a calculation into a floatCurve key?

Link to comment
Share on other sites

17 minutes ago, CoriW said:

How complex can math get in ModuleManage configs? I'd like to use this equation in an SRB config to input the burn time for the SRB, but I just want to make sure that first of all MM can do these kinds of equations in configs and secondly I'm unsure how exactly to convert this equation into something MM will understand. (As it'll need to check several of the properties of the SRB in order to do the calculation)

(TotalMass - DryMass) / (N / (Isp * 9.81))

Also assuming that this can be done, I would like the output to be put into a floatCurve in the config... Can you do calculations in floatCurve keys? Or somehow output the result of a calculation into a floatCurve key?

if you show me where those values are I can make a cfg example for you.

 

Link to comment
Share on other sites

36 minutes ago, Sigma88 said:

if you show me where those values are I can make a cfg example for you.

 

Alright, thank you. :)

Slight change in the calculation as it didn't occur to me that SRB's don't have a mentioned total mass, just dry mass. Since SolidFuel weighs in at 7.5kg / unit we can just use that accompanied with fuel amount, located here:

b06d3e169f226aac4afc0f675163ab55.png

So amount * 7.5 will give us the fuel mass, then we'll also need the Newtons of thrust, as well as the Isp, both of which are located here:

62fc6d2c86c9f243768d4814489b48b4.png

Now the maxThrust is listed in kN, so we'll have to multiply it by 1000 in order to convert to N, so maxThrust * 1000. As for the Isp, that can be located in the first key in the atmosphereCurve... I'm not sure how you'd go about reading that key so for sake of putting together a reference calculation I'll just call it "key" for now.

Alright so with all of that we now have our calculation, which is referencing parts of the config. (amount * 7.5) / ((maxThrust * 1000) / (key * 9.81)) , in this case it would be (140 * 7.5) / ((192 * 1000) / (165 * 9.81)) = 8.8519921875 and I would need that key to be put into a floatCurve as a key value.

For clarity sake, I'll also provide the part of the cfg where I need the calculation to be placed.

MODULE
{
      name = TestFlightReliability_EngineCycle
      ratedBurnTime = (CALCULATION)*1.5
      cycle
      {
            key = 0 15.0
            key = 5 1.0 -0.8 0
            key = ((CALCULATION)*1.5)+5  1.0 0 0
            key = (((CALCULATION)*1.5)+5)*1.5 100 0 0
      }
}

 

Edited by CoriW
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...