Jump to content

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


sarbian

Recommended Posts

hi,
I would like some infos and help i didn't found for my new mod Ext-Seat-Dummy:

1- Is there a way to apply a different patch depending on the game version?

2- Is it possible to modify only some values on this kind of patch:

//attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
@attachRules = 0,1,1,1,0 //allow to be surface attachable

i would like to change only the 1st  and 2nd value.

3- More complexe :P, i there a way to  swap some values:
 

	
	//From Physics.cfg
	DRAG_CUBE
	{
//cube =		,      X+      ,       X-     ,     Y+     ,     Y-      ,     Z+       ,       Z-     ,Bcenter Boundextents.
//cube = Default, 0.75,0.92,0.4, 0.75,0.92,0.4, 0.6,0.7,0.4, 0.6,0.97,0.7, 0.85,0.95,0.4, 0.85,0.95,0.4, 0,0,0 0.8,1.1,0.8 // The drag cube kerbals use.
  cube = Default, 0.75,0.92,0.4, 0.75,0.92,0.4, 0.85,0.95,0.4, 0.85,0.95,0.4, 0.6,0.97,0.7, 0.6,0.7,0.4, 0,0,0 0.8,0.8,1.1 //rotated EvaDragCube
//kerbalEVADragCubeString = Default, 0.75,0.92,0.4, 0.75,0.92,0.4, 0.6,0.7,0.4, 0.6,0.97,0.7, 0.85,0.95,0.4, 0.85,0.95,0.4, 0,0,0 0.8,1.1,0.8 // The drag cube kerbals use, Physics.cfg
//the first six triplets are X+, X-, Y+, Y-, Z+, Z- faces of the cube.
//The numbers are area, drag coefficient, and depth of widest point from the frontmost point at that angle.
//The next triplet is the bounds center, the final is the bounds extents.
	}

i would like to copy the drag cube values from the Physics.cfg and change  the Y+ by the Z+, etc...

Thank you for any help. :)

Edited by Skalou
Link to comment
Share on other sites

1- not that I know of. you might be able to get away with some weird thing but it's not simple

2- yes

@attachRules[0] = 1 // to change the first element to "1"

@attachRules[1] = 1 // to change the second element to "1"

 

3- yes

suppose you have

cube = A, B, F, D, E, C

and you want to order it alphabetically..

you just do this:

@cube = #$cube[0]$,$cube[1]$,$cube[5]$,$cube[3]$,$cube[4]$,$cube[2]$

Link to comment
Share on other sites

I have some other questions i can't answer myself, i also found this in the documentation:

Quote

Please note that regex generation is often tricky and requires some experimentation to get right. It is assumed that if you want to use this feature you're well versed with how regexps work, including the various variants. Please refer to the .net documentaton and/or copious other documentation available on the Internet. I won't support questions about 'how do I do a regex to do xxx' on the list, you'll have to figure it out or look for help elsewhere.

:P
So i will continue to ask help on my thread here:

 

Edited by Skalou
Link to comment
Share on other sites

I am struggling with a MM cfg to disable all Strategia strategies. anybody have an example i can steal? :P if its possible?

I'm asking because i am writing my own strategies for GPP and i just want to use Strategia as the framework.

I understand the basics of Module Manager but not enough to just make the changes needed, I would rather just write my own and disable the default ones in Strategia

If i need to take this elsewhere, I will so i don't clog up this already busy thread. or just pm me. Thanks in advance

Link to comment
Share on other sites

21 hours ago, Galileo said:

I am struggling with a MM cfg to disable all Strategia strategies. anybody have an example i can steal? :P if its possible?

I'm asking because i am writing my own strategies for GPP and i just want to use Strategia as the framework.

I understand the basics of Module Manager but not enough to just make the changes needed, I would rather just write my own and disable the default ones in Strategia

If i need to take this elsewhere, I will so i don't clog up this already busy thread. or just pm me. Thanks in advance

If you want to nuke everything and start from the ground up then use this but afterwards you'd need to redefine everything:

// remove default strategia strategies
!STRATEGY[*]:AFTER[Strategia] {}
!STRATEGY_BODY_EXPAND[*]:AFTER[Strategia] {}
!STRATEGY_LEVEL_EXPAND[*]:AFTER[Strategia] {}

!CONTRACT_TYPE[STG_*]:AFTER[Strategia] {}

 

Edited by Aelfhe1m
Fixed after testing
Link to comment
Share on other sites

59 minutes ago, Aelfhe1m said:

If you want to nuke everything and start from the ground up then use this but afterwards you'd need to redefine everything:


// remove default strategia strategies
!STRATEGY[*]:AFTER[Strategia] {}
!STRATEGY_BODY_EXPAND[*]:AFTER[Strategia] {}
!STRATEGY_LEVEL_EXPAND[*]:AFTER[Strategia] {}

!CONTRACT_TYPE[STG_*]:AFTER[Strategia] {}

 

Does mm allow to create new root nodes using :AFTER[MOD] ?

because I thought it did not allow that

Link to comment
Share on other sites

@Sigma88 and @Galileo I hadn't considered that aspect. However you can work around it.

One way would be to delete each individual Stategia value by name like in Strategia's own StockStrategyDisabler config or you could use a guard variable in your own new strategies and alter the delete statements to skip any nodes with that variable (please excuse the stupid example):

// define a new strategy
STRATEGY
{
    name = HotShots
	
    protectedStrategy = true // this is the important line with the  guard variable

    title = Hot Shots
    desc = For people that really like messing about in high performance vehicles.
    department = Crewed Missions
}

// remove default strategia strategies
!STRATEGY[*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}
!STRATEGY_BODY_EXPAND[*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}
!STRATEGY_LEVEL_EXPAND[*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}

!CONTRACT_TYPE[STG_*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}

 

Spoiler

7wkdRlP.jpg

 

Link to comment
Share on other sites

1 minute ago, Aelfhe1m said:

@Sigma88 and @Galileo I hadn't considered that aspect. However you can work around it.

One way would be to delete each individual Stategia value by name like in Strategia's own StockStrategyDisabler config or you could use a guard variable in your own new strategies and alter the delete statements to skip any nodes with that variable (please excuse the stupid example):


// define a new strategy
STRATEGY
{
    name = HotShots
	
    protectedStrategy = true // this is the important line with the  guard variable

    title = Hot Shots
    desc = For people that really like messing about in high performance vehicles.
    department = Crewed Missions
}

// remove default strategia strategies
!STRATEGY[*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}
!STRATEGY_BODY_EXPAND[*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}
!STRATEGY_LEVEL_EXPAND[*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}

!CONTRACT_TYPE[STG_*]:HAS[~protectedStrategy[]]:AFTER[Strategia] {}

 

  Hide contents

7wkdRlP.jpg

 

this is perfect thanks!

Link to comment
Share on other sites

I am working to add some items to a mod's existing CFG files via MM during game load.  These are not standard parts or Global resources as defined by Squad but rather, external data points in a .cfg file.

The CFG file is structured similar to a list of Modules and I am trying to add more of these "modules"        

 

Two questions, to extend this list, could I just do the following and have it run after MOST of the other MM files have already parsed?

+ResourceDevice:FINAL
{
    @ResourceDeviceName = UniqueResourceGroupName
    RESOURCE
    {
        resource = FirstUniqueResource
        ratio = 1
    }

     RESOURCE

      {

         resource = SecondUniqueResource

          ratio = 3.75
}

 

Second question is easy.  How do I put the Hidden comments in? 

Link to comment
Share on other sites

A basic, and probably stupid question, I want to move a bunch of parts between tech tree nodes...
 

@PART[fuelTank3-2]
{
    TechRequired=start
}


Moves one part...  But I can't seem to figure out how to include multiple parts in the same file.  Laugh and point as you will, but then please enlighten me. :)

Link to comment
Share on other sites

42 minutes ago, DerekL1963 said:

A basic, and probably stupid question, I want to move a bunch of parts between tech tree nodes...
 


@PART[fuelTank3-2]
{
    TechRequired=start
}


Moves one part...  But I can't seem to figure out how to include multiple parts in the same file.  Laugh and point as you will, but then please enlighten me. :)

I could be wrong, but unless the parts you want to move all have something in common that you can target by using the * filter, I think you have to do what you did above for each part you want to move. There's some documentation about halfway down this page that goes into details: https://github.com/sarbian/ModuleManager/wiki/Module-Manager-Handbook but I don't think those will help with what you're trying to do.

Link to comment
Share on other sites

3 hours ago, Merkov said:

I could be wrong, but unless the parts you want to move all have something in common that you can target by using the * filter, I think you have to do what you did above for each part you want to move.

No, they pretty much have nothing in common...  I figured that I'd have to handle each part individually, but can't figure out how to format it.  (I.E. have it all in one file rather than a bunch of files, one for each part.)

Link to comment
Share on other sites

4 hours ago, DerekL1963 said:

A basic, and probably stupid question, I want to move a bunch of parts between tech tree nodes...
 


@PART[fuelTank3-2]
{
    TechRequired=start
}


Moves one part...  But I can't seem to figure out how to include multiple parts in the same file.  Laugh and point as you will, but then please enlighten me. :)

Few things

  1. You probably want @TechRequired = start since the part already has TechRequired.  Otherwise it will just add another TechRequired value to the node (which one will take priority isn't well defined)
  2. You can put as many patches as you want in the same file, e.g. @PART[part1] { ...}   @PART[part2] { ... }
  3. You can target multiple parts with the same patch.  e.g. @PART[part1|part2|part3] { ... } (note that this syntax only works for top level nodes though)
  4. Alternately, there might be some identifying feature of all the parts you want to target.  Then you can use a HAS block to filter them
Link to comment
Share on other sites

3 hours ago, blowfish said:

Few things

  1. You probably want @TechRequired = start since the part already has TechRequired.  Otherwise it will just add another TechRequired value to the node (which one will take priority isn't well defined)
  2. You can put as many patches as you want in the same file, e.g. @PART[part1] { ...}   @PART[part2] { ... }
  3. You can target multiple parts with the same patch.  e.g. @PART[part1|part2|part3] { ... } (note that this syntax only works for top level nodes though)
  4. Alternately, there might be some identifying feature of all the parts you want to target.  Then you can use a HAS block to filter them

So, for #2 like this (I am not a programmer of any sort...)
 

@PART[part1] 
	{ 
		...
	}   
@PART[part2] 
	{ 
	... 
	}


I don't get #3 at all.

Thanks!

Link to comment
Share on other sites

6 hours ago, DerekL1963 said:

So, for #2 like this (I am not a programmer of any sort...)
 


@PART[part1] 
	{ 
		...
	}   
@PART[part2] 
	{ 
	... 
	}

 

Yes.  No need to indent the brackets though

6 hours ago, DerekL1963 said:

I don't get #3 at all.

It would look like this:

@PART[part1|part2]
{
    ....
}

Notice the vertical bar | separating the names of parts.  This patch will affect part1 and part2

Link to comment
Share on other sites

To whoever asked on IRC how to have all science part available from the start but did not wait for someone to answer :

@PART[*]:HAS[@MODULE[ModuleScienceExperiment]]:Final
{
	@TechRequired = start
}

 

Link to comment
Share on other sites

I'm trying to rescale antenna ranges for a rescaled solar system, but it isn't working. Any advice?

@PART[*]:HAS[@MODULE[ModuleDataTransmitter]]:NEEDS[Sigma]:FINAL {
	@description ^= :$:... Range adjusted (#$@SigmaDimensions/Rescale$x) ...:
	@MODULE[ModuleDataTransmitter] {
		@antennapower *= #$@SigmaDimensions/Rescale$
	}
}

@CUSTOMBARNKIT:NEEDS[Sigma]:FINAL {
	@TRACKING {
		@DSNRange,* *= #$@SigmaDimensions/Rescale$
	}
}

 

Link to comment
Share on other sites

I think I'm making some silly mistake, but I can't make MM apply any patches. I'm testing it with a very simple modtest.cfg file:

@PART[mk1Pod]
{
	@mass = 3
}

I put the file inside GameData folder, I have the latest ModuleManager dll there too. But when I launch KSP, the pod's mass remains the same. During the load, MM posts a message saying "0 patches applied". The log has this line, however:

Config(@PART[mk1Pod]) /modtest/@PART[mk1Pod]

What am I doing wrong?

EDIT: Output log

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