Jump to content

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


sarbian

Recommended Posts

Thank you.

Yesterday I made the "hard mode" :D

And searched for the correct use of the firesplitters fuelswitch, so manualy added everything.

And it is working fine.

But your answer made me think about it again. Thank you.

Just a quick question.... #$../ <- Is this means a node above? Or what is "../" for? I think I understand the # indicating that this is numeric.

Edited by Ricardo79
Link to comment
Share on other sites

Just a quick question.... #$../ <- Is this means a node above? Or what is "../" for? I think I understand the # indicating that this is numeric.

# => we're going to look for another value in the config (variables are always in string format)

.. => Step out one node (you start in the RESOURCE[XenonGas] node, that steps you out into the PART node)

/RESOURCE[LiquidFuel] => Step into the liquid fuel resource node

/amount => the variable we're fetching

The $ enclose the variable path explicitly

Edited by Crzyrndm
Link to comment
Share on other sites

# => we're going to look for another value in the config (variables are always in string format)

.. => Step out one node (you start in the RESOURCE[XenonGas] node, that steps you out into the PART node)

/RESOURCE[LiquidFuel] => Step into the liquid fuel resource node

/amount => the variable we're fetching

The $ enclose the variable path explicitly

Basically, you need to think of the path to the variable/node you're referencing as very similar to navigating a file structure in a command-line interface like old DOS. If you wanted to move backward one directory, you had to reference it as ".." or, if you wanted to go several levels down from where you were "..\..\.." and so on for however many levels you wanted to descend.

Link to comment
Share on other sites

Got hang today with 2.5.11: https://dl.dropboxusercontent.com/u/5836960/KSP-3.log

And here is successfull start right after that: https://dl.dropboxusercontent.com/u/5836960/KSP-4.log

Tried different rendering engines (DX & OGL), but prior experiments showed hangs with both. And after one hang this morning game again starts fine...

Link to comment
Share on other sites

It seems the crash occurs in the few lines of code where I did not add more information... But that narrows the search and I should be able to repeat it by myself tonight with all the info in your log.

Link to comment
Share on other sites

You need {} after the !MODULE so it is seen as a node.


@PART
[*]:HAS[@MODULE[KAS],@MODULE[TweakScale]]:FINAL
{
!MODULE[TweakScale] { }
}

Thanks Sarbian, with your correction and by replacing KAS with KASModuleGrab it finally worked

425.png

Link to comment
Share on other sites

Is MM able to manipulate strategy values? And if so, how do we call/refer to them? Everything in the documentation provides examples using parts.

Do you just call the ConfigNode (Am I using that term right?) as:

@STRATEGY[strategyName]

{

@minLeastDuration = <val>

}

etc?

Thanx.

Link to comment
Share on other sites

Any config node is valid so long as it is loaded through GameDatabase (some mods may not do this. All stock functions use this).

I kinda have to assume you're answering my question above, so I'll respond, even though your response is so brief that its doesn't really help someone who is incredibly ignorant about how this system works.

Are the strategies loaded through the "GameDatabase"? The strategies folder is in the GameData/squad folder, so... yes?

And I have no idea if "STRATEGIES" is a valid config node. That's really the crux of my question since I can't find any reference to it in the documentation I've found.

Link to comment
Share on other sites

Hiya!

I am experimenting around, but is it possible to remove an effect node?

I am trying to modify the RAPIER to be LFO only, however the jet FX remains, and plays constantly.

This is because I removed the moduleMultiEngine and the ModuleEngine for the jet mode, so the FX is now "un-tethered" to any engine module and plays all the time.

Sorry if I am not so clear.

Many thanks.

Link to comment
Share on other sites

Yes, it is. (you can see an example of editing Strategy nodes here)

Anything inside the GameData folder in a *.cfg file which follows the format below is a valid target for module manager patches


nodeName
{
key = value
...
}

Thanks, that's a way more useful answer.

I still need to add the "@" notation in front of the nodeName and key refs there when dealing making writing a MM patch, right?

Link to comment
Share on other sites

Thanks, that's a way more useful answer.

I still need to add the "@" notation in front of the nodeName and key refs there when dealing making writing a MM patch, right?

If you're editing an element instead of inserting a new one, then yes, you need to use @

Link to comment
Share on other sites

Thank you Crzyrndm,Sarbian, Gaalidas for your last replies.

I have got another "problem" Maybe you can point to an excessive documentation for MM In order to stop me asking constantly :D

I did make the hardway with the fueltanks (all stock parts and nasa parts as well)

And made them by hand from part to part like this (each with the original ammount):

@PART[adapterMk3-Mk2]

{

MODULE

{

name = FSfuelSwitch

resourceNames = LiquidFuel,Oxidizer; MonoPropellant,XenonGas; ElectricCharge

resourceAmounts = 900,1100;900,2200;400

initialResourceAmounts = 900,1100;900,2200;400

hasGUI = true

availableInFlight = true

availableInEditor = true

showInfo = true

}

}

I don't know is it some "othermod's" inconsistency or it is just my fault (First modding attempt so not many info I have), but when I switching fuels then I can see the "correct" values at the ingame menu.

After I try to launch or maybe clicking away and back at the given part I see the old resources AND the chosed ones either.

So for example I switching to xenon/monoprop on theese and it shows me just the correct ammount of Xenon and MP.

Later when I try to launch or click the tank's info it shows me 900 LF 1100 Oxidizer PLUS the 2200 Xenon and the 900 MP too.

Am I need to add something to delete the SQUAD-original resources?

If so: how/where? and what? Please make an example on this snipet I inserted. Thank you in advance.

(I don't know really if it is me or another mod or maybe it is two error at the same place... because with "opening/deploying" and "closing" parts this "menu delay" is also a problem most of the times. (I have to click again on them to show the other button. But IF I can remember correctly it won't worked never this way before it was interactive (I Do aware that this is way toooooo probably not related to module manager...)

But with the fueltanks it is constatly do that and the extra addition. So something I might missing there.)

Thank you in advance agian.

Link to comment
Share on other sites

Thank you Crzyrndm,Sarbian, Gaalidas for your last replies.

I have got another "problem" Maybe you can point to an excessive documentation for MM In order to stop me asking constantly :D

I did make the hardway with the fueltanks (all stock parts and nasa parts as well)

And made them by hand from part to part like this (each with the original ammount):

@PART[adapterMk3-Mk2]

{

MODULE

{

name = FSfuelSwitch

resourceNames = LiquidFuel,Oxidizer; MonoPropellant,XenonGas; ElectricCharge

resourceAmounts = 900,1100;900,2200;400

initialResourceAmounts = 900,1100;900,2200;400

hasGUI = true

availableInFlight = true

availableInEditor = true

showInfo = true

}

}

I don't know is it some "othermod's" inconsistency or it is just my fault (First modding attempt so not many info I have), but when I switching fuels then I can see the "correct" values at the ingame menu.

After I try to launch or maybe clicking away and back at the given part I see the old resources AND the chosed ones either.

So for example I switching to xenon/monoprop on theese and it shows me just the correct ammount of Xenon and MP.

Later when I try to launch or click the tank's info it shows me 900 LF 1100 Oxidizer PLUS the 2200 Xenon and the 900 MP too.

Am I need to add something to delete the SQUAD-original resources?

If so: how/where? and what? Please make an example on this snipet I inserted. Thank you in advance.

(I don't know really if it is me or another mod or maybe it is two error at the same place... because with "opening/deploying" and "closing" parts this "menu delay" is also a problem most of the times. (I have to click again on them to show the other button. But IF I can remember correctly it won't worked never this way before it was interactive (I Do aware that this is way toooooo probably not related to module manager...)

But with the fueltanks it is constatly do that and the extra addition. So something I might missing there.)

Thank you in advance agian.

If you need to delete the Squad resource nodes, the MM code would be "!RESOURCE<selectors> { }", where <selectors> represents whatever you need to do to target the RESOURCE nodes you care about. If they all need to go, that would be "!RESOURCE,* { }".

Whether that's what you need to do to get FSFuelSwitch working the way you expect is a Firespitter question, not really a ModuleManager question.

Link to comment
Share on other sites

That happens because you are adding the fuelswitch module but not otherwise modifying the part. So when you load the vessel with the modified part the game sees the initial resources, say LFO, AND the fuelswitch module. To avoid this you need to delete the initial resources by adding this to each pair patch

  
!RESOURCE["NAME"] {}

Examples of removing resources are in the first two posts.

Edit-I should add that this ends up having undesirable results re part sorting as the parts no longer have a resource.

Link to comment
Share on other sites

Does wildcarding on the name and using a tag together work? I have the following configuration:


{
name = AS_TestA

// Indicates a contract where SCANsat multipliers should be applied
tag = SCANsat

rewardFunds = 1000.0
}

CONTRACT_TYPE
{
name = AS_TestB

rewardFunds = 1000.0
}

@CONTRACT_TYPE[AS_*,SCANsat]:NEEDS[SCANsat],*
{
// Increase the rewards of all contracts with extra SCANsat requirements
@rewardFunds *= 2.00
}
CONTRACT_TYPE

With the following result:


{
name = AS_TestA
type = CONTRACT_TYPE
parentUrl = ContractPacks/AnomalySurveyor/AS_TEST
url = ContractPacks/AnomalySurveyor/AS_TEST/AS_TestA
CONTRACT_TYPE
{
name = AS_TestA
tag = SCANsat
rewardFunds = 2000
}
}
UrlConfig
{
name = AS_TestB
type = CONTRACT_TYPE
parentUrl = ContractPacks/AnomalySurveyor/AS_TEST
url = ContractPacks/AnomalySurveyor/AS_TEST/AS_TestB
CONTRACT_TYPE
{
name = AS_TestB
rewardFunds = 2000
}
}
UrlConfig

What I was expecting was that only "AS_TestB" would get the multiplier applied - but it ended up happening for both A and B. Bug, or am I misusing it?

EDIT: Note tried this more explicit form, and THAT works as expected (only applying the multiplier to nodes with the SCANsat tag):

@CONTRACT_TYPE[AS_*]:HAS[#tag[SCANsat]],NEEDS[SCANsat],*

Edited by nightingale
Link to comment
Share on other sites

If you need to delete the Squad resource nodes, the MM code would be "!RESOURCE<selectors> { }", where <selectors> represents whatever you need to do to target the RESOURCE nodes you care about. If they all need to go, that would be "!RESOURCE,* { }".

Whether that's what you need to do to get FSFuelSwitch working the way you expect is a Firespitter question, not really a ModuleManager question.

Thank you.

I'll try it at once.

- - - Updated - - -

That happens because you are adding the fuelswitch module but not otherwise modifying the part. So when you load the vessel with the modified part the game sees the initial resources, say LFO, AND the fuelswitch module. To avoid this you need to delete the initial resources by adding this to each pair patch

  
!RESOURCE["NAME"] {}

Examples of removing resources are in the first two posts.

Edit-I should add that this ends up having undesirable results re part sorting as the parts no longer have a resource.

Thank you.

I didn't thinked about that. But I suspect for me it is unnecesary whetter to find the part at the first or at the 6th page of the partslist.

The bigger problem if that part (for example a fueltank) would moved to the structural for example... But all parts has a category variable so this second one should not be a problem.

I deffinitely give it a try right now.

- - - Updated - - -

Does wildcarding on the name and using a tag together work? I have the following configuration:


{
name = AS_TestA

// Indicates a contract where SCANsat multipliers should be applied
tag = SCANsat

rewardFunds = 1000.0
}

CONTRACT_TYPE
{
name = AS_TestB

rewardFunds = 1000.0
}

@CONTRACT_TYPE[AS_*,SCANsat]:NEEDS[SCANsat],*
{
// Increase the rewards of all contracts with extra SCANsat requirements
@rewardFunds *= 2.00
}
CONTRACT_TYPE

With the following result:


{
name = AS_TestA
type = CONTRACT_TYPE
parentUrl = ContractPacks/AnomalySurveyor/AS_TEST
url = ContractPacks/AnomalySurveyor/AS_TEST/AS_TestA
CONTRACT_TYPE
{
name = AS_TestA
tag = SCANsat
rewardFunds = 2000
}
}
UrlConfig
{
name = AS_TestB
type = CONTRACT_TYPE
parentUrl = ContractPacks/AnomalySurveyor/AS_TEST
url = ContractPacks/AnomalySurveyor/AS_TEST/AS_TestB
CONTRACT_TYPE
{
name = AS_TestB
rewardFunds = 2000
}
}
UrlConfig

What I was expecting was that only "AS_TestB" would get the multiplier applied - but it ended up happening for both A and B. Bug, or am I misusing it?

EDIT: Note tried this more explicit form, and THAT works as expected (only applying the multiplier to nodes with the SCANsat tag):

@CONTRACT_TYPE[AS_*]:HAS[#tag[SCANsat]],NEEDS[SCANsat],*

As far as I can understand it: based on the answers given to me about selectors. I suspect it SHOULD get all the testA and B too. because @CONTRACT_TYPE[AS_*]

Means all the contact types with the first 3 letter as "AS_" should be processed.

Sorry I cannot give you a working methode to get the last part except writing it its name. maybe *_testB But not sure.

OOOUPS I saw it lately. TestB not having the amount. I cant remember where I saw it has a caracter before that if you want to search for a variable... maybe the "!" because someone complained about the same mark means different things. So don't listen to me... Wait for an expert opinion.

Anyway I like your idea.

Something similar when a contract involving remotetech related stuff should be get a reward multiplier at least ^2(twist: based on Distance to kerbin):D would be nice. If somone figure it out how please let me know.

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