Jump to content

[0.20] ModuleManager 1.3 - for all your stock-modding needs


ialdabaoth

Recommended Posts

There's actually two mods installed here - one is for users, the other is for developers.

So, you know how certain mods (like FAR and CrewManifest and Kethane and RemoteTech) each need you to modify your stock part.cfg files, and if you wan to install more than one of them you have to figure out yourself how to do it?

ModuleManager fixes that, by letting developers specify what parts of each file need to be modified, and then letting my mod do the actual modification.

That's ModuleManager. ModularFuelTanks is a user-level plugin, that defines several new fuel types:

LiquidH2 (very light, but dissipates over time)

LiquidOxygen (more efficient Oxidizer)

NuclearFuel (nuclear engines use this + LiquidH2 instead of a fuel+oxidizer)

Then, it configures most of the stock fuel tanks so that you can click on that fuel tank in the Action Group window in the VAB, and specify what (and how much) resources to load the fuel tank with. It also lets you click on most of the engines in the Action Group window in the VAB and lets you specify what kind of fuel you want them to use - for example, LiquidFuel+Oxidizer, LiquidFuel+LiquidOxygen, or LiquidH2+LiquidOxygen. Different fuel mixes will adjust the engine's Isp and thrust - LiquidFuel+LiquidOxygen will slightly thrust and Isp, while LiquidH2+LiquidOxygen will significantly increase Isp at the cost of decreasing maximum thrust.

Great answer :) It looks like there are some major changes for the better happening.

Link to comment
Share on other sites

This is just tits. However, I am somewhat annoyed that a feature we were told was to be included in .20, and was bugged, was fixed by the community before the devs.

You should break this into two different thread / mod releases - one for the modular fuel tanks (and explaining what they do / how they do it) and one for the moduleManager.dll, as the latter has universal applications.

BTW: Is it possible to add a PART { } entry to a .cfg? Say for example, I want to make a rescale of a squad part while obviously not mucking with the defaults and while keeping the original part. Would it be possible to inject a new part entry in this manner, or is that not possible with the way it works? Also, how does it determine which .cfg to parse first, if both are making modifications to the same file? Does it just go in alphabetical order from the beginning of the GameData folder to the end?

Edited by Frostiken
Link to comment
Share on other sites

You should break this into two different thread / mod releases - one for the modular fuel tanks (and explaining what they do / how they do it) and one for the moduleManager.dll, as the latter has universal applications.

That is an excellent idea. Doing so now.

BTW: Is it possible to add a PART { } entry to a .cfg? Say for example, I want to make a rescale of a squad part while obviously not mucking with the defaults and while keeping the original part. Would it be possible to inject a new part entry in this manner, or is that not possible with the way it works? Also, how does it determine which .cfg to parse first, if both are making modifications to the same file? Does it just go in alphabetical order from the beginning of the GameData folder to the end?

that isn't possible with the way my system works. My system does NOTHING to files, it ONLY modifies root-level ConfigNodes (i.e., PART, RESOURCE_DEFINITION, INTERNAL, or any root-level ConfigNode that a mod might define). By the time my system is loaded, the concept of "files" is a vague memory.

Link to comment
Share on other sites

Can I use such code in some "my.cfg" to add or change something in stock parts, like

Also, to revisit your original reply, this is exactly what you'd do:


@PART mk1pod {
MODULE ModuleGenerator
{
isAlwaysActive = true
OUTPUT_RESOURCE
{
name = ElectricCharge
rate = 0.75
}
}
@RESOURCE[ElectricCharge]
{
@amount = 500
@maxAmount = 500
}
}

That will add an electric generator to your mark 1 pod, and change its ElectricCharge resource to 500/500.

Link to comment
Share on other sites

Good to know - so what about the order of modification? :)

I anticipated this! :) The system operates in two passes. This:


@PART[mk1pod]
{
...stuff
}

goes into pass 1, while this:


@PART[mk1pod]:Final
{
...stuff
}

goes into pass 2. Pass 1 is for plugin developers who need to add new modules to existing parts; Pass 2 (aka 'Final') is for gameplay tweakers who want to release game-balance changes.

Link to comment
Share on other sites

I'm trying to use this to add MechJeb to the stock parts, but it doesn't seem to be working, and doesn't add mechjeb to the part; here is my code:


@PART[Mk1-2Pod]
{
MODULE
{
name = MechJebCore
}
}

Does anyone see what could be causing the problem?

Link to comment
Share on other sites

This isn't working for me :/

I redownloaded the .dll just to make sure, and I have it in Kerbal Space Program/Gamedata/ModuleManager.dll

I have inside Gamedata/RemoteTech/RemoteTech.cfg, which contains all the probe core changes.

And... nothing is happening :(

Maybe I misunderstood the new gamedata.cfg-less setup? I have a second file elsewhere full of tweaks (Gamedata/X Custom Modparts/X Changes.cfg) and it too does nothing.

EDIT: Okay, I removed everything except Squad folder, RemoteTech, your modular fuel tanks, the .dll, and my own custom modparts folder. Things seem to be somewhat working. Pretty sure there's a plugin conflict here, though it'll take me a while to sort it out.

I'm also totally unable to change anything in the root partnode.


@PART[commDish]:Final
{
@cost = 1900
@title = Communotron 188-88
@manufacturer = Ionic Protonic Electronics
@description = The Communotron High-Gain Antenna, model 188-88 allows for long-range, high-speed communication.

@mass = 10.025

@MODULE[ModuleRTAnimatedAntenna]
{
@dishRange0 = 10.000001
@dishRange1 = 115000
@Mode0EnergyCost = 10.6
@Mode1EnergyCost = 10.6
@EnergyDrain1 = 10.00166667
}
}

The only changes that occur are in the Module. The description, cost, mass are just vanilla values.

Edited by Frostiken
Link to comment
Share on other sites

There is a mistake in your port of FAR to ModuleManager. The portion of the .cfg regarding the small control surface uses the tag "smallCtrlSurf," whereas the actual game uses "smallCtrlSrf," thus FAR does not see that part.

Link to comment
Share on other sites

There is a mistake in your port of FAR to ModuleManager. The portion of the .cfg regarding the small control surface uses the tag "smallCtrlSurf," whereas the actual game uses "smallCtrlSrf," thus FAR does not see that part.

'doh! Good catch! Fixing now.

Link to comment
Share on other sites

This isn't working for me :/

I redownloaded the .dll just to make sure, and I have it in Kerbal Space Program/Gamedata/ModuleManager.dll

I have inside Gamedata/RemoteTech/RemoteTech.cfg, which contains all the probe core changes.

And... nothing is happening :(

Maybe I misunderstood the new gamedata.cfg-less setup? I have a second file elsewhere full of tweaks (Gamedata/X Custom Modparts/X Changes.cfg) and it too does nothing.

EDIT: Okay, I removed everything except Squad folder, RemoteTech, your modular fuel tanks, the .dll, and my own custom modparts folder. Things seem to be somewhat working. Pretty sure there's a plugin conflict here, though it'll take me a while to sort it out.

I'm also totally unable to change anything in the root partnode.


@PART[commDish]:Final
{
@cost = 1900
@title = Communotron 188-88
@manufacturer = Ionic Protonic Electronics
@description = The Communotron High-Gain Antenna, model 188-88 allows for long-range, high-speed communication.

@mass = 10.025

@MODULE[ModuleRTAnimatedAntenna]
{
@dishRange0 = 10.000001
@dishRange1 = 115000
@Mode0EnergyCost = 10.6
@Mode1EnergyCost = 10.6
@EnergyDrain1 = 10.00166667
}
}

The only changes that occur are in the Module. The description, cost, mass are just vanilla values.

Gimme a few minutes to test this and I will get right back to you.

Link to comment
Share on other sites

that isn't possible with the way my system works. My system does NOTHING to files, it ONLY modifies root-level ConfigNodes (i.e., PART, RESOURCE_DEFINITION, INTERNAL, or any root-level ConfigNode that a mod might define). By the time my system is loaded, the concept of "files" is a vague memory.

But if you made a part that only has the values that you changed in it, such as, "MyMod/Parts/ModifiedStockPart/part.cfg" could you use the ModuleManager to set the rest of the values to be the same as the original part? If you could then that would probably solve his problem.

Link to comment
Share on other sites

The only changes that occur are in the Module. The description, cost, mass are just vanilla values.

Bug confirmed; this is due to a peculiarity in KSP's code. I'm working on a work-around; so far I can get descriptive fields (like 'cost' and 'description' and 'author') to load, but not gameplay fields (like 'maxTemp' or 'mass'). I'll let you know as soon as I've hammered it out.

EDIT: Fixed! New version is 1.01.

Edited by ialdabaoth
Link to comment
Share on other sites

This isn't working for me :/

I redownloaded the .dll just to make sure, and I have it in Kerbal Space Program/Gamedata/ModuleManager.dll

I have inside Gamedata/RemoteTech/RemoteTech.cfg, which contains all the probe core changes.

And... nothing is happening :(

Maybe I misunderstood the new gamedata.cfg-less setup? I have a second file elsewhere full of tweaks (Gamedata/X Custom Modparts/X Changes.cfg) and it too does nothing.

EDIT: Okay, I removed everything except Squad folder, RemoteTech, your modular fuel tanks, the .dll, and my own custom modparts folder. Things seem to be somewhat working. Pretty sure there's a plugin conflict here, though it'll take me a while to sort it out.

I had a similar problem and tracked it down to the jarfr tri-hexstrut pack specifically the JARFR_THSS/Parts/Command folder. One of the probe cores was set to be a mechjeb core and I don't use it so completely on a whim I took that line out and everything started working.

Link to comment
Share on other sites

There is a mistake in your port of FAR to ModuleManager. The portion of the .cfg regarding the small control surface uses the tag "smallCtrlSurf," whereas the actual game uses "smallCtrlSrf," thus FAR does not see that part.

There also was an error about 'Mark3Cockpit' (should be mark3Cockpit) in the log file.

Link to comment
Share on other sites

Good to know - I'll edit the cfg file now. Also, I'm removing everything from my third-party distributions except for the .cfg files, so that if they update without me knowing it I won't bork all your stuff.

Link to comment
Share on other sites

Until threads are split per subject matter I'll do it all here.

ModuleManager: Excellent value there. It's definitely the direction KSP needs for how to manipulate config. It reminds me a lot of the config structure for OFP/ArmA mods. One thing it allowed that I don't see here is defining new classes as sub of an existing class. This lets core modifications affect an entire tree of parts which centralizes changes. The other is altering config (or instance thereof) during runtime which is a big project.

ModularFT: This is great. I've had a look into the code and your method of assigning masses and capacities is properly dynamic without a lot of hardcoded values but avoids unnecessary complexity. Balance-wise I feel your weight penalties for the tare weight of the fuel tank part as well as the mass fraction of the resource containers is too generous. Perhaps the resource containers could have a penalty of the ax+b type with a static b representing necessary plumbing and an a*x that is quantity-scaled (possibly by area that contains the volume which is I think VOLUME^2/3). The LH2 leakage is similarly not strong enough a penalty I feel. A 6400u fuel tank took perhaps a kerbal year to leak. As a player I would find it a non-factor unless I was on a journey of at least 10 days which is rare. I wonder if the leakage could be made non-constant and/or temperature-dependent.

Oh and some reference table or function for filling fuel and oxidizer in the appropriate ratio would be very helpful when setting up tanks.

Link to comment
Share on other sites

Bug confirmed; this is due to a peculiarity in KSP's code. I'm working on a work-around; so far I can get descriptive fields (like 'cost' and 'description' and 'author') to load, but not gameplay fields (like 'maxTemp' or 'mass'). I'll let you know as soon as I've hammered it out.

EDIT: Fixed! New version is 1.01.

Sweet. I'm going to work on tracking down the source of my conflict as well that was stopping the mod from working altogether (before I removed everything, EVERY aspect stopped working, including the adjustable tanks)

Link to comment
Share on other sites


@PART[probeStackLarge]
{
@rotPower = 20
@linPower = 20
@RESOURCE[ElectricCharge]
{
@rate = 0.055
}
MODULE
{
name = MechJebCore
}
MODULE
{
name = TacFuelBalancer
}
}

In here, modules added to the part both work, rotPower and linPower appear to have changed correctly, but ElectricCharge resource consumption is unaltered. What am I doing wrong?

P.S. Ah, figured it out. Resource is consumed from ModuleCommand, so I have to address it one level down.

Some feedback related to parsing patch config nodes would be nifty...

Edited by Mihara
Link to comment
Share on other sites

ialdabaoth - my plugin woes seem to have fixed themselves. All is working as it should.

Thank you once again :)

Now I just need to figure out if I can get a plugin-less method of making ASAS / SAS drain power... doesn't look like it'll happen though.

Edited by Frostiken
Link to comment
Share on other sites

I'm trying to add IonCross to Fusty's Station parts and Munox. However almost all of his parts have names with spaces in them, ex. Universal Karmony Node and Karmony Node Mk II, and I'm guessing that's why it won't select.

I tried [*Karmony*] ['Karmony Node Mk II'] and ["Karmony Node Mk II"] No luck, any advice?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...