SSTU - Shadow Space Technologies Unlimited

SSTU - Shadow Space Technologies Unlimited

98.5k Downloads

Q: VolumeContainer

Jimbodiah opened this issue ยท 8 comments

commented
  • For SSTUVolumeContainer, can only two subcontainers be defined? I made a third one and it will not show up.
  • Defining a second VolumeContainer will only give the resources of the last selected volumecontainer, cq will not work?
  • Is it currently possible to enter a fixed amount of units as opposed to ratios? I have to combine Food/Water/Oxygen with Ec and MP which is taking forever to get right.
  • Is it possible to have RESOURCE definitions alongside a VolumeContainer module in the future; right now that doesn't work.
  • What does "baseContainerIndex = 1" specify?
  • What is the relation between SSTUVolumeContainer volume and SSTUModelSwitch volume?
commented

Hah, now I know why I stranded with the TAC patch last time... the VolumeContainer is giving me a headache :)

commented

1.) You can have as many containers as you would like. The StationCore - DOS parts all end up with 3 containers when USI-LS is installed.
2.) I'm not sure what you are asking here? You need to define what resources can be put in each container on the part. So if there are three containers, you need to define resources for all three separately. They can have the same, or different resources, available in each container. And as many or as few resources as you want (though at least one).
3.) Nope, I use a giant spreadsheet for those calculations. I might consider it in the future, but it is a completely different method of calculation, that would require massive reworking on the VC module initialization code. This is part of the reason for using separate containers -- makes it easier to calculate the ratios and volumes needed.
4.) I'm not sure what you are asking here -- for stand-alone resources that are defined in the part outside of the VolumeContainer? No, will not work properly with fuel switching modules due to bugs in the KSP code (if a resource is defined in the part, and left in the config, it will always be in part, even if a user removes it via the GUI; stock code will put it back in the part when you load it into flight scene because it was saved into the base config file). So, short answer, nope, cannot happen.
5.) baseContainerIndex specifies what CONTAINER will be adjusted by the 'Fuel Type' slider. That slider only adjust a single container, so that you may pre-set the other containers to batteries or life-support. See the DOS modules for examples.
6.) That one is difficult to explain (I would have to read through the source), and I would actually recommend against using SSTUModelSwitch for now. That module is marked for removal as soon as I can come up with a replacement that isn't a PITA to make configs for.

Example container setup with separate battery and life support supplies container:

MODULE
{
	name = SSTUVolumeContainer
	volume = 0
        //the 'Propellant' container is at index 0 -- so the fuel type slider will control its contents
	baseContainerIndex = 0
	subtractMass = false
	subtractCost = false
        //if this is set to false, it disables all GUI based container editing
	enableContainerEdit = true
        //if this is set to false, it disables the Fuel Type slider on the part right-click menu
	enableFuelTypeChange = true
	CONTAINER
	{
		name = Propellant
		percent = 60
		tankageVolume = 0
		tankageMass = 0
		defaultModifier = standard
		defaultResources = NTO,1,1;Aerozine50,1,1
		resource = Aerozine50
		resource = NTO
		resource = LiquidFuel
		resource = Oxidizer
		resource = XenonGas
		resource = Monopropellant
		resource = LqdHydrogen
		modifier = standard
	}
	CONTAINER
	{
		name = Battery
		percent = 35
		tankageVolume = 0
		tankageMass = 0
		ecHasCost = false
		defaultModifier = standard
		defaultResources = ElectricCharge,1,1
		resource = ElectricCharge
		modifier = standard
	}
        CONTAINER
        {
            name = Supplies
            percent = 5
            tankageVolume = 0
            tankageMass = 0
            defaultModifier = standard
            defaultResources = Supplies,10,1;Mulch,10,0
            resource = Supplies
            resource = Mulch
            resource = Fertilizer
            modifier = standard
        }
}

commented

I tried making a third container, but it does not show up in the Configure Container gui for some reason, hence I thought only two containers were allowed. This would solve my problems as configuring one tank for LS was pretty easy.

commented

I give up. I just edited the actual part to add a third container, thinking maybe the patch is not being done properly, but the third section does not show up at all. What am I doing wrong? Been at this for 5-6 hours now and the thing will just not add a third container.

MODULE
{

name = SSTUVolumeContainer
volume = 250
baseContainerIndex = 1
subtractMass = false

CONTAINER
{
	name = Internal Tank
	percent = 60
	tankageVolume = 0
	tankageMass = 0
	ecHasMass = false
	defaultModifier = standard
	defaultResources = MonoPropellant,1;ElectricCharge,12
	resource = MonoPropellant
	resource = ElectricCharge
	modifier = standard
}

CONTAINER
{
	name = Ascent Fuel Tank
	percent = 0               // external tanks, so 0% of internal volume used
	tankageVolume = 0.15      // external tanks, adds extra weight to craft
	tankageMass = 0.15
	defaultModifier = standard
	defaultFuelPreset = LFO
	resource = LiquidFuel
	resource = LqdHydrogen
	resource = Oxidizer
	resource = MonoPropellant
	resource = Aerozine50
	resource = NTO
	resource = ElectricCharge
	modifier = standard
	modifier = lbo
	modifier = zbo
	modifier = light
	modifier = structural
}

CONTAINER
{
	name = Life Support
	percent = 40
	tankageVolume = 0
	tankageMass = 0
	defaultModifier = standard
    defaultResources = Food,219;Water,145;Oxygen,22208
    resource = Food
    resource = Water
    resource = Oxygen
	modifier = standard
}

}

commented

What part is that from/for? The LanderCore pods?

If so... I would suggest ignoring those parts, and trying something that isn't marked for removal already. It is very likely that the SSTUModelSwitch is not playing well with the VolumeContainer on those specific parts (the model-switch requires all sorts of additional setup in order to function properly, and I never did finish its development, so large portions of the interaction are probably just broken). (The SSTUModelSwitch is probably setting the volume to zero for that third container, thus it never shows up in the GUI)

I would suggest to start with the StationCore parts as they use the standard VolumeContainer setup without any funky external interactions.

commented

LC pods.

LOL, yeah, sounds like a good idea... I was about to grab a baseball bat and smash something :)

commented

Is it working for you on the other parts (non-LC-POD parts)?

commented

I have all the Shipcore pods and SMs finished and made a PR for them. Right now I have two files; one for resources and MFT assignment, and one for all the shipcore parts. I'll make a separate file for the station core parts. When all is done I can merge into a single file if that is preferable for you, or else just leave as is: Defs/SC/ST.