Jump to content

[0.17] Fuel Transfer Mod V 0.2.2


younata

Recommended Posts

Shavik and I from the kerbalspaceprogram subreddit have been working on a mod to allow the transfer of both RCS and regular fuel between vessels.

We're now proud to announce the release of the fuel transfer module!

Currently has two parts: a modification of the RCS tank, and a modification of the 1-kerbal spacepod.

Both the source and destination tanks need to be on vessels which are less than 2000 meters (2 km) away from the craft with the module on it.

This mod works on 0.17.

Latest Release: 0.2.2

Source code is here: https://github.com/younata/FuelTransferModule

You can download the latest release here: http://rachelbrindle.com/ksp/FuelTransferModule.zip

Permalink for this release: http://rachelbrindle.com/ksp/FuelTransferModule-0.2.2.zip

Previous releases:

0.2.1

0.2.0

0.1.4

0.1.3

0.1.2

0.1.1

Imgur albums/images detailing the evolution of the module:

First image posted to the KSP subreddit

Mun landing and return using the module

Minmus landing (and not return...) using the module

Showing off RCS fuel transfer working.

0.2.2:

- Merged pull request from Majiir to fix his issues with MajiirKerbalLib

- It now will hide the window on game pause.

0.2.1:

- Fixed the IFuelSource interface so that it auto-works with other plugins that implement it.

- Fixed bug in getting fuel from regular fuel tanks.

- You can now grab fuel from debris.

0.2.0:

- Added KSPMM compatibility

- added interface IFuelSource - Non RCS/fueltanks can use this module now!

- Rewrote mostly everything.

0.1.4:

- No longer crashes when attempting to transfer RCS

0.1.3:

- Added highlighting of fuel tanks (hover mouse over the "+" button)

- Fixed empty tanks not working

- No longer able to overfill a tank

(Thanks Mirosta!)

0.1.2:

- Fixed bug where you generate infinite fuel by have the source and destination tanks the same.

0.1.1:

- No longer displays information for vessels > 50km away.

- Destination tank must have some amount of fuel in it. (Hopefully we can find a fix, as this is an incredibly annoying workaround for that bug)

0.1:

- Initial Release

Edited by younata
0.2.2
Link to comment
Share on other sites

Feedback:

a) awesome

B) the module works both ways - your part description in VAB should say this.

c) can your "system power" button say something else, like "switch off"

d) can the ship list filter out anything over 100km distance - or include a toggle to do this?

e) you can transfer fuel to a destination tank so that the tank holds more fuel than it's capacity allows

f) slide bar for transfer amount is awesome

g) hit a strange bug where I emptied all the fuel from one craft another and now I can't select the craft with empty tanks to move the fuel back. Craft with empty tanks shows in yellow. Will try to reproduce.

h) simply awesome.

i) can you give the mod a version (like 0.1) in the zip file name and this thread title. I know this is the first release but your next version might get confused with this one.

Please continue working on this. Orbital refueling is the final missing link in KSP imo. :)

edit:

j) does the window remember where it is 'saved' to?

Edited by togfox
Link to comment
Share on other sites

Very interesting. Fuel exchange was the first thing i suggested when modding became possible.

A minor thing: should this not better be in the forum 'Plugin-Powered Addon Releases' or 'Plugin Development and Projects'?

Link to comment
Share on other sites

Feedback:

a) awesome

B) the module works both ways - your part description in VAB should say this.

c) can your "system power" button say something else, like "switch off"

d) can the ship list filter out anything over 100km distance - or include a toggle to do this?

e) you can transfer fuel to a destination tank so that the tank holds more fuel than it's capacity allows

f) slide bar for transfer amount is awesome

g) hit a strange bug where I emptied all the fuel from one craft another and now I can't select the craft with empty tanks to move the fuel back. Craft with empty tanks shows in yellow. Will try to reproduce.

h) simply awesome.

i) can you give the mod a version (like 0.1) in the zip file name and this thread title. I know this is the first release but your next version might get confused with this one.

Please continue working on this. Orbital refueling is the final missing link in KSP imo. :)

edit:

j) does the window remember where it is 'saved' to?

a) Thanks!

B) oops.

c) it can, probably will be changed to that at a later date.

d) I think the only reason we show ships outside of ~50km is debugging. Next release will have that changed.

e) yes. This should not be allowed (as it is cheaper - in terms of weight - to start with 3 tanks, transfer the contents of two of those into the third, jetison the empty tanks, then lift off), but I am unaware of how to check what the fuel capacity of fueltanks are.

f) Thanks! Shavik put that one in.

g) Yeah... Should've mentioned this in the release notes. It doesn't really work to transfer fuel into an empty tank. I'll put a temp-fix in later (after I get in to work)

h) Heheh, thank you!

i) So many things I didn't think of! Thank you!

Link to comment
Share on other sites

Yeah, I was just about to come in and report the overfilling tanks thing. For some reason the plugin also doesn't detect DYJ's crew tank as a fueltank, which is strange, but not your responsibility because it's using weird and wonderful mod parts. I hope you can get the overfilling bug fixed; I feel so dirty now my lander tank has been overflowed! :o

I dunno where you could get help with the checking the capacity of the tank, maybe the IRC?

Link to comment
Share on other sites

Right, so, I apparently can't edit my posts, so here's the info for 0.1.1:

sha1sum: aa7068f3940fc37885420708d8e6a37a0d089d26

md5sum: a5e29ee572336da28cf91e0b5329b343

http://rachelbrindle.com/ksp/FuelTransferModule.zip works as expected.

And!

http://rachelbrindle.com/ksp/FuelTransferModule-0.1.1.zip has this version.

Both are to the exact same zip file.

Changelog:

No longer displays information for vessels > 50km away.

Destination tank must have some amount of fuel in it. (Hopefully we can find a fix, as this is an incredibly annoying workaround for that bug)

Link to comment
Share on other sites

Right, so, I apparently can't edit my posts, so here's the info for 0.1.1:

sha1sum: aa7068f3940fc37885420708d8e6a37a0d089d26

md5sum: a5e29ee572336da28cf91e0b5329b343

http://rachelbrindle.com/ksp/FuelTransferModule.zip works as expected.

And!

http://rachelbrindle.com/ksp/FuelTransferModule-0.1.1.zip has this version.

Both are to the exact same zip file.

Changelog:

No longer displays information for vessels > 50km away.

Destination tank must have some amount of fuel in it. (Hopefully we can find a fix, as this is an incredibly annoying workaround for that bug)

Good to see everyone is enjoying our mod!

Looks like Younata is on top of the updates. Keep up the good work.

Link to comment
Share on other sites

I've found a bug. If you set the destination and the source to the same tank, it will fill the tank without draining it, allowing you to create infinite fuel. Awesome mod though, I've been waiting for something like this!

Edited by trbinsc
Forgot to say it was awesome.
Link to comment
Share on other sites

I've found a bug. If you set the destination and the source to the same tank, it will fill the tank without draining it, allowing you to create infinite fuel. Awesome mod though, I've been waiting for something like this!

Sounds like a feature to me! ;)

Link to comment
Share on other sites

Released 0.1.2, fixing the bug trbinsc pointed out.

http://rachelbrindle.com/ksp/FuelTransferModule.zip works as expected.

http://rachelbrindle.com/ksp/FuelTransferModule-0.1.2.zip is the permalink to this release.

If you liked that bug, you can still download it from http://rachelbrindle.com/ksp/FuelTransferModule-0.1.1.zip (though, the initial release is no longer available from me)

Complete changelog! (This is in the README on the github page)

0.1.2:

- Fixed bug where you generate infinite fuel by have the source and destination tanks the same.

0.1.1:

- No longer displays information for vessels > 50km away.

- Destination tank must have some amount of fuel in it. (Hopefully we can find a fix, as this is an incredibly annoying workaround for that bug)

0.1:

- Initial Release

Link to comment
Share on other sites

I'm interested to see how far this mod can go; it looks very interesting.

[ocd] Should this be in Plugin-Powered? [/ocd]

IF a moderator wants to move it, I'm fine with that.

How far? You can transfer regular fuel (rocket and airplane) and RCS fuel from up to 2km away.

You can also do things like, transfer fuel from a to c, where the network looks like:

(a)----(2 km)----(B)----(2 km)----©

where b is the craft with this module in it.

This max distance is subject to being shortened, but that requires me (and shavik) to be better at rendezvous in order to test it. :D

I actually have a save file which is just named "fuel transfer testing", where I have two craft that are at 1mm circular orbit and are less than 2km away from each other.

Link to comment
Share on other sites

Released version 0.1.3!

http://rachelbrindle.com/ksp/FuelTransferModule.zip

http://rachelbrindle.com/ksp/FuelTransferModule-0.1.3.zip

sha1sum: 59d7bb1228a1022139244e4ecfc149c8ba8f16b6

md5sum: e80424a42271b600686fdb42b3d9cbf3

Changelist:

0.1.3:

- Added highlighting of fuel tanks (hover mouse over the "+" button)

- Fixed empty tanks not working

- No longer able to overfill a tank

(Thanks Mirosta!)

0.1.2:

- Fixed bug where you generate infinite fuel by have the source and destination tanks the same.

0.1.1:

- No longer displays information for vessels > 50km away.

- Destination tank must have some amount of fuel in it. (Hopefully we can find a fix, as this is an incredibly annoying workaround for that bug)

0.1:

- Initial Release

Link to comment
Share on other sites

Very cool mod! I'm excited about the potential here. You did some pretty clever stuff in the source!

A few notes:

In FuelTransferModule.cs:

Line 217 - Unity already has really good vector math. You can just do something like:

Vector3 difference = a.transform.position - b.transform.position;

float distance = difference.magnitude;

instead of re-implementing the vector math yourself!

Also, I like your search through the partloader to figure out the original fuel level of the part. That's something that has eluded me for the longest time.

It seems like the real challenge is figuring out how to reactivate "dead" parts, assuming that's something that can be done via the API.

Edited by Zorkinian
Link to comment
Share on other sites

Also, I like your search through the partloader to figure out the original fuel level of the part. That's something that has eluded me for the longest time.

You can thank Mirosta for that addition.

It seems like the real challenge is figuring out how to reactivate "dead" parts, assuming that's something that can be done via the API.

Part.force_activate()

You can also thank Mirosta for that addition. This entire last release is pretty much his pull request.

Link to comment
Share on other sites

Have you considered letting other objects identify as fuel sources? Say, any part that implements some interface like...ITransferrableFuelSource?

This is of particular interest to me - my mod Orbital Construction allows people to store fuel up in SpaceDocks for ship construction. However, it would be cool to let passing ships also draw off that fuel supply for mid-mission adventures. The SpaceDock part definitely isn't a FuelTank, and probably shouldn't try to inherit from it, but it does have its own model for storing/releasing fuel.

In addition, I'm sure other modders will think of interesting ways to create fuel sources (like a mining platform on Minimus, maybe some sort of scoop to be deployed in the Sun's corona or on a gas giant) - creating a platform they can work off would be interesting. =]

Link to comment
Share on other sites

Have you considered letting other objects identify as fuel sources? Say, any part that implements some interface like...ITransferrableFuelSource?

Considering as how prior to reading your comment, I was unaware of the existence of that interface, I'm considering it.

Looking through the Assembly browser of Assembly-CSharp.dll, I cannot find that interface. Care to link to where I can find that interface?

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