Jump to content

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


sarbian

Recommended Posts

Is there a way to make a module change its behaviour in career/science sandbox depending on which tech nodes the user unlocks?

or would that require a .dll?

I've tried to look around but the only mods that I know do that seem to use dlls

Link to comment
Share on other sites

Request: would it be possible to get Module Manager to let us use logic with HAS in sub-nodes or variables? Currently it seems like it's not possible, as from my tests and this quote:

Looking at the code, it looks like | for OR is allowed in HAS blocks at the top level (i.e. @PART:HAS[]) but not in sub-nodes or variable lookups.
Link to comment
Share on other sites

Query / Request:

I'm retexturing a part:

...

-mesh = model.mu

MODEL

{

model = Squad/Parts/Utility/largeAdapterShort/model

scale = 1.5, 1.0, 1.5 // << x,y,z

rotation = 0,0,180

// texture = model000,./model000 // shame this syntax does not work

texture = model000,UberDyneAstronautics/testing/Shield/model000

}

...

is there a way to do a reference to the replacement texture file that is relative to the .cfg specifying it? It's a shame to have to create a dependency on the path of the .cfg in the .cfg.

Link to comment
Share on other sites

So I'm having some issues and for the life of me I can't figure out whats wrong. I'm trying to change the fuel in a tank to 540/660, and this is what I've come up with after reading the documentation:

@PART[FUELTANKNAME]
{
@TechRequired = heavyRocketry
@title = FT-450
@description = We've got the gas!

@RESOURCE
{
@name = LiquidFuel
@amount = 540
@maxAmount = 540
}

@RESOURCE
{
@name = Oxidizer
@amount = 660
@maxAmount = 660
}
}

It has the effect of only recognizing the oxidizer total, and removes the liquidfuel completely.

It's got to be something obvious, what am I missing?

Link to comment
Share on other sites

You're not actually indexing into the resources, just repeatedly editing the first one

@PART[FUELTANKNAME]
{
@TechRequired = heavyRocketry
@title = FT-450
@description = We've got the gas!

@RESOURCE[LiquidFuel]
{
@amount = 540
@maxAmount = 540
}

@RESOURCE[Oxidizer]
{
@amount = 660
@maxAmount = 660
}
}

Link to comment
Share on other sites

You're not actually indexing into the resources, just repeatedly editing the first one

I didn't think that would work - thanks!!

So similarly, if I wanted to remove something from the part (say, oxidizer) would the correct syntax be:

@PART[FUELTANKNAME]

{

@TechRequired = heavyRocketry

@title = FT-450

@description = We've got the gas!

-RESOURCE[Oxidizer] {}

}

Link to comment
Share on other sites

@PART[FUELTANKNAME]

{

@TechRequired = heavyRocketry

@title = FT-450

@description = We've got the gas!

-RESOURCE[Oxidizer] {}

}

From first page, second message

@PART[FUELTANKNAME]
{
@TechRequired = heavyRocketry
@title = FT-450
@description = We've got the gas!
!RESOURCE[Oxidizer] {}
}

Link to comment
Share on other sites

Is it possible to look up a value, and use that value else? I'm trying to make an MM.cfg file for adding the science multiplier to the science generated by the science lab. I can see in the science lab part, that what I need is to change this:


PART[Large_Crewed_Lab]
{
MODULE
{
name = ModuleScienceConverter
scienceMultiplier = 5
}
}

With a cfg file with this code:


@PART[Large_Crewed_Lab]
{
@MODULE[ModuleScienceConverter]
{
@scienceMultiplier *=0.3
}
}

However I'd like for it to look up the multiplier in the save file I'm using, thus allowing me to make one cfg file for all save files.


GAME
{
{
preset = Custom
CAREER
{
ScienceGainMultiplier = 0.3
}
}
}

So is it possible to look up that value, and have that applied? My assumption is that isn't, because cfg's are loaded during the game load up, but it can't hurt to ask :) Also if I can't, is my changed code gonna work the way I intend it? :)

Link to comment
Share on other sites

Is it possible to look up a value, and use that value else? I'm trying to make an MM.cfg file for adding the science multiplier to the science generated by the science lab. I can see in the science lab part, that what I need is to change this:


PART[Large_Crewed_Lab]
{
MODULE
{
name = ModuleScienceConverter
scienceMultiplier = 5
}
}

With a cfg file with this code:


@PART[Large_Crewed_Lab]
{
@MODULE[ModuleScienceConverter]
{
@scienceMultiplier *=0.3
}
}

However I'd like for it to look up the multiplier in the save file I'm using, thus allowing me to make one cfg file for all save files.


GAME
{
{
preset = Custom
CAREER
{
ScienceGainMultiplier = 0.3
}
}
}

So is it possible to look up that value, and have that applied? My assumption is that isn't, because cfg's are loaded during the game load up, but it can't hurt to ask :) Also if I can't, is my changed code gonna work the way I intend it? :)

There's nothing in ModuleManager to access a per-save config file because MM runs and parts are compiled before you decide which save to load.

I don't see any syntax errors in your patch. It should work to make the science multiplier 3/10 of the stock value.

Link to comment
Share on other sites

- and ! are synonymous.

Your statement might well be true, however, it is not documented in the second message of the first page. The syntax that I suggested is documented in that message. I believe that it is in the best interest of all of the users to point people to the documentation and suggest that they help themselves. Note that this statement is merely my opinion and you are free to disagree.

skips

Link to comment
Share on other sites

Will this correctly create a copy of a part?

Making some changes, taking it out of tech tree and VAB, removing its functionality to just have a part to use in contracts?

+PART[sensorGravimeter]
{
@name = SatsWithParts001

-TechRequired =
@entryCost = 0
@cost = 10000
//category = Science
//subcategory = 0
@title = Equipment for Satellite 001
@manufacturer = Contractor
@description = Make sure to attach this to the satellite!
//mass = 0.005
//maxTemp = 1200 // = 3200
//PhysicsSignificance = 1
//bulkheadProfiles = srf

-MODULE[ModuleEnviroSensor] {}

-MODULE[ModuleScienceExperiment] {}

}

Link to comment
Share on other sites

Will this correctly create a copy of a part?

Making some changes, taking it out of tech tree and VAB, removing its functionality to just have a part to use in contracts?

+PART[sensorGravimeter]
{
@name = SatsWithParts001

-TechRequired =
@entryCost = 0
@cost = 10000
//category = Science
//subcategory = 0
@title = Equipment for Satellite 001
@manufacturer = Contractor
@description = Make sure to attach this to the satellite!
//mass = 0.005
//maxTemp = 1200 // = 3200
//PhysicsSignificance = 1
//bulkheadProfiles = srf

-MODULE[ModuleEnviroSensor] {}

-MODULE[ModuleScienceExperiment] {}

}

Yes but with your

-TechRequired =
It might not load with out a TechRequired =
Link to comment
Share on other sites

It is not supposed to appear in the tech tree, I just need a part that I can be made available by ContractConfigurator.

I usually set "TechRequired = none" instead of deleting the entire line. Does the same thing, and less likely to break if stock code or another mod starts assuming that there will always be a value.

Link to comment
Share on other sites

I usually set "TechRequired = none" instead of deleting the entire line. Does the same thing, and less likely to break if stock code or another mod starts assuming that there will always be a value.

Worked! Thanks!

Link to comment
Share on other sites

I want to replace the middle value y in an x,y,z coordinate (or whatever Squad uses). The replacement is based off of another value y in an x,y,z coordinate. For both coordinates, x and z are known but y is unknown. Is it possible to do this? I was thinking of using a variable lookup with a regexp as follows, but it doesn't seem to work.

Example:


MODULE
{
posA = -1000, 400, -1 // want to lookup middle coordinate (x,z known, y unknown)
posB = -1000, 200, -1 // want to replace middle coordinate (x,z known, y unknown)


tempA = #$posA$ // OUTPUT: -1000, 400, -1
@tempA ^= :-1000, (.*), -1:$1: // OUTPUT: 400
@tempA += 200 // OUTPUT: 600


tempB = #$posB$ // OUTPUT: -1000, 200, -1
@tempB ^= :-1000, (.*), -1:$1: // OUTPUT: 200

// the following defaults to original posB
posB ^= ^.*) #$tempB# (.*$):$1 #$tempA$ $2: // OUTPUT (FAIL): -1000, 200, -1

// even if posB's y is known, still fails
posB ^= ^.*)200(.*$):$1 #$tempA$ $2: // OUTPUT (FAIL): -1000, #$tempA$, -1
}

Edited by ev0
Link to comment
Share on other sites

This is a simple question that's probably been answered but I don't know enough to know what to search for.

I'm trying to change the model of the turboFanEngine to the JetEngine. This is what I have initially:


@PART[turboFanEngine]
{
@MODEL
{
@model = Squad/Parts/Engine/jetEngineBasic/model.mu
}
}

Can someone steer me in the right direction?

Link to comment
Share on other sites

ev0 : The current regex implementation does not supports vars. The system do what you need is described here with examples

Styles2304 : the default turboFanEngine engine config does not have a MODEL node and your current code tries to edit a MODEL node => MM does nothing. What you need is more in the line of :


@PART[turboFanEngine]
{
MODEL
{
model = Squad/Parts/Engine/jetEngineBasic/model.mu
}

-mesh = delete

}

Link to comment
Share on other sites

This is a simple question that's probably been answered but I don't know enough to know what to search for.

I'm trying to change the model of the turboFanEngine to the JetEngine. This is what I have initially:


@PART[turboFanEngine]
{
@MODEL
{
@model = Squad/Parts/Engine/jetEngineBasic/model.mu
}
}

Can someone steer me in the right direction?

Looks like you just need to replace the second and third @ with either nothing or a %. @ is used to edit existing modules and things, no prefix would just create them, and a % would edit if they exist or create if they don't. PART[turboFanEngine] doesn't seem to have a MODEL, so there's nothing to edit with @.

Does this work? Not sure if you have to do anything with a scale value or the mesh though...


@PART[turboFanEngine]
{
%MODEL
{
%model = Squad/Parts/Engine/jetEngineBasic/model.mu
}
}

- - - Updated - - -

ev0 : The current regex implementation does not supports vars. The system do what you need is described here with examples

Thanks!! It works now. I missed the explanation at the bottom of your link with the ratio example. I went with this:

MODULE
{
posA = -1000, 400, -1 // lookup middle coordinate (x,z known, y unknown)
posB = -1000, 200, -1 // replace middle coordinate (x,z known, y unknown)

tempA = #$posA[1]$ // OUTPUT: 400
@tempA += 200 // OUTPUT: 600

// this works
posB = #$posB[0]$, $tempA$, $posB[2]$ // OUTPUT: -1000, 600, -1
}

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