Jump to content

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


sarbian

Recommended Posts

Do I need to set the 'NEEDS' command in front of the 'AFTER' command, or behind it?

@PART[RTGigaDish1] :NEEDS[RemoteTech, Kopernicus] :AFTER[RemoteTech]

OR

@PART[RTGigaDish1] :AFTER[RemoteTech] :NEEDS[RemoteTech, Kopernicus]

It's fine in the first example but get rid of the space.

Link to comment
Share on other sites

Sarbian, I was under the impression that wild cards worked for things like property checking in :HAS

example:


@PART
[*]:HAS[#bottom_stack_node
[*]]:BEFORE[StockDragFix]
{
diameter = #$node_stack_bottom[6]$
@diameter *= 1.25
}

or


@PART
[*]:HAS[#bottom_stack_node
[*],~diameter
[*]]:BEFORE[StockDragFix]
{
diameter = #$node_stack_bottom[6]$
@diameter *= 1.25
}

Oops, posted prematurely. As the first sentence hints, I was thinking those worked now (I forget what led me to think that) but the examples above don't seem to be working.

Edited by Starwaster
Link to comment
Share on other sites

no they don't. I should add it and some basic test too ( < > ) but the code and syntax is already such a mess ...

Looking at the MM code, I thought it was doing a wild card search there, but it's been so long since I've ventured into that code that I'm no longer familiar with it...


case '#':


// #module[Winglet]
if (node.HasValue(type) && WildcardMatchValues(node, type, name))
return CheckConstraints(node, remainingConstraints);
return false;

I'll have to try this another way....

Link to comment
Share on other sites

err, yes it does... I m getting lost in the code too.

You example does not work because you check for a variable that does not exist yet.

You mean ~diameter

[*]?

But it's the absence that I'm checking for...

Oh boy, I can't remember the last time MM made me feel like a newb....

Edit: Oh, I think I get it.... if I set a variable in an early pass I can't check for its existence with :HAS[#variable[something]] in a later pass?

ok yeah I got it now....

Edit 2: Wow now I'm really feeling like a newb.... I just whipped up a brand new Ioncross config that handles all the defaults I always wanted it to that I had to do stuff like #CrewCapacity[1], #CrewCapacity[2], #CrewCapacity[3], etc etc

and I just replaced all that with a variable using config that can handle infinite numbers of crew capacities... and yet this other config is kicking me in the nuts?

Yeesh

Edited by Starwaster
Link to comment
Share on other sites

Is there a way to see what cfg did what patch? For example: my OX solar panels (the uncovered ones) are non-retractable and I'm pretty sure that's not stock behaviour, but I don't know which of my mods changes this, or where the cfg itself is. AFAIK, the only mod that changed this was Stock Rebalance Project but I don't have it installed. I opened the ConfigCache in Notepad++ and all I have is:

UrlConfig
{
name = solarPanels3
type = PART
parentUrl = Squad/Parts/Electrical/2x3SolarPanels/2x3SolarPanels
url = Squad/Parts/Electrical/2x3SolarPanels/2x3SolarPanels/solarPanels3
PART
{
name = solarPanels3
module = Part
author = NovaSilisko
rescaleFactor = 1
node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0
TechRequired = advElectrics
entryCost = 4100
cost = 600
category = Utility
subcategory = 0
title = OX-4W 3x1 Photovoltaic Panels
manufacturer = Probodobodyne Inc
description = The OX-4 is similar in design to the SP series solar panels, [B]but without the ability to retract once deployed,[/B] nor the heavy casing.
attachRules = 0,1,0,0,1
mass = 0.02
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 1
crashTolerance = 8
maxTemp = 3200
MODULE
{
name = ModuleDeployableSolarPanel
animationName = altsolarpanelbase
resourceName = ElectricCharge
raycastTransformName = suncatcher
chargeRate = 1.4
[B]retractable = false[/B]
powerCurve
{
key = 0 10 0 0
key = 13599840256 1 0 0
key = 27199680512 0.25 0 0
key = 40799520768 0.1111 0 0
key = 54399361024 0.0625 0 0
key = 67999201280 0.04 0 0
key = 81599041536 0.0278 0 0
key = 95198881792 0 0 0
}
}
MODULE
{
name = BBModule
}
MODULE
{
name = CollisionFX
scrapeSparks = true
collisionSound = CollisionFX/Sounds/Bang1
scrapeSound = CollisionFX/Sounds/GroundSkid
sparkSound = CollisionFX/Sounds/SparkSqueal
}
MODEL
{
model = VenStockRevamp/Squad/Parts/Electrical/SolarSmall/model2x3
}
MODULE
{
name = TRReflection
colour = 0.6 0.6 0.6
meshes = Panel1_002 Panel1_001 Panel1_000
}
MODULE
{
name = KASModuleGrab
evaPartPos = (0.0, 0.00, -0.22)
evaPartDir = (0,0,-1)
storable = true
storedSize = 10
attachOnPart = True
attachOnEva = False
attachOnStatic = False
attachSendMsgOnly = False
}
MODULE
{
name = ModuleTweakableSolarPanel
}
}
}

I'd like to find the cfg that changed that (bolded text). Is it possible?

Link to comment
Share on other sites

Hello,

Is MM capable of replacing the Manufacturer name of every part with the parent folder name?

(i.e. GameData\Squad making all parts in the Squad folder say Manufacturer = Squad)

I looked at the code examples briefly but I admit it kind of goes over my head.

There are some part packs that have a few items I like and then a bunch of items I don't use..

But trying to identify which mod every part belongs to is a pain.

Thank you in advance

Link to comment
Share on other sites

Is MM capable of replacing the Manufacturer name of every part with the parent folder name?

http://forum.kerbalspaceprogram.com/threads/104231-0-90-Filter-Extensions-1-16-%28Jan-17%29

Will change the "by Manufacturer" tab to list parts by mod folder instead. No need for a patch (not that what you're looking for is doable with MM AFAIK)

Link to comment
Share on other sites

http://forum.kerbalspaceprogram.com/threads/104231-0-90-Filter-Extensions-1-16-%28Jan-17%29

Will change the "by Manufacturer" tab to list parts by mod folder instead. No need for a patch (not that what you're looking for is doable with MM AFAIK)

Brilliant, sounds perfect for what I am trying to accomplish in the end (just outside of MM) I will give it a go, thanks. :)

Link to comment
Share on other sites

Hi!

I'm trying to get specific sizes of RealChutes chutes but I can't get it to work.

This is the code I'm trying to grab:

PART
{
name = RC_cone
[…]

MODULE
{
name = ProceduralChute
[…]
SIZE
{
size = 0.4, 0.4, 0.4
sizeID = 0.5m
caseMass = 0.008
bottomNode = 0, -0.009218, 0
bottomNodeSize = 0
cost = 0.4
}
SIZE
{
size = 0.5, 0.5, 0.5
sizeID = 0.625m
caseMass = 0.0125
bottomNode = 0, -0.0115225, 0
bottomNodeSize = 1
cost = 0.5
}
SIZE
{
size = 0.68, 0.68, 0.68
sizeID = 0.85m
caseMass = 0.02312
bottomNode = 0, -0.0156706, 0
bottomNodeSize = 1
cost = 0.68
}
[…]

}
[…]
}

This is what I came up with:


@PART[RC_cone]:FINAL
{
@MODULE[ProceduralChute]
{
!SIZE,*:HAS[#sizeID[0.5m]]
{}
}
}

But it doesn't work…

Link to comment
Share on other sites

Hi!

I'm trying to get specific sizes of RealChutes chutes but I can't get it to work.

This is the code I'm trying to grab:

PART
{
name = RC_cone
[…]

MODULE
{
name = ProceduralChute
[…]
SIZE
{
size = 0.4, 0.4, 0.4
sizeID = 0.5m
caseMass = 0.008
bottomNode = 0, -0.009218, 0
bottomNodeSize = 0
cost = 0.4
}
SIZE
{
size = 0.5, 0.5, 0.5
sizeID = 0.625m
caseMass = 0.0125
bottomNode = 0, -0.0115225, 0
bottomNodeSize = 1
cost = 0.5
}
SIZE
{
size = 0.68, 0.68, 0.68
sizeID = 0.85m
caseMass = 0.02312
bottomNode = 0, -0.0156706, 0
bottomNodeSize = 1
cost = 0.68
}
[…]

}
[…]
}

This is what I came up with:


@PART[RC_cone]:FINAL
{
@MODULE[ProceduralChute]
{
!SIZE,*:HAS[#sizeID[0.5m]]
{}
}
}

But it doesn't work…

By the looks you are just trying to delete size .5 you might try

@PART[RC_cone]:FINAL

{

@MODULE[ProceduralChute]

{

!size,0 = {}

}

}

Has it shows 3 sizes they would be size,0 size,1 size,2 hope it helped.

Edited by Mecripp2
Link to comment
Share on other sites

By the looks you are just trying to delete size .5 you might try

Has it shows 3 sizes they would be size,0 size,1 size,2 hope it helped.

Thanks for the tip.

The problem is that there are more sizes an I am trying to have different rules for different sizes later…

Link to comment
Share on other sites

So I have no idea what I'm doing but I want to add MechJeb to all probecores by default while I maintain the unlock order from the techtree. I also want to add the electrical demand of MJ (0.005) and the cost of the MJ module (750) to each probecore. I've gotten the first part done with the help of Sarbian in the MJ thread but I can't figure out how to do the other part. I read the MM Syntax guide https://github.com/sarbian/ModuleManager/wiki/Module%20Manager%20Syntax#edit---- but I must admit I'm probably more confused then anything else.

This is what I've managed to put together

@PART
[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore]],#vesselType[Probe]]:Final{
MODULE
{
name = MechJebCore
MechJebLocalSettings
{
MechJebModuleCustomWindowEditor { unlockTechs = flightControl }
MechJebModuleSmartASS { unlockTechs = flightControl }
MechJebModuleManeuverPlanner { unlockTechs = advFlightControl }
MechJebModuleNodeEditor { unlockTechs = advFlightControl }
MechJebModuleTranslatron { unlockTechs = advFlightControl }
MechJebModuleWarpHelper { unlockTechs = advFlightControl }
MechJebModuleAttitudeAdjustment { unlockTechs = advFlightControl }
MechJebModuleThrustWindow { unlockTechs = advFlightControl }
MechJebModuleRCSBalancerWindow { unlockTechs = advFlightControl }
MechJebModuleRoverWindow { unlockTechs = fieldScience }
MechJebModuleAscentGuidance { unlockTechs = unmannedTech }
MechJebModuleLandingGuidance { unlockTechs = unmannedTech }
MechJebModuleSpaceplaneGuidance { unlockTechs = unmannedTech }
MechJebModuleDockingGuidance { unlockTechs = advUnmanned }
MechJebModuleRendezvousAutopilotWindow { unlockTechs = advUnmanned }
MechJebModuleRendezvousGuidance { unlockTechs = advUnmanned }
}
}
//Does the part below choose the ModuleCommand module and go to rate and then add 0.005?
@MODULE[ModuleCommand]
{@name = rate
@numeric += 0.005}

//Does this choose the first place in the file that has cost in it and then add 750 to it?
{
{@name = cost
@numeric += 750}
}
}

It might be clear from the above that I've never written code in my life, so please keep any answers on toddler level. Thanks!

EDIT:

After reading the MM handbook I start to wonder if maybe what I want to do is rather @rate += 0.005 in the case of increasing the electrical demand but cost isn't inside a module so how do I get to that one?

Edited by Dazpoet
Link to comment
Share on other sites

I would try something like this

@PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore],#vesselType[Probe]]:Final
{

@cost += 750

MODULE
{
name = MechJebCore
MechJebLocalSettings
{
MechJebModuleCustomWindowEditor { unlockTechs = flightControl }
MechJebModuleSmartASS { unlockTechs = flightControl }
MechJebModuleManeuverPlanner { unlockTechs = advFlightControl }
MechJebModuleNodeEditor { unlockTechs = advFlightControl }
MechJebModuleTranslatron { unlockTechs = advFlightControl }
MechJebModuleWarpHelper { unlockTechs = advFlightControl }
MechJebModuleAttitudeAdjustment { unlockTechs = advFlightControl }
MechJebModuleThrustWindow { unlockTechs = advFlightControl }
MechJebModuleRCSBalancerWindow { unlockTechs = advFlightControl }
MechJebModuleRoverWindow { unlockTechs = fieldScience }
MechJebModuleAscentGuidance { unlockTechs = unmannedTech }
MechJebModuleLandingGuidance { unlockTechs = unmannedTech }
MechJebModuleSpaceplaneGuidance { unlockTechs = unmannedTech }
MechJebModuleDockingGuidance { unlockTechs = advUnmanned }
MechJebModuleRendezvousAutopilotWindow { unlockTechs = advUnmanned }
MechJebModuleRendezvousGuidance { unlockTechs = advUnmanned }
}
}

@MODULE[ModuleCommand]
{
@RESOURCE
{
@rate += 0.005
}
}
}

Link to comment
Share on other sites

That seems to work out perfectly. Out of sheer curiosity would it have worked equally well if the "@cost += 750" would have been at the end of the file?

I didn't know you could put a @RESOURCE after the @MODULE, would it have worked without that part or is it a must?

Now I'm not sure if I should go back to the MJ thread again or if the next question works for this thread but here goes. Can I change the unlockTechs for the probecores without changing it for the MJ part itself? I would assume they are not linked but I'm not sure.

EDIT: Since I have a tendency to wipe out all mods every so often can I change

from

[COLOR=#333333]@PART
[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore],#vesselType[Probe]]:Final

to

[COLOR=#333333]@PART
[*]:NEEDS[MechJeb2],HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore],#vesselType[Probe]]:Final

as insurance that if I don't have MJ installed (the gamedata folder is named MechJeb2 and I believe that is enough to satisfy the NEEDS command?) it won't trigger and wreck something?

Edited by Dazpoet
Link to comment
Share on other sites

You could put the cost line where ever, I think and about the @RESOURCE yes you have to have that if you look at the cfg the name and Rate are inside the RESOURCE

MODULE
{
name = ModuleCommand
minimumCrew = 0

RESOURCE
{
name = ElectricCharge
rate = 0.02777778
}
}

And think for the last part

@PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore],#vesselType[Probe]]:NEEDS[MechJeb2]

And you can change the unlockTechs with the MM if you wanted.

Link to comment
Share on other sites

This thing is so much fun :D I just rebalanced the SAS levels of all probecores more to my liking and it only took me 2 hours to get the few lines of commands do what I wanted. :P

However I don't want the Stayputnik to have MJ like the other ones (I want it to stay as useless as it is) and so I wonder if I can in any way add something to the below line that would exclude probeStackSphere (stayputnik) from the patch?

@PART
[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore],#vesselType[Probe]]:NEEDS[MechJeb2]

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