Jump to content

[1.9-1.10] Configurable Containers


allista

Recommended Posts

17 minutes ago, Bit Fiddler said:

hmm but these do not look to be what we need.   as on a "per liter" basis food needs many more liters than oxygen.  but this seems to be backwards to me according to those values...

That's because oxygen tanks are high-pressure, not 1atm.

Link to comment
Share on other sites

well In the limits of the existing UI this is as close as I can get it for TAC  the food and water are near exact, but oxygen is a wee bit high   in the range "who cares"  as in over 404 days there is an extra 2H 19 seconds... food and water are off by mere 2 seconds

 

TANKCONF
{
	name = TAC-LS
	Volume = 5.70900011
	TANK
	{
		TankType = Food
		CurrentResource = Food
		InitialAmount = 0
		Volume = 3
	}
	TANK
	{
		TankType = Water
		CurrentResource = Water
		InitialAmount = 0
		Volume = 1.50699997
	}
	TANK
	{
		TankType = Gases
		CurrentResource = Oxygen
		InitialAmount = 0
		Volume = 1.20200002
	}
}

 

Edited by Bit Fiddler
Link to comment
Share on other sites

23 minutes ago, Bit Fiddler said:

well In the limits of the existing UI this is as close as I can get it for TAC  the food and water are near exact, but oxygen is a wee bit high   in the range "who cares"  as in over 404 days there is an extra 2H 19 seconds... food and water are off by mere 2 seconds


TANKCONF
{
	name = TAC-LS
	Volume = 5.70900011
	TANK
	{
		TankType = Food
		CurrentResource = Food
		InitialAmount = 0
		Volume = 3
	}
	TANK
	{
		TankType = Water
		CurrentResource = Water
		InitialAmount = 0
		Volume = 1.50699997
	}
	TANK
	{
		TankType = Gases
		CurrentResource = Oxygen
		InitialAmount = 0
		Volume = 1.20200002
	}
}

 

Perfect! Thanks a lot!

If you don't mind, I'll include it into the mod configs with a proper attribution.

Link to comment
Share on other sites

sure but use this one..  I realized if I used a bigger tank I would get more accurate results.

 

TANKCONF
{
	name = TAC-LS
	Volume = 38.0569992
	TANK
	{
		TankType = Water
		CurrentResource = Water
		InitialAmount = 0
		Volume = 10.0469999
	}
	TANK
	{
		TankType = Food
		CurrentResource = Food
		InitialAmount = 0
		Volume = 20.0009995
	}
	TANK
	{
		TankType = Gases
		CurrentResource = Oxygen
		InitialAmount = 0
		Volume = 8.00899982
	}
}

 

with this one over a span of 10 years 109 days.  It is off by less than 10 seconds on all 3 resources.

unfortunately I just did it by trial and error.   but if we could figure the math from the TAC mod it could be exact I guess.

 

Oh and I guess the reason I am not seeing the "Edit Tank" button is because you only add that to the vanilla game tanks?  It does not add it to any tanks from mods?

 

 

Link to comment
Share on other sites

could do this with MM  looking for a list of resources and say if the part has one of these resources in it, then consider it a "tank" and add the edit tank feature.

 

could just use the basics, or grab the community resource list and do them all...

there is probably a way to automate this with MM even. tell it to read each entry in the community resource list, and look for it in every other module...  not sure how powerful MM is but this sounds like it may work...

Link to comment
Share on other sites

10 minutes ago, Bit Fiddler said:

could do this with MM  looking for a list of resources and say if the part has one of these resources in it, then consider it a "tank" and add the edit tank feature.

 

could just use the basics, or grab the community resource list and do them all...

there is probably a way to automate this with MM even. tell it to read each entry in the community resource list, and look for it in every other module...  not sure how powerful MM is but this sounds like it may work...

Alas, MM is not THAT powerful; this would require a full-blown programming language.

I do have some utils of my own to automate patching, though. So, using your TANKCONF I'll make the patch for TAC-LS parts.

Edited by allista
Link to comment
Share on other sites

digging into the actual help documents, and mod setting now. to see if I can figure the real math.   the trial and error setup is ok for now but if I can get the exact numbers I will post them here.

 

I just do not see anywhere how much the Oxygen is compressed when stored in liquid form.

Link to comment
Share on other sites

nice

is the .4 a scalar of the volume or did you pick .4 as the value?

 

ah I just realized... if I edit a tank and put each of the 3 to 1 liter I can see the  units per liter by looking at the TAC planner.   I can then use this with the "units per day" in the config option to get exact ratios...

will need to do some testing but I think I will be able to get exact ratios soon

 

Link to comment
Share on other sites

41 minutes ago, Bit Fiddler said:

ya not sure...  just have to pick a number and go with it and see what people say.  I guess 1% is as good as any for a start.

maybe 2 arrows...  a 1% and a 10% ?  maybe this is just over thinking it...

1% and 10% sounds good.

Link to comment
Share on other sites

ok so the final word on this tank config...

 

after much researching, math, and trial and error to fudge it out to 7 decimal points this is what we get. 

 

at 227 years, 403 days.  food and oxygen are exact.  however Water is out of kilter by 1 second.  I am calling this good enough at this point.

 

TANKCONF
{
	name = TAC-LS
	Volume = 1
	TANK
	{
		TankType = Food
		CurrentResource = Food
		InitialAmount = 0
		Volume = 0.5255531
	}
	TANK
	{
		TankType = Water
		CurrentResource = Water
		InitialAmount = 0
		Volume = 0.2639998
	}
	TANK
	{
		TankType = Gases
		CurrentResource = Oxygen
		InitialAmount = 0
		Volume = 0.2104471
	}
}

 

Screenshot%202016-10-19%2001.07.52.png

 

so now the last question about this tank config...  there is a spot for an initial amount.  if I put an overly-large number in here when I create a tank it will fill it up automatically as this number is bigger than any conceivable tank I might make.   will this cause a problem in any of the math in your mod?  or is it safe to set the "InitialAmmount" to something like "9999999999"?

Edited by Bit Fiddler
Link to comment
Share on other sites

1 hour ago, Bit Fiddler said:

so is this new version up for DL yet?

Nope, sorry, this will have to wait a little. For one thing, there are some things still to test (with TS and others); but besides this I had to make some changes on the AT_Utils side, so other mods are affected as well. The downside of code sharing...

41 minutes ago, Bit Fiddler said:

ok so the final word on this tank config...

after much researching, math, and trial and error to fudge it out to 7 decimal points this is what we get. 

at 227 years, 403 days.  food and oxygen are exact.  however Water is out of kilter by 1 second.  I am calling this good enough at this point.

so now the last question about this tank config...  there is a spot for an initial amount.  if I put an overly-large number in here when I create a tank it will fill it up automatically as this number is bigger than any conceivable tank I might make.   will this cause a problem in any of the math in your mod?  or is it safe to set the "InitialAmmount" to something like "9999999999"?

Amazing!

As for InitialAmount it's just the ratio. From 0 to 1 :cool:

Link to comment
Share on other sites

I would skip the mesh and texture switching unless those mods that do it already disappear.  I think adding in to much to one mod detracts from making it do the 1 thing very well.  and we have several mesh/texture switch options out there already.

 

 

ah well I guess I can remove these long strings of 9's then...  a simple 1 will do

 

Edited by Bit Fiddler
Link to comment
Share on other sites

17 minutes ago, awsumindyman said:

@allista, this looks AMAZING! Congrats on the Modding Monday feature! Might I suggest adding mesh and texture switching as well?

Thanks!

Simple texture switching is already there:

Spoiler

	public class SimpleTextureSwitcher : PartModule
	{
		/// <summary>
		/// The folder in which textures are located. 
		/// Relative to GameData folder.
		/// </summary>
		[KSPField] public string RootFolder = string.Empty;

		/// <summary>
		/// The names of the game objects which main texture should be replaced.
		/// Divided by commas. May be regular expressions.
		/// </summary>
		[KSPField] public string AffectedObjects = string.Empty;
		
		/// <summary>
		/// Names of the textures to choose from. 
		/// </summary>
		[KSPField] public string Textures = string.Empty;
		
		/// <summary>
		/// The texture currently in use.
		/// </summary>
		[KSPField(isPersistant = true, guiActiveEditor = true, guiName = "Texture")]
		public string CurrentTexture = string.Empty;

 

As for the mesh switching and more complicated things, I don't see why not use FS or Interstellar modules for this. They're pretty advanced and mature, so why reimplement?

Edited by allista
Link to comment
Share on other sites

2 minutes ago, allista said:

Thanks!

Simple texture switching is already there:

  Reveal hidden contents


	public class SimpleTextureSwitcher : PartModule
	{
		/// <summary>
		/// The folder in which textures are located. 
		/// Relative to GameData folder.
		/// </summary>
		[KSPField] public string RootFolder = string.Empty;

		/// <summary>
		/// The name of the game objects which main texture should be replaced.
		/// </summary>
		[KSPField] public string AffectedObjects = string.Empty;
		
		/// <summary>
		/// Names of the textures to choose from. 
		/// </summary>
		[KSPField] public string Textures = string.Empty;
		
		/// <summary>
		/// The texture currently in use.
		/// </summary>
		[KSPField(isPersistant = true, guiActiveEditor = true, guiName = "Texture")]
		public string CurrentTexture = string.Empty;

 

As for the mesh switching and more complicated things, I don't see why not use FS or Interstellar modules for this. They're pretty advanced and mature, so why reimplement?

Some might enjoy the advanced flexibility this mod provides, as well as the fact that it is new (less likley to die due to old age/interest in development). I can already see this being used to replace modular fuel tanks for RF.

Edited by awsumindyman
Posted on mobile. 'nuff said
Link to comment
Share on other sites

1 minute ago, awsumindyman said:

Some might enjoy the advanced flexibility this mod provides, as well as the fact that it us new (less likley to die due to old age/interest in development).

I'll consider this :)

Link to comment
Share on other sites

ok so I understand that KSP will not allow us to have 2 tanks defined in a single part that hold the same resource.  but I think your mod is allowing this to happen and then the tank is FUBAR and must be removed from the ship and replaced with a new one.

 

I am not sure this is the cause of this strange behavior.  I will examine it in more detail if it happens again.

Link to comment
Share on other sites

2 minutes ago, Bit Fiddler said:

ok so I understand that KSP will not allow us to have 2 tanks defined in a single part that hold the same resource.  but I think your mod is allowing this to happen and then the tank is FUBAR and must be removed from the ship and replaced with a new one.

I am not sure this is the cause of this strange behavior.  I will examine it in more detail if it happens again.

What strange behaviour?

If you switch to an already occupied resource, the tank will remain empty (just using the space) and will wait until you switch to a non-occupied one. It should display a message about that too.

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