Jump to content

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


sarbian

Recommended Posts

Looking for a bit of syntax/patch-writing help.

Here's the file I want to override [a Kerbal Konstructs static definition]:

Spoiler

STATIC
{
	pointername = KS_TaxiLarge
	Instances
	{
		UUID = eafa019d-f362-4147-aa78-4b509b02db02
		CelestialBody = Kerbin
		RelativePosition = 273.061981,2.94449997,277.290771
		Orientation = 359.959137,255.041763,-0.000703487894
		isScanable = False
		ModelScale = 1
		VisibilityRange = 25000
		Group = KSCUpgrades
		GrasColor = 0.639999986,0.727999985,0.171000004,0.728999972
		GrasTexture = BUILTIN:/terrain_grass00_new
	}
}

 

Here's the stab I've taken so far. Am I on the right track? Can this be done?:

@STATIC[*]:HAS[pointername[KS_TaxiLarge]]
{
	@Orientation = 90.959137,100.041763,-0.000703487894
}

And yes, I know I ultimately need to point to the UUID instead.

Link to comment
Share on other sites

Hoping someone can help me with this, as I can't see the syntax issue...

I'm getting several warnings that look like below from a contract pack.

[WRN 08:05:29.579] unrecognized trailer: '' on: ContractPacks/GAP/Flights/Airline-Flight-122/CONTRACT_TYPE:NEEDS[SquadExpansion/MakingHistory]
 

If I comment out the :NEEDS, the warning goes away.  I can't figure out why it doesn't like the needs.

This is the beginning of the file.

CONTRACT_TYPE:NEEDS[SquadExpansion/MakingHistory]
{

    sortKey = 20

REQUIREMENTS FOR CONTRACT TO APPEAR

    REQUIREMENT
    {
        name = CompleteContract
        type = CompleteContract
        
        contractType = Wright-2500m
        minCount = 1

    }
    

Thanks!
 

 

Link to comment
Share on other sites

17 hours ago, blowfish said:

Okay, well if you're having trouble finding the information you need, maybe start with what information you're having trouble finding.  I've read plenty of logs and haven't had any issues but I also understand what MM is doing better than anyone.

 

17 hours ago, Lisias said:

No, sir. You are missing that there are people in need of better diagnosing tools, and would be better than such tools could be implemented on MM.

It's perfectly OK you not willing to do so. But so someone else will step up and fulfill the need.

The current way the mainstream MM works is less than ideal, and we (I'm not the only one) are  saying it to you.

I for one am happy with MM, which is better than what you find in most games out there where modding is easily accessible. Can it be improved - probably - but I must say it gives a lot of info already.

 

------------ I'm unhappy with this post merge :( ---------

 

9 hours ago, Beetlecat said:

Looking for a bit of syntax/patch-writing help.

Here's the file I want to override [a Kerbal Konstructs static definition]:

  Hide contents


STATIC
{
	pointername = KS_TaxiLarge
	Instances
	{
		UUID = eafa019d-f362-4147-aa78-4b509b02db02
		CelestialBody = Kerbin
		RelativePosition = 273.061981,2.94449997,277.290771
		Orientation = 359.959137,255.041763,-0.000703487894
		isScanable = False
		ModelScale = 1
		VisibilityRange = 25000
		Group = KSCUpgrades
		GrasColor = 0.639999986,0.727999985,0.171000004,0.728999972
		GrasTexture = BUILTIN:/terrain_grass00_new
	}
}

 

Here's the stab I've taken so far. Am I on the right track? Can this be done?:


@STATIC[*]:HAS[pointername[KS_TaxiLarge]]
{
	@Orientation = 90.959137,100.041763,-0.000703487894
}

And yes, I know I ultimately need to point to the UUID instead.

Try something like

@STATIC[*]:HAS[#pointername[KS_TaxiLarge]]
{
	@Instances
	{
		@Orientation = 90.959137,100.041763,-0.000703487894
	}
}

When Has point to a value different than name, you use # for has or ~ for has not, also see the documentation on that.

Then you need to edit the Instances node. In the code above I only edit the first "instance" of instances, use ",*" after for all.

 

Edited by Warezcrawler
Link to comment
Share on other sites

Thanks for the help!

Though I was informed (kinda obviously) that this would certainly "work" to override statics at runtime--but as soon as any base was edited and "saved," all patches would get written out into GameData, making all changes permanent. It would certainly be useful for a one-time mega patch to move bases around for stock-->JNSQ Kerbinside, for instance, but that's just making an extra step, and it's far easier just to overwrite the configs. :)

Ah, well. Live and learn.

Link to comment
Share on other sites

On 2/15/2020 at 4:37 PM, Lisias said:

Thanks, but I don't have problems on finding the information I need. I have problems on using Stock MM for that. :)

Well, perhaps you could actually explain the problems you have finding info with stock MM.  Because despite going back and forth for several posts about this, that information has still yet to emerge

 

<snip>

Link to comment
Share on other sites

8 hours ago, blowfish said:

Well, perhaps you could actually explain the problems you have finding info with stock MM.  Because despite going back and forth for several posts about this, that information has still yet to emerge

On this post, I stated why it would be better to have all the logging on the KSP.log:

Quote

I beg to differ. It makes it easier to look for problems on interactions of different modules - as we get a log of something exactly when it happens, and it makes easier to detect when a problem happens always after something "weird".

I also talked about it here:

Quote

The current MM log is a report that cannot be easily used to solve more complex situations.

Copying the MM log as a blob in the middle of the log doesn't helps. we need the events being logged when it happens, so we can easily try to find correlations.

Having the MM log on a single file is not bad. What's hurting is not having that data on the KSP.log too so more complex reports can be built in a simple and straightforward way.

I assumed that you are a developer with knowledge if log files. KSP.log, by the way, is one of that logs I talk.

Do you see KSP shoving different logs in different files, based on the module that issued the entry? So we already have a model to follow.

I didn't expected that I would had to explain logs for you, my apologies. Do you need some assistance on this subject? I will glad to teach.

 

<snip>

Link to comment
Share on other sites

Some content has been removed.

 

Guys, remember that if you have a problem with a post or another user, please just report and the moderation staff will take a look.  There's no need to respond to a post you have the issue with.

 

Thank you.  Carry on.

 

Link to comment
Share on other sites

I have a MM patch which yields a warning, but I cannot figure out what the source is in the patch.

KSExpSeatMap 
{
	SeatTasks
	{
		name = ELWorkshop
		default = Workshop
	}
}
@PART[*]:HAS[@MODULE[ModuleCommand]:HAS[#minimumCrew[>0]],!MODULE[ELWorkshop]]
{
	MODULE 
	{
		name = ELWorkshop
		ProductivityFactor = 4
		IgnoreCrewCapacity = false
	}
}

@PART[mk2LanderCabin,Large_Crewed_Lab]:HAS[!MODULE[ELSurveyStation]]
{
	MODULE
	{
		name = ELSurveyStation
	}
}

@PART[crewCabin]
{
	MODULE 
	{
		name = ELWorkshop
		ProductivityFactor = 4
	}
}
@PART[MK1CrewCabin]
{
	MODULE 
	{
		name = ELWorkshop
		ProductivityFactor = 4
	}
}
@PART[mk4CrewCabin] 
{
	MODULE 
	{
		name = ELWorkshop
		ProductivityFactor = 4
	}
}

@PART[mk3CrewCabin]: 
{
	MODULE 
	{
		name = ELWorkshop
		ProductivityFactor = 4
	}
}
@PART[Large_Crewed_Lab]
{
	MODULE 
	{
		name = ELWorkshop
		ProductivityFactor = 7
	}
}

Can anyone see the issue in the MM patch above? Thanks!

Link to comment
Share on other sites

2 hours ago, Warezcrawler said:

I have a MM patch which yields a warning, but I cannot figure out what the source is in the patch.

Can anyone see the issue in the MM patch above? Thanks!

You have too many HAS blocks, and the second HAS is sitting within the first one

 

Quote

@PART[*]:HAS[@MODULE[ModuleCommand]:HAS//this is within the first HAS block[#minimumCrew[>0]],!MODULE[ELWorkshop]]

 

You probably want (untested):
 

Quote

@PART[*]:HAS[@MODULE[ModuleCommand], #minimumCrew[>0],!MODULE[ELWorkshop]]

 

 

Edited by severedsolo
Link to comment
Share on other sites

@Lisias Start with a problem statement.  What information do you need to see and what steps do you have to go through to get to it in stock MM.  Be specific.  Every actual change has to be motivated by a well understood actual problem, and you can try and propose solutions to poorly defined problems all day but nothing is going to change.

@Warezcrawler @PART[mk3CrewCabin]: not the trailing :

@severedsolo nested HAS is completely valid

Edited by blowfish
Link to comment
Share on other sites

12 hours ago, blowfish said:

@PART[mk3CrewCabin]: not the trailing :

THANKS!!!! How in the world I missed that I will never know! You are the best!

 

19 hours ago, severedsolo said:

You have too many HAS blocks, and the second HAS is sitting within the first one

Based on what blowfish pointed out I don't think this was the issue - furthermore this does actually do what I expect based on the MM cache.

breakdown
@PART[*]:
	HAS[
		@MODULE[ModuleCommand]:HAS[#minimumCrew[>0]]		<--- only when the part has ModuleCommand which has minimumcrew that is non zero
		,!MODULE[ELWorkshop]								<--- and the part does not have ELWorkshop
	]
-- i.e. intentional ---

But thanks for your response. All help is always appreciated :kiss:

Link to comment
Share on other sites

Hi, I'm trying to make a patch to update the old Keridian Dynamics smelters to the newer EPL smelter recipes which were created after KD was abandoned. I had no problem adding the new module (which isn't the stock resource converter module), but I'm not being able to delete the resource converter modules in the KD parts, so both the old and new converters show up. Can anyone kindly check what am I'm doing wrong?

This is the KD smelter part.cfg
 

Spoiler

 

// Keridian Dynamics
// KD-Furnace

PART
{
    // General parameters
    name = KD-Furnace
    module = Part
    author = Eleusis La Arwall

    // Asset parameters
    mesh = model.mu
    scale = 1
    rescaleFactor = 1

    // Node definitions - Position X, Position Y, Position Z, Up X, Up Y, Up Z
    node_stack_top = 0.0, 2.0, 0.0, 0.0, 2.0, 0.0, 2
    node_stack_bottom = 0.0, -2.0, 0.0, 0.0, -2.0, 0.0, 2
    node_attach = 0.0, 0.0, 1.3, 0.0, 0.0, -1.0
    CoMOffset = 0.0, -0.1, 0.0

    // Editor parameters
    TechRequired = experimentalScience
    entryCost = 863000
    cost = 104000
    category = Utility
    subcategory = 0
    title = KD-Furnace
    manufacturer = Keridian Dynamics
    description = This heavy blast furnace extracts Metal from Ore, MetalOre and ScrapMetal. During the process non-metallic compounds within the Ore/Scrap will be lost. Only 1 mass-% Metal can be obtained from Ore but up to 70 mass-% from MetalOre. The thermal extraction is the quick'n dirty way to refine Ore. The Metal-recycling works at 83 mass-%.

    // attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
    attachRules = 1,1,1,0,0

    // Standard part parameters
    mass = 12.75
    fuelCrossFeed = True
    bulkheadProfiles = size2, srf
    tags = conver furnace mine )mining (ore metal process smelt resource

    // Drag
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.2
    angularDrag = 2

    // Damage and Temperature
    crashTolerance = 20
    maxTemp = 2200

    // Modules
    MODULE
    {
        name = ModuleOverheatDisplay
    }
    MODULE
    {
        name = ModuleResourceConverter
        ConverterName = Ore-->Metal
        StartActionName = Start Ore --> Metal
        StopActionName = Stop Ore --> Metal    
        AutoShutdown = true
        TemperatureModifier
        {
            key = 0        200000
            key = 1800    50000
            key = 2200    30000
            key = 3000    3000
            key = 3600    0
        }
        GeneratesHeat = true
        DefaultShutoffTemp = .8
        ThermalEfficiency
        {
            key = 0        0.02    0        0
            key = 1000    0.1    0        0
            key = 2000    1    0        0
            key = 3000    0.01    0        0
        }
        UseSpecialistBonus = true            //    EB*[SBB+(EE*SEF)] ; EE=0-6
        SpecialistEfficiencyFactor = 0.05        //    SEF
        SpecialistBonusBase = 0.7            //    SBB
        ExperienceEffect = ConverterSkill        //    EE (NoSpecialist=0;FiveStarSpecialist=6)
        EfficiencyBonus = 1                //    EB
        INPUT_RESOURCE
        {
            ResourceName = Ore            //    Density(Ore) = 0.01
            Ratio = 8
            FlowMode = STAGE_PRIORITY_FLOW
          }
        INPUT_RESOURCE
        {
            ResourceName = ElectricCharge        //    Density(EC) = 0
            Ratio = 120                //    How much Ec is used per second.
        }
        OUTPUT_RESOURCE
        {
            ResourceName = Metal            //    Density(Metal) = 0.039
            Ratio = 0.02051281923            //    Yield = ~1% = 0.0205*0.039/(8*0.01)
            DumpExcess = false
            FlowMode = STAGE_PRIORITY_FLOW
        }
    }
    MODULE
    {
        name = ModuleResourceConverter
        ConverterName = MetalOre-->Metal
        StartActionName = Start MetalOre --> Metal
        StopActionName = Stop MetalOre --> Metal    
        AutoShutdown = true
        TemperatureModifier
        {
            key = 0        200000
            key = 1800    50000
            key = 2200    30000
            key = 3000    3000
            key = 3600    0
        }
        GeneratesHeat = true
        DefaultShutoffTemp = .8
        ThermalEfficiency
        {
            key = 0        0.02    0        0
            key = 1000    0.1    0        0
            key = 2000    1    0        0
            key = 3000    0.01    0        0
        }
        UseSpecialistBonus = true            //    EB*[SBB+(EE*SEF)] ; EE=0-6
        SpecialistEfficiencyFactor = 0.05        //    SEF
        SpecialistBonusBase = 0.7            //    SBB
        ExperienceEffect = ConverterSkill        //    EE (NoSpecialist=0;FiveStarSpecialist=6)
        EfficiencyBonus = 1                //    EB
        INPUT_RESOURCE
        {
            ResourceName = MetalOre            //    Density(MetalOre) = 0.0275
            Ratio = 0.1
            FlowMode = STAGE_PRIORITY_FLOW
          }
        INPUT_RESOURCE
        {
            ResourceName = ElectricCharge        //    Density(EC) = 0
            Ratio = 180                //    How much Ec is used per second.
        }
        OUTPUT_RESOURCE
        {
            ResourceName = Metal            //    Density(Metal) = 0.039
            Ratio = 0.05                //    Yield = ~71% = 0.049*0.039/(0.1*0.0275)
            DumpExcess = false
            FlowMode = STAGE_PRIORITY_FLOW
        }
    }
    MODULE
    {
        name = ModuleResourceConverter
        ConverterName = ScrapMetal-->Metal
        StartActionName = Start ScrapMetal --> Metal
        StopActionName = Stop ScrapMetal --> Metal    
        AutoShutdown = true
        TemperatureModifier
        {
            key = 0        200000
            key = 1800    50000
            key = 2200    30000
            key = 3000    3000
            key = 3600    0
        }
        GeneratesHeat = true
        DefaultShutoffTemp = .8
        ThermalEfficiency
        {
            key = 0        0.02    0        0
            key = 1000    0.1    0        0
            key = 2000    1    0        0
            key = 3000    0.01    0        0
        }
        UseSpecialistBonus = true            //    EB*[SBB+(EE*SEF)] ; EE=0-6
        SpecialistEfficiencyFactor = 0.05        //    SEF
        SpecialistBonusBase = 0.7            //    SBB
        ExperienceEffect = ConverterSkill        //    EE (NoSpecialist=0;FiveStarSpecialist=6)
        EfficiencyBonus = 1                //    EB
        INPUT_RESOURCE
        {
            ResourceName = ScrapMetal        //    Density(ScrapMetal) = 0.004
            Ratio = 1
            FlowMode = STAGE_PRIORITY_FLOW
          }
        INPUT_RESOURCE
        {
            ResourceName = ElectricCharge        //    Density(EC) = 0
            Ratio = 80                //    How much Ec is used per second.
        }
        OUTPUT_RESOURCE
        {
            ResourceName = Metal            //    Density(Metal) = 0.039
            Ratio = 0.085                //    Yield = ~83% = 0.085*0.039/(1*0.004)
            DumpExcess = false
            FlowMode = STAGE_PRIORITY_FLOW
        }
    }
    MODULE
    {
        name = ModuleAnimationGroup
        deployAnimationName = FurnaceHeat
        activeAnimationName = FurnaceLoop
        deployActionName = Heat
        retractActionName = Shutdown
        moduleType = Furnace
        autoDeploy = false
    }
    MODULE
    {
        name = ModuleCoreHeat
        CoreTempGoal = 2000
        CoreToPartRatio = 0.1
        CoreTempGoalAdjustment = 0
        CoreEnergyMultiplier = 0.05
        HeatRadiantMultiplier = 0.1
        CoolingRadiantMultiplier = 0
        HeatTransferMultiplier = 0
        CoolantTransferMultiplier = 0.01
        radiatorCoolingFactor = 4
        radiatorHeatingFactor = 0.04
        MaxCalculationWarp = 1000
        CoreShutdownTemp = 3600
        MaxCoolant = 3500
    }

    // Optional MM-Modules
//    MODULE,6    {name = ModuleConnectedLivingSpace}        KeridianDynamics-CLS.cfg

    // Resources
}

 

And this is the patch I made. It's probably something rather simple I'm missing
 

@PART[KD-Furnace]:NEEDS[ExtraplanetaryLaunchpads]:FINAL
{
    {
    !MODULE[ModuleResourceConverter]{}
    }    
    MODULE {
        name = ELConverter
        ConverterName = Smelter
        EVARange = 3
        StartActionName = Start Metal Conversion
        StopActionName = Stop Metal Conversion
        ConverterRecipe = LFOFiredSmelter
        Rate = 5
        efficiency = 273.15, 0
        efficiency = 1873, 1

        AutoShutdown = false
        GeneratesHeat = true
    }

    MODULE {
        name = ELConverter
        ConverterName = Scrap Metal Remelter
        EVARange = 3
        StartActionName = Start Scrap Metal Remelter
        StopActionName = Stop Scrap Metal Remelter
        ConverterRecipe = LFOFiredRemelter
        Rate = 5
        efficiency = 273.15, 0
        efficiency = 1873, 1

        AutoShutdown = false
        GeneratesHeat = true
    }

    MODULE {
        name = ELCoreHeat
        CoreTempGoal = 1873
        CoreToPartRatio = 0.1
        CoreTempGoalAdjustment = 0
        CoreEnergyMultiplier = 0.1
        HeatRadiantMultiplier = 0.05
        CoolingRadiantMultiplier = 0
        HeatTransferMultiplier = 0.01
        CoolantTransferMultiplier = 0.01
        radiatorCoolingFactor = 1
        radiatorHeatingFactor = 0.05
        MaxCalculationWarp = 1000
        CoreShutdownTemp = 4000
        MaxCoolant = 0
    }

    RESOURCE {
        name = Metal
        amount = 0
        // a bit less than 10t (but a nice round number)
        // 1.28m^3
        maxAmount = 256
    }

    RESOURCE {
        name = MetalOre
        amount = 0
        // a bit less than 100t
        // 18m^3
        maxAmount = 3600
    }

    RESOURCE {
        name = ScrapMetal
        amount = 0
        // 5m^3
        maxAmount = 1000
    }
}

 

Link to comment
Share on other sites

26 minutes ago, juanml82 said:

No idea. I didn't have them, it still wasn't working, so I googled and found someone trying to do the same thing some time ago and he had the brackets.

Well the brackets will definitely break your patch.

Link to comment
Share on other sites

@juanml82 This is what I use for the same for the same part. 

Spoiler

@PART[KD-Furnace] // replaces ELSmelterSmall
{
	breakingForce = 200
	breakingTorque = 200
	skinInternalConductionMult = 0.002
	heatConductivity = 0.00024
	-MODULE[ModuleResourceConverter] {}
	-MODULE[ModuleResourceConverter] {}
	-MODULE[ModuleResourceConverter] {}
	-MODULE[ModuleCoreHeat] {}
	-MODULE[ModuleConnectedLivingSpace] {}
	MODULE
	{
		name = ELConverter
		ConverterName = Smelter
		EVARange = 3
		StartActionName = Start Metal Conversion
		StopActionName = Stop Metal Conversion
		ConverterRecipe = LFOFiredSmelter
		Rate = 5
		efficiency = 273.15, 0
		efficiency = 1873, 1
		AutoShutdown = false
		GeneratesHeat = true
	}
	MODULE
	{
		name = ELConverter
		ConverterName = Scrap Metal Remelter
		EVARange = 3
		StartActionName = Start Scrap Metal Remelter
		StopActionName = Stop Scrap Metal Remelter
		ConverterRecipe = LFOFiredRemelter
		Rate = 5
		efficiency = 273.15, 0
		efficiency = 1873, 1
		AutoShutdown = false
		GeneratesHeat = true
	}
	MODULE
	{
		name = ELCoreHeat
		CoreTempGoal = 1873
		CoreToPartRatio = 0.1
		CoreTempGoalAdjustment = 0
		CoreEnergyMultiplier = 0.1
		HeatRadiantMultiplier = 0.05
		CoolingRadiantMultiplier = 0
		HeatTransferMultiplier = 0.01
		CoolantTransferMultiplier = 0.01
		radiatorCoolingFactor = 1
		radiatorHeatingFactor = 0.05
		MaxCalculationWarp = 1000
		CoreShutdownTemp = 4000
		MaxCoolant = 0
	}
	RESOURCE
	{
		name = Metal
		amount = 0
		maxAmount = 256
	}
	RESOURCE
	{
		name = MetalOre
		amount = 0
		maxAmount = 3600
	}
	RESOURCE
	{
		name = ScrapMetal
		amount = 0
		maxAmount = 1000
	}
}

 

 

Link to comment
Share on other sites

15 hours ago, toxicgu23 said:

Hello, I have a problem during the operation. When I press ALT + F11, there is no window to reload the mod. Is this feature canceled?
(Tested in KSP1.8.1, 1.9.0 respectively, the version used is ModuleManager.4.1.3)

This hasn't changed.  Maybe something else on you computer is intercepting those keystrokes?

Link to comment
Share on other sites

21 hours ago, blowfish said:

Well the brackets will definitely break your patch.

Ok, removed them. Adding the EPL converter modules works just fine, but I'd like to delete the original stock converter in the KD smelter. How would I go about doing that?

Link to comment
Share on other sites

trying to adjust a node position via math

does the index start with 0 or 1?

so the follow code would multiply which ?

0, 1, 2, 3, 4, 5, 6?

or is it

1, 2, 3, 4, 5, 6, 7, 8?

+PART[xyz125]
{
	@node_stack_top,1 *= 1.5 // 0.0, 0.68, 0.0, 0.0, 1.0, 0.0, 1
//                               0    1     2    3    4    5   6
//                               1    2     3    4    5    6   7
  ...
}

I want to multiply the 0.68.

thank you in advance!

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