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, User456321 said:

How do you go about adding stuff instead of replacing

Section I want to modify is currently:

I want to ADD resources to this, however using the following replaces rather than adds resources.


@PART[C3_Kontainer_01]
{
  @MODULE[FSfuelSwitch]
  {
    @resourceNames = MetalOre;Metal;RocketParts;ScrapMetal
    @resourceAmounts = 2000;2000;2000;2000
    @initialResourceAmounts = 0;0;0;0  // Always use 0, start empty
    @tankCost = 2602;19210;3490;1258 // Total resource cost when full plus container cost
  }
}

 

Two ways:

@value ^= :$:extrastuff: // uses regular expression syntax

@value = #$value$extrastuff

e.g. using second method for your example

@PART[C3_Kontainer_01]
{
  @MODULE[FSfuelSwitch]
  {
    @resourceNames = #$resourceNames$;MetalOre;Metal;RocketParts;ScrapMetal
    @resourceAmounts = #$resourceAmounts$;2000;2000;2000;2000
    @initialResourceAmounts = #$initialResourceAmounts$;0;0;0;0  // Always use 0, start empty
    @tankCost = #$tankCost$;2602;19210;3490;1258 // Total resource cost when full plus container cost
  }
}

 

Edited by Aelfhe1m
trimmed quoted text
Link to comment
Share on other sites

Ah this seems to work (partly)

// first create the part
+PART[landerCabinSmall]:AFTER[Squad]
{
    @name = MacLuky.LanderCanMk12
    @title = Mk1 Lander Can Refurbished
    @manufacturer = MacLuky Space Solutions
	@description = After observing subway commuters during rush hour our lead engineer figured out how to add 2 more seats to the interior.
    @mass *= 1.02
    @entryCost *= 1.2
	@cost *= 1.2
	@CrewCapacity = 3

	@INTERNAL
	{
		@name = MacLuky.LanderCanMk12.Internal
	}
}

// then patch the model
@PART[MacLuky.LanderCanMk12]:AFTER[MacLuky]
{
	!mesh = DELETE
    MODEL
	{
		model = Squad/Parts/Command/mk1LanderCan/model
		texture = ksp_s_landerCan_diff, MacLuky_Dev/LanderCanMk12/ksp_s_landerCan_diff
	}
}

However, the new texture is not showing up, probably due to Ven's stock revamp. I'll create a vanilla install to resume testing but at least the part now shows up.

Link to comment
Share on other sites

3 hours ago, MacLuky said:

Ah this seems to work (partly)

However, the new texture is not showing up, probably due to Ven's stock revamp. I'll create a vanilla install to resume testing but at least the part now shows up.

Try removing the :AFTER[Squad] from the first patch.

:AFTER[] statements are processed in alphabetic order so so the second patch will not run because the part is created during :AFTER[Squad] but it's trying to modify it during :AFTER[MacLuky]

Link to comment
Share on other sites

@ShiningNeedle First of all please don't just copy/paste logs into the forum - it causes bloat and performance issues for many users. Post them on a file sharing service like DropBox and post a link in the forum.

As to your issue. I can't see how MM would affect this. All MM patching is long since done when you get to the editor.

Your log shows no MM related errors, but there are a lot of FAR related ones - major one being missing ModularFlightIntegrator.

Quote

[WRN 13:25:22.937] AssemblyLoader: Assembly 'FerramAerospaceResearch' has not met dependency 'ModularFlightIntegrator' V1.0
[WRN 13:25:22.938] AssemblyLoader: Assembly 'FerramAerospaceResearch' is missing 1 dependencies

Also note FAR is not yet released for 1.3 and it is not recommended to try the dev version unless you're confident you know what you're doing and are capable of troubleshooting your install.

Link to comment
Share on other sites

I have a question regarding adding parts to contract requirements. I have been told that the ISRU i wanted to add does not fulfill the contract (at least for one user).
For the other parts like the cupola it is working. I believe that this might have to do with the fact that there are already two ISRUs that can fulfill a contract.

Currently the script looks like this:

@Contracts
{
    @Base
    {
        @PART_REQUEST[#Part[ISRU,MiniISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
        @CREW_REQUEST[#Part[ISRU,MiniISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
    }
    @Station
    {
        @PART_REQUEST[#Part[ISRU,MiniISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
        @CREW_REQUEST[#Part[ISRU,MiniISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
    }
}

Does the request have to look different for the ISRU or is it sufficient when i look for only one ISRU in the contract?

Link to comment
Share on other sites

To add on to what @Nils277 is asking, would there be a way to write a patch where it looks for anything with ModuleResourceConverter, or the right sort at least, so that stations or whatever that run on something other than ore products can have their ISRU counted? Like gas separators or nuclear fuel processors?

Link to comment
Share on other sites

@MacLuky Don't do anything that will result in float values for part cost. (not sure about entryCost, that might also be bad, I forget)

cost has to be an integer. If the part loader tries to parse a float when it expects an integer it will throw exceptions and smash the parts list in the VAB. You will have missing parts.

Link to comment
Share on other sites

2 hours ago, Nils277 said:

Does the request have to look different for the ISRU or is it sufficient when i look for only one ISRU in the contract?

Stick in a :HAS and it works with just ISRU. i.e.

//Add the planetary ISRU to satisfy the base contracts
@Contracts
{
    @Base
    {
        @PART_REQUEST:HAS[#Part[ISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
        @CREW_REQUEST:HAS[#Part[ISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
    }
    @Station
    {
        @PART_REQUEST:HAS[#Part[ISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
        @CREW_REQUEST:HAS[#Part[ISRU]]
        {
            Part = KKAOSS_ISRU_g
        }
    }
}

Edit: to specify both ISRUs using the following worked in my test

:HAS[#Part[ISRU],#Part[MiniISRU]]

 

Edited by Aelfhe1m
extra info
Link to comment
Share on other sites

@Aelfhe1m Thanks a lot! I must have been really blind to miss out the "HAS" part...Just looked at the config for the other parts and they all have it. :rolleyes:

Edit: "they all have it" was a bit exaggerated..lets say most of them...

Edited by Nils277
Link to comment
Share on other sites

1 minute ago, Nils277 said:

@Aelfhe1m Thanks a lot! I must have been really blind to miss out the "HAS" part...Just looked at the config for the other parts and they all have it. :rolleyes:

Happens all the time when I look at my code and only see what I expect to see rather than what's really there. :wink:

PS: last patch in that file is also missing :HAS

Link to comment
Share on other sites

1 minute ago, Aelfhe1m said:

Happens all the time when I look at my code and only see what I expect to see rather than what's really there. :wink:

PS: last patch in that file is also missing :HAS

Yep, there were multiple ones missing that :wink: Will go trough all of them. 

Link to comment
Share on other sites

so i am trying to make a script that takes an LF only fuel tank and turns it into an LH2 fuel tank. got a big messy thing that (sorta) makes sense.

//script for changing a LF tank for an LH2 tank.
@PART[softTankMK1|softTankMK2|softTankMK3|softTankMK4|softTankMK5|size2nuclearEngine]:NEEDS[CryoTanks]:FIRST
{
   %LF = #$RESOURCE[LiquidFuel]/maxAmount$

	%massOffset = #$LF$
	@massOffset *= 0.0005 //Strucural mass for LF
	@massOffset *= -1

	@mass += #$massOffset$ // subtracting strucural mass. for a normal tank, mass is now 0. if engine is attached, mass is now mass of engine without tank.

    @RESOURCE[LiquidFuel]
        {
        @name = LqdHydrogen
        @amount *= 5.0
        @maxAmount *= 5.0
        }

    %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$

	@massOffset = #$LH2$
	@massOffset *= 0.00001417

	@mass += #$massOffset$ //adds structural mass for LH2 storage. we have changed out the tank!
}

 

i get these errors in the logs. I must say, i have no clue what they mean or why the variable search is not working.

[LOG 14:59:34.331] [ModuleManager] Error - Cannot parse variable search when replacing (%) key LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
[LOG 14:59:34.331] [ModuleManager] Cannot find key LH2 in PART
[LOG 14:59:34.331] [ModuleManager] Error - Cannot parse variable search when editing key massOffset = #$LH2$
[LOG 14:59:34.332] [ModuleManager] Applying node VenStockRevamp/SoftTanksLH2/@PART[softTankMK1|softTankMK2|softTankMK3|softTankMK4|softTankMK5|size2nuclearEngine]:FIRST to VenStockRevamp/Part Bin/NewParts/SoftTanks/softTankMK1/softTankMK1
[LOG 14:59:34.332] [ModuleManager] Error - Cannot parse variable search when replacing (%) key LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
[LOG 14:59:34.332] [ModuleManager] Cannot find key LH2 in PART
[LOG 14:59:34.332] [ModuleManager] Error - Cannot parse variable search when editing key massOffset = #$LH2$
[LOG 14:59:34.332] [ModuleManager] Applying node VenStockRevamp/SoftTanksLH2/@PART[softTankMK1|softTankMK2|softTankMK3|softTankMK4|softTankMK5|size2nuclearEngine]:FIRST to VenStockRevamp/Part Bin/NewParts/SoftTanks/softTankMK2/softTankMK2
[LOG 14:59:34.332] [ModuleManager] Error - Cannot parse variable search when replacing (%) key LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
[LOG 14:59:34.333] [ModuleManager] Cannot find key LH2 in PART
[LOG 14:59:34.333] [ModuleManager] Error - Cannot parse variable search when editing key massOffset = #$LH2$
[LOG 14:59:34.333] [ModuleManager] Applying node VenStockRevamp/SoftTanksLH2/@PART[softTankMK1|softTankMK2|softTankMK3|softTankMK4|softTankMK5|size2nuclearEngine]:FIRST to VenStockRevamp/Part Bin/NewParts/SoftTanks/softTankMK3/softTankMK3
[LOG 14:59:34.333] [ModuleManager] Error - Cannot parse variable search when replacing (%) key LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
[LOG 14:59:34.333] [ModuleManager] Cannot find key LH2 in PART
[LOG 14:59:34.333] [ModuleManager] Error - Cannot parse variable search when editing key massOffset = #$LH2$
[LOG 14:59:34.333] [ModuleManager] Applying node VenStockRevamp/SoftTanksLH2/@PART[softTankMK1|softTankMK2|softTankMK3|softTankMK4|softTankMK5|size2nuclearEngine]:FIRST to VenStockRevamp/Part Bin/NewParts/SoftTanks/softTankMK4/softTankMK4
[LOG 14:59:34.334] [ModuleManager] Error - Cannot parse variable search when replacing (%) key LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
[LOG 14:59:34.334] [ModuleManager] Cannot find key LH2 in PART
[LOG 14:59:34.334] [ModuleManager] Error - Cannot parse variable search when editing key massOffset = #$LH2$
[LOG 14:59:34.334] [ModuleManager] Applying node VenStockRevamp/SoftTanksLH2/@PART[softTankMK1|softTankMK2|softTankMK3|softTankMK4|softTankMK5|size2nuclearEngine]:FIRST to VenStockRevamp/Part Bin/NewParts/SoftTanks/softTankMK5/softTankMK5
[LOG 14:59:34.334] [ModuleManager] Error - Cannot parse variable search when replacing (%) key LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
[LOG 14:59:34.334] [ModuleManager] Cannot find key LH2 in PART
[LOG 14:59:34.334] [ModuleManager] Error - Cannot parse variable search when editing key massOffset = #$LH2$

EDIT: the part dealing with liquidfuel works, but the LH2 part does not. is it because it tries to retrieve the value of LH2 before it has changed out the lf for LH2?

Edited by toric5
fixed syntax error
Link to comment
Share on other sites

@toric5 That's because all the values are processed before all the nodes, so you're trying to access the LH2 resource when it's still LiquidFuel.  There's nothing ModuleManager can do about this, it's a consequence of how KSP stores the nodes.  Split the bottom bit into its own patch and it should work.

Link to comment
Share on other sites

3 minutes ago, blowfish said:

@toric5 That's because all the values are processed before all the nodes, so you're trying to access the LH2 resource when it's still LiquidFuel.  There's nothing ModuleManager can do about this, it's a consequence of how KSP stores the nodes.  Split the bottom bit into its own patch and it should work.

thanks. i ended up doing this:

    @LF *= 5.0 //LF now means the amount of LH2

	@massOffset = #$LF$
	@massOffset *= 0.00001417

	@mass += #$massOffset$ //adds structural mass for LH2 storage. we have changed out the tank!

 

Link to comment
Share on other sites

I am trying to add the functionality of the Science Box to all command modules. Specifically the 'Collect all data' function.

Using this MM patch does not seem to work.

@PART[*]:HAS[@MODULE[ModuleCommand]]:FINAL
{
    %MODULE
	{
		name = ModuleScienceContainer
		
		reviewActionName = Review Stored Data
		storeActionName = Store Experiments
		evaOnlyStorage = True // i.e. can nearby regular vessels also do this, or EVA only
		storageRange = 1.3
		canBeTransferredToInVessel = True
		canTransferInVessel = True
		showStatus = True
	}
}

If I understand things correctly this should...

Find all parts, that have the ModuleCommand module.
then either edit or create the module specified. (which is an exact copy from the science box .cfg)

 

I am still only getting the default command pod crew report/review data buttons.

Link to comment
Share on other sites

38 minutes ago, Nachocuban said:

I am trying to add the functionality of the Science Box to all command modules. Specifically the 'Collect all data' function.

Using this MM patch does not seem to work.


@PART[*]:HAS[@MODULE[ModuleCommand]]:FINAL
{
    %MODULE
	{
		name = ModuleScienceContainer
		
		reviewActionName = Review Stored Data
		storeActionName = Store Experiments
		evaOnlyStorage = True // i.e. can nearby regular vessels also do this, or EVA only
		storageRange = 1.3
		canBeTransferredToInVessel = True
		canTransferInVessel = True
		showStatus = True
	}
}

If I understand things correctly this should...

Find all parts, that have the ModuleCommand module.
then either edit or create the module specified. (which is an exact copy from the science box .cfg)

 

I am still only getting the default command pod crew report/review data buttons.

I'm pretty new to MM, but I think you need to specify that you want to create or copy the ModuleScienceContainer module using

%MODULE[ModuleScienceContainer]

EDIT: Actually, probably need the % symbol in front of all the key values too, but you shouldn't need to specify the name key as that is specified in the module name

@PART[*]:HAS[@MODULE[ModuleCommand]]:FINAL
{
    %MODULE[ModuleScienceContainer]
	{
		%reviewActionName = Review Stored Data
		%storeActionName = Store Experiments
		%evaOnlyStorage = True // i.e. can nearby regular vessels also do this, or EVA only
		%storageRange = 1.3
		%canBeTransferredToInVessel = True
		%canTransferInVessel = True
		%showStatus = True
	}
}

 

Edited by strudo76
More information
Link to comment
Share on other sites

ksp.sarbian.com is down.

CKAN can't connect to download 1.8.1.

Looking for an alternate source until the site comes back online.
If you're reading this and you know another source where I can get the 1.8.1 zip CKAN is looking for, to pre-load it into CKAN cache, please send it along.

Otherwise, this is just a heads up that the server is currently offline.

Link to comment
Share on other sites

1 hour ago, Roninpawn said:

Looking for an alternate source until [ ksp.sarbian.com ] comes back online.

If you're reading this and you know another source where I can get the 1.8.1 zip CKAN is looking for, to pre-load it into CKAN cache, please send it along.

ksp.sarbian.com still appears down.  Here's a true copy of the 2.8.1 .dll .zip as I downloaded it earlier this week.

http://www.cuug.ab.ca/jacke/KSP/MM/ModuleManager.2.8.1.zip

It'll be up for a short time as I will be leaving in just over an hour to go to the Calgary ceremony for the 75th Anniversary of the Dieppe Raid, Operation Jubilee, on 19 August 1942.  Lest we forget.

Link to comment
Share on other sites

1 hour ago, Jacke said:

ksp.sarbian.com still appears down.  Here's a true copy of the 2.8.1 .dll .zip as I downloaded it earlier this week.

http://www.cuug.ab.ca/jacke/KSP/MM/ModuleManager.2.8.1.zip

It'll be up for a short time as I will be leaving in just over an hour to go to the Calgary ceremony for the 75th Anniversary of the Dieppe Raid, Operation Jubilee, on 19 August 1942.  Lest we forget.

Thanks for an alternate source!

Link to comment
Share on other sites

2 hours ago, Moorleiche2k said:

Can anyone up this file once more? Would be awesome as i wanted to start over. Maybe uploaded temporarily to a dropbox or google drive? i mean, there are not many ppl that need that file ;).

Thanks in advance

sarbian's site is online

Edited by Sigma88
Link to comment
Share on other sites

Had a Module Manager script like this (using Module Manager 2.8.1):

Spoiler

@PART[*]:HAS[@MODULE[ModuleCommand]|@MODULE[KerbalSeat]]:NEEDS[MechJeb2]:FINAL
{
     // code block
}

 

It was working on every part with a ModuleCommand.  It wasn't working on the External Command Seat.  Until I changed it to this.

Spoiler

@PART[*]:HAS[@MODULE[ModuleCommand]]:NEEDS[MechJeb2]:FINAL
{
     // code block
}
//
@PART[*]:HAS[@MODULE[KerbalSeat]]:NEEDS[MechJeb2]:FINAL
{
     // code block
}

 

Really thought the first version would work.

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