Jump to content

[1.12.x] Fill It Up - Adjust Fuel Levels in VAB/SPH


linuxgurugamer

Recommended Posts

Back in 2016, forum user @charliedrewitt wrote a simple utility called Assembly Fuel Utility, which simply adjusted fuel levels in all tanks while in the editor. The original thread is here: https://forum.kerbalspaceprogram.com/index.php?/topic/141062-112-assembly-fuel-utility-v110/   He is no longer around, and I've adopted this mod and enhanced it to allow individual stages to be filled or emptied while in the editor.  I've also renamed it as you can see.

As of now, locked tanks are also modified.  I'll probably add a toggle to ignore locked tanks in the near future

Dependencies

 

Fill It Up button

Ttt4Qrm.png

 

Fill It Up window for entire vessel

k4P9xle.png

 

Showing all the stages (closed)

OOHrqF5.png

 

Showing the stages open

UNxRy1N.png

Availability

Reviewed by Kottobos

Changes from original mod

  • Renamed to FillItUp
  • Added support for changing fuel levels in multiple stages
  • Added ToolbarController support
  • Added ClickThroughBlocker support
  • Added standard build files
  • Added AssemblyVersion.tt
  • Changed background to solid
  • Removed use of jlint
  • Coded window code in c# for performance improvement over the jlint and reduced code size
  • Added toggle to ignore locked tanks
  • Increased width of window slightly to avoid horizontal scroll bar when multiple stages are shown
  • There is now a stock settings page which controls an option to check for not-full tanks and prompt.  This only applies to tanks which were modified by the mod, anything you modify by hand will not be detected.  Dialog shows when attempting to launch
  • Added tooltips to some fields
  • Added ability to lock a resource for a stage or for the entire vessel at runtime, this only applies to the mod, if you want the tanks to be locked, you have to lock them directly
  • Added option to settings page to control whether the tooltips are shown or not
  • Added option to settings page to control whether the locked resources (for the entire vessel only) are saved or not.

Donations gratefully accepted

 Patreon.png

  https://www.patreon.com/linuxgurugamer

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 2 weeks later...

I've noticed an issue with the FillItUp.cfg:

It is not a proper config node so it cannot be patched via MM. Would be nice if we can add resources to the ignore list without editing the original file :)

(I'm setting up a new career game which includes 33 of your mods (so far)...just to warn you that there will probably be a few more bug reports/suggestions in the next time :P)

 

Link to comment
Share on other sites

1 hour ago, 4x4cheesecake said:

I've noticed an issue with the FillItUp.cfg:

It is not a proper config node so it cannot be patched via MM. Would be nice if we can add resources to the ignore list without editing the original file :)

(I'm setting up a new career game which includes 33 of your mods (so far)...just to warn you that there will probably be a few more bug reports/suggestions in the next time :P)

 

It's actually valid, but I do see your point, I'll get it updated soon.

Link to comment
Share on other sites

@linuxgurugamer I have to bug you again about the config file but it can still not be adressed by MM because it is located in the PluginData folder. I guess you placed the file there because the window size is saved in the file as well which would cause the MM configcache to rebuild on the next game launch, so this probably requires to split the file: one for the ignored resources (located outside the PluginData), the other for the window size (located indie PluginData).
I should have notice this before, sry :/

Link to comment
Share on other sites

1 hour ago, 4x4cheesecake said:

@linuxgurugamer I have to bug you again about the config file but it can still not be adressed by MM because it is located in the PluginData folder. I guess you placed the file there because the window size is saved in the file as well which would cause the MM configcache to rebuild on the next game launch, so this probably requires to split the file: one for the ignored resources (located outside the PluginData), the other for the window size (located indie PluginData).
I should have notice this before, sry :/

It is there deliberately for that reason.

I'll have to add an optional file for non-standard resources.

This may take a little bit, it's actually a bit of a problem, given the way the mod was written

Edited by linuxgurugamer
Link to comment
Share on other sites

New release, 0.1.2

  • Removed IgnoredResources from FillItUp/PluginData/FillItUp.cfg
  • Added new file: FillItUp/IgnoredResources.cfg which now contains the ignored resources, one per line.  This change was done so that the resources can be changed at runtime with a ModuleManager script
  • Added ability to lock resources in the Editor for this mod.  This works on single stages as well as the entire vessel
  • Added saving of locked settings for all stages only.  
  • Added stock settings page to control if locked settings should be saved or not (note that this only applies to the entire vessel locks, not individual stages), also whether tooltips should be shown
  • Fixed issue where expanded stages were immediately closing if a change was made
  • Added tooltips
  • Added numeric entry for the "All" slider
Edited by linuxgurugamer
Link to comment
Share on other sites

7 hours ago, linuxgurugamer said:

Added new file: FillItUp/IgnoredResources.cfg which now contains the ignored resources, one per line.  This change was done so that the resources can be changed at runtime with a ModuleManager script

Unfortunately, this doesn't work.

For testing purposes, I wrote this little patch to remove monoprop:

@FILLITUP:FINAL
{
	IgnoredResource = MonoPropellant
}

It also appears in the MM config cache:

UrlConfig
{
	name = FILLITUP
	type = FILLITUP
	parentUrl = FillItUp/IgnoredResources
	FILLITUP
	{
		IgnoredResource = Ore
		IgnoredResource = ElectricCharge
		IgnoredResource = IntakeAir
		IgnoredResource = MonoPropellant
	}
}

But monoprop still get's a functional slider in GUI.

After adding this entry directly to the original file, it works fine though...

Also, I'm getting a NRE after leaving the editor and return to the KSC:
(I didn't even use the mod in this session, just entered the editor and leaved again without placing any parts)

NullReferenceException: Object reference not set to an instance of an object
  at FillItUp.FillItUpConfigNode.LockedToNode (System.Collections.Generic.Dictionary`2 value) [0x00000] in <filename unknown>:0 
  at FillItUp.FillItUpConfigNode.FIU_Save () [0x00000] in <filename unknown>:0 
  at FillItUp.FillItUp.Save () [0x00000] in <filename unknown>:0 
  at FillItUp.FillItUp.OnDestroy () [0x00000] in <filename unknown>:0 

Log: https://www.dropbox.com/s/884h12t01jj4ug8/output_log(FillItUp).txt?dl=0

Edited by 4x4cheesecake
Link to comment
Share on other sites

New release, 0.1.3

  • Changed loading of ignored resources to load from gamedatabase rather than read a file
  • Fixed NRE when not used
  • Added settings option to check for full tanks before launching
  • Added check for full tanks
  • Added dialog to prompt if tanks aren't full.  Can either continue with launch, fill tanks and launch or cancel
Edited by linuxgurugamer
Link to comment
Share on other sites

Two more things about this mod:

1) Everytime when anything is modified on a vessel in the editor, the ignored resources are are listed multiple times in the log:

IgnoredResources.staticIgnoredResource[0: Ore]

IgnoredResources.staticIgnoredResource[1: ElectricCharge]

IgnoredResources.staticIgnoredResource[2: IntakeAir]

2) One more suggestion though: Some tanks are empty by default like the stock shuttle wings or several container of life support mods but FIllItUp always displays them as full or the last state set in the FIllItUp GUI. Same applies to every tank if the fill level is modified via the stock PAW. Would be nice if the mod can check fill level and adjust the GUI settings accordingly :)

Link to comment
Share on other sites

2 hours ago, 4x4cheesecake said:

One more suggestion though: Some tanks are empty by default like the stock shuttle wings or several container of life support mods but FIllItUp always displays them as full or the last state set in the FIllItUp GUI. Same applies to every tank if the fill level is modified via the stock PAW. Would be nice if the mod can check fill level and adjust the GUI settings accordingly :)

That's an interesting point, I'll have to think about it a bit

While I want this to be useful, I don't want to make it too complicated.

Maybe a toggle to ignore all tanks which are empty

Link to comment
Share on other sites

  • 2 weeks later...
24 minutes ago, Craze said:

Updated KSP to version 1.6.1-the problem remained. Here is a screenshot explaining the problem. screen

Ok. First off what language?

Second, can you send me a craft file?

Third, please confirm that the fues levels in the stage don't  change when you move the sliders.

I suspect it may be an issue with the language, will be able to look at in in the morning (night here now)

Link to comment
Share on other sites

12 minutes ago, linuxgurugamer said:

Ok. First off what language?

Second, can you send me a craft file?

Third, please confirm that the fues levels in the stage don't  change when you move the sliders.

I suspect it may be an issue with the language, will be able to look at in in the morning (night here now) 

Language Russian
I can, but I don't know what mods I need, I have a lot of them )) And this is so on any craft.
The fuel level does not change in this mode.
Perhaps, but the names of the parts are in English.

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