Jump to content

[1.8-1.9] Modular Fuel Tanks v5.13.1


taniwha

Recommended Posts

mediobogdum: yes, you need an entry for each individual tank. It would be best if MRS added support for MFT (easier that way for both of us).

If not the MFT tank types, Nertea has made such an elegant config to scan all the fuel tanks in the game and tweak them...


@PART
[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch]] {



%LF = #$RESOURCE[LiquidFuel]/maxAmount$
%OX = #$RESOURCE[Oxidizer]/maxAmount$

%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$
@totalCap += #$RESOURCE[Oxidizer]/maxAmount$

%onlyLH2 = #$totalCap$
@onlyLH2 *= 5.5
%mixLH2 = #$onlyLH2$
@mixLH2 /= 1.1
%mixOX = #$onlyLH2$
@mixOX -= #$mixLH2$


%tempVar = 0
%dryCost = 0

@dryCost = #$cost$

%LFCost = 0
%OXCost = 0
%LH2Cost = 0
%mixLH2Cost = 0
%mixLFCost = 0

// compute cost of stock tank fuel
@tempVar = #$RESOURCE[LiquidFuel]/maxAmount$
@tempVar *= 0.8
@mixLFCost += #$tempVar$

@tempVar = #$RESOURCE[Oxidizer]/maxAmount$
@tempVar *= 0.18
@mixLFCost += #$tempVar$

@dryCost -= #$mixLFCost$
@cost -= #$mixLFCost$

// Cost LF only
@tempVar = #$totalCap$
@tempVar *= 0.8
@LFCost += #$tempVar$

// Cost OX only
@tempVar = #$totalCap$
@tempVar *= 0.18
@OXCost += #$tempVar$

// Cost LH2 only
@tempVar = #$onlyLH2$
@tempVar *= 0.03675
@LH2Cost += #$tempVar$

// Cost mix
@tempVar = #$mixLH2$
@tempVar *= 0.03675
@mixLH2Cost += #$tempVar$

@tempVar = #$mixOX$
@tempVar *= 0.18
@mixLH2Cost += #$tempVar$


@tempVar = 0
MODULE {
name = InterstellarFuelSwitch


resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen


resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$


tankCost = #$../mixLFCost$;$../mixLH2Cost$;$../LFCost$;$../OXCost$;$../LH2Cost$
displayCurrentTankCost = true


hasGUI = true
showInfo = true

availableInFlight = false
availableInEditor = true


basePartMass = #$../mass$
tankMass = 0;0;0;0;0
}

!RESOURCE[LiquidFuel] {}
!RESOURCE[Oxidizer] {}

}

Edited by Enceos
Link to comment
Share on other sites

I noticed two little bugs. Not gamebreaking, just FYI:

1. When tweakscaling tanks, their volume stays at the original value. If I remember correctly there was a tweakscale interaction dll for 0.90?!?

2. I've build a patch for CryoEngines to have two tanktypes available for stock tanks. When switching between Default --> Cryogenic --> Default the existing tanks aren't updated. If the tanks are removed before switching or updated after, the behaviour is correct.


TANK_DEFINITION
{
name = Cryogenic
basemass = 0.000625 * volume
TANK
{
name = LqdHydrogen
amount = full
maxAmount = 50%
utilization = 10
}
TANK
{
name = Oxidizer
amount = full
maxAmount = 50%
}
}
//------------------------------------------------------//

// Add tank type CryoEngines to all default tanks
@PART
[*]:HAS[@MODULE[ModuleFuelTanks]]&HAS[@type[Default]]:FINAL
{
@MODULE[ModuleFuelTanks]
{
typeAvailable = Default
typeAvailable = Cryogenic
}
}
// Add tank definition for CryoEngines

Short Video, look at the value for Oxidizer...

https://vid.me/kZJP

Edited by funk
Link to comment
Share on other sites

funk: There was. I need to look into the latest TS for 1.x but I've been busy with other stuff so I released MFT 5.5.1 without it.

Did you remove whatever CryoEngines does to tanks? There might be some unfortunate interactions.

Link to comment
Share on other sites

funk: There was. I need to look into the latest TS for 1.x but I've been busy with other stuff so I released MFT 5.5.1 without it.

Did you remove whatever CryoEngines does to tanks? There might be some unfortunate interactions.

Yep Cryoengine uses Interstellar fuelswitch, I changed the cfg to not proceed when MFT is installed, so the cfg of a standard tank looks like this after all patches:


{
name = fuelTank
module = Part
author = NovaSilisko
mesh = model.mu
scale = 0.1
node_stack_top = 0.0, 7.72552, 0.0, 0.0, 1.0, 0.0
node_stack_bottom = 0.0, -7.3, 0.0, 0.0, -1.0, 0.0
node_attach = 5.01, 0.0, 0.0, 1.0, 0.0, 0.0, 1
TechRequired = advRocketry
entryCost = 1600
cost = 500
category = FuelTank
subcategory = 0
title = FL-T400 Fuel Tank
manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co
description = The FL series was received as a substantial upgrade over previous fuel containers used in the Space Program, generally due to its ability to keep the fuel unexploded more often than not. Fuel tanks are useless if there isn't a Liquid Engine attached under it. They can also be stacked with other fuel tanks to increase the amount of fuel for the engine below.
attachRules = 1,1,1,1,0
mass = 0.25
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.3
angularDrag = 2
crashTolerance = 6
breakingForce = 50
breakingTorque = 50
maxTemp = 2000
bulkheadProfiles = size1, srf
RESOURCE
{
name = LiquidFuel
amount = 180
maxAmount = 180
}
RESOURCE
{
name = Oxidizer
amount = 220
maxAmount = 220
}
MODULE
{
name = GPOSpeedPump
}
MODULE
{
name = ModuleFuelTanks
volume = 400
type = Default
typeAvailable = Default
typeAvailable = Cryogenic
}
MODULE
{
name = TweakScale
type = stack
defaultScale = 1.25
}
MODULE
{
name = ModuleTweakableFuelPump
ResourceNames = LiquidFuel, Oxidizer
}
}

PART

Edit: It seems that MFT don't change the maxValue of a specific tank/resource, if it's already defined. I haven't looked at your code, perhaps there's an update necessary when switching tank_types. Sry haven't checked quality of vid... so here again:

https://youtu.be/1IecD2i9P-I

Edited by funk
Link to comment
Share on other sites

Hi!

I can't get this mod to work and I really need it for my new SSTO. :rolleyes: Maybe anyone can help?

The problem is that no mod UI appears ingame at all. I tried clicking tanks with every mouse button (left, right, middle) in VAB/SPH in normal construction and action group mode. Only the stock fuel change options appear. It's like I haven't installed MFT at all.

I downloaded v5.5.1 and unzipped it to my KSP 1.0.2 GameData folder like any other mod. I'm using Kerbal Engineer and Active Texture Management (but tried to run KSP+MFT without Active Texture Management disabled at least once).

I would be really grateful for any help! This mod seems great.

Cheers!

Link to comment
Share on other sites

There are multiple MFT Modules in MK2 spaceplane parts. I've deleted SPP config, because the patches are already in squad cfg. But thats not enough, there are still multiple entries...

Link to comment
Share on other sites

I'm another one who can't seem to get this mod working. I've got a clean instal of KSP, I unzip the mod into the GameData folder ending up with a ModularFuelTanks folder next to my Squad folder... and then nothing. I can't seem to find any sort in GUI or in-game effect from the plugin. I'm not even sure what I'm supposed to be looking for?

Any help would be appreciated. The changes to Nuclear rocket fuel seem to have made this a must for anyone who doesn't want to build all their interplanetary rockets as spaceplanes.

Link to comment
Share on other sites

Quick bug report: Modular fuel tanks integration seems to be broken - tweakscale will change the physical size of the fuel tank, but when modular fuel tanks is installed, any the resource amount does not change.

There should be a dll for MFT-TweakScale integration that comes with MFT. I don't find it in the v5.5.1 zip file. Did it get lost somehow?

The source is here:

https://github.com/NathanKell/ModularFuelSystem/blob/master/Source/tweakscale/TweakScale_ModularFuelSystem.cs

Link to comment
Share on other sites

pellinor: there should, but there isn't at the moment due to me not having the time to fuss with tweakscale at the time. I have to roll a new release soon anyway so I'll take care of it then.

Link to comment
Share on other sites

As the title says, I've recognized some things when writing patches for some mods. It's nothing gamebreaking, but perhaps changeable without great afford...

a) When I use this:

utilizationTweakable = true
utilization = 0.5

Why is the ingame utilization set to 86%?!?!?

Utilization can't be set to 2-5%, there's a gap between 1% and 6%. Maybe it's the same between 96%-99%?

B) I've seen a key called "tankVolumeConversion" in some cfgs , especially in Proc. Parts. How does it work?

In the source, there is another key called "basecost". Does it have the same behaviour like basemass?

Is there a key for cost of the different tanks like "mass"?

Are there any other keys not mentioned here?

c) Request: May it be possible to change

typeAvailable = xyz
typeAvailable = xzy

to

 typeAvailable = xyz xzy ...

or divided by "," etc. With this it would be easier to address the key with MM considering existing entries.

d) I still have the issue mentioned here, when switching between tanktypes the volume of the tank which exist in both types doesn't update. I'm not sure if it's because of my config changes so here they're. Any suggestions?


@TANK_DEFINITION[Default]
{
TANK
{
name = LqdHydrogen
amount = 0
maxAmount = 0
utilization = 10
}
}

// Add LqdHydrogen to fuselage tank definition
@TANK_DEFINITION[Fuselage]
{
TANK
{
name = LqdHydrogen
amount = 0
maxAmount = 0
utilization = 10
}
}

// Add tank definition for CryoEngines
TANK_DEFINITION
{
name = Cryogenic
basemass = 0.0006875 * volume
TANK
{
name = LqdHydrogen
amount = full
maxAmount = 50%
utilization = 10
}
TANK
{
name = Oxidizer
amount = full
maxAmount = 50%
}
}
//------------------------------------------------------//

// Add tank type Cryogenic to all default and fuselage tanks
@PART
[*]:HAS[@MODULE[ModuleFuelTanks]]:FINAL
{
@MODULE[ModuleFuelTanks]:HAS[#type[Default]]
{
%typeAvailable = Default
+typeAvailable = Cryogenic
}
@MODULE[ModuleFuelTanks]:HAS[#type[Fuselage]]
{
%typeAvailable = Fuselage
+typeAvailable = Cryogenic
}
}
// Add LqdHydrogen to default tank definition

An example of the resulting cfg file looks like this (vice versa for fuselage]:


{
name = ModuleFuelTanks
volume = 200
type = Default
typeAvailable = Default
typeAvailable = Cryogenic
}
    MODULE

It seems to be fine to me. So???

e) When I did the patch above I was wondering that the fuselage parts weigh to much compared to stock drymass. I've compared the MK2 and MK3 parts as well as adapters. They have a basemass of 0.0007125-0.00075 per liter, while MFT assumes 0.002, which leads to the high drymass. MK1 fuselage has a stock basemass of 0.001 per liter.

So maybe the basemass of fuselage tanks should be overhauled to be stock alike. Either with using another basemass for fuselage or using basemass = -1 to use stock drymass?!?!? Further some adapters use default tank, while in stock they're handled as fuselage, regarding drymass.

@taniwha: I can provide some help with the cfgs to match stock values, if you like.

Edited by funk
Link to comment
Share on other sites

For requesting support for another parts mod, is this the place to ask? I'd like to see Fuel Tanks Plus supported but I don't know if that's something done here or if it's up to the mod maker to add support for MFT on their end.

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