Jump to content

[0.17] Fuel Transfer Mod V 0.2.2


younata

Recommended Posts

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?

Oh, my bad - it doesn't exist, I was suggesting that you create it (or something like it) that would then be consumed by other modders. My bad =]

Link to comment
Share on other sites

Just pushed a new commit, added a new interface, IFuelSource.


interface IFuelSource
{
float fuel { get; set; }
int fuelType { get; set; } // can be either regular (0) or RCS (1)
// We may add more in the future if we can dynamically figure out what other mods are available.
// I think it'd be awesome to support more than just these two fuel types.
bool RequestFuel(float amount, int fuelType);
// First checks that we can grab the fuel we want, and if so, removes the fuel from the tank.
// Despite the fact that we do check if your part is not dead, and that it has sufficient fuel,
// you should also check that we didn't mess up.
// The simplest implementation for this would do:
/*
if ((this.States == PartStates.DEAD) || (this.fuel - amount) <= 0 || (this.fuelType != fuelType)
return false;
this.fuel -= amount;
return true;
*/
// If your part does anything special, you may want to implement this differently.
}

Edited by younata
updated interface.
Link to comment
Share on other sites

I've been having some problems with this mod. I sent up a tanker, I sent up another vessel, and they are about 200 meters from each other. The second vessel has the part module, the tanker does not. I cannot transfer fuel... or at least the flow rate and parameters never change. I can provide an SFS if needed... any idea what I'm doing wrong?

Link to comment
Share on other sites

Yes, I am. Or at least I think I am. I click on a destination vessel, I click on a source vessel, and I click on fuel tanks. I then push Transfer Fuel and nothing happens. Any other ideas? Out of curiosity, what do the numbers next to the fuel tank mean?

Link to comment
Share on other sites

Yes, I am. Or at least I think I am. I click on a destination vessel, I click on a source vessel, and I click on fuel tanks. I then push Transfer Fuel and nothing happens. Any other ideas? Out of curiosity, what do the numbers next to the fuel tank mean?

you need destination vessel + destination tank.

You also need source vessel + source tank.

It seems like you may be missing the destination tank?

Link to comment
Share on other sites

Nice Modification, though I think 10k for a fuel transfer to be a bit extreme, to keep it a little more believable I generally try to close to within 50m. But I am having a problem with the RCS fuel transfer. Regular fuel transfer seems to be working fine, but when I select the source or destination tank (the final selection) the entire screen goes blank.

Link to comment
Share on other sites

Nice Modification, though I think 10k for a fuel transfer to be a bit extreme, to keep it a little more believable I generally try to close to within 50m. But I am having a problem with the RCS fuel transfer. Regular fuel transfer seems to be working fine, but when I select the source or destination tank (the final selection) the entire screen goes blank.

Latest release stuff should work fine. http://rachelbrindle.com/ksp/FuelTransferModule.zip.

If you're checking out from the repo and compiling from source, or are using dll from the KSP folder of a checkout, then you're on an unstable version that I'll fix whenever I next have time to work on it (soonest is sometime next week.)

Link to comment
Share on other sites

Latest release stuff should work fine. http://rachelbrindle.com/ksp/FuelTransferModule.zip.

If you're checking out from the repo and compiling from source, or are using dll from the KSP folder of a checkout, then you're on an unstable version that I'll fix whenever I next have time to work on it (soonest is sometime next week.)

Nope ... still got the grey screen.

Link to comment
Share on other sites

Am I missing installation instructions? I'm mostly confused with what I'm supposed to do with this .DS_Store file that's in every folder...

Edit: Did some googling, deleted them and insalle dlike usual, worked fine. But, you should still add some documentation.

Edited by Geeny
Link to comment
Share on other sites

Can I request a feature so you can completely empty a tank, just dumping the fuel.

My plan was to send up a spacecraft with a huge empty tank (borrowed from nova silisko) and then fill them up by sending smaller crafts after it. Thus creating the first kerbin orbit refueling station. However I did not succeed in emptying the tanks. I had hoped for a bug that I could move all fuel from the big tanks into a ship with a small tank nearby. That bug did not exist, at least not in the way I hoped for it...

What did happen is that fuel got transferred but only up to a pretty random number. Since the tanks of the target vehicle were full, I'd expect either no transfer to happen. Or the overload bug I hoped for..

My dream is having 90k rocket fuel orbitting Kerbin, because... What could possibly go wrong?

It'll also be usefull when the interplanetary patch comes out, we can then send up large ships that need loads of fuel and just fill them up in orbit. After all, you would not want to send Jeb to another planet in nothing more than a single person cockpit would you?

Link to comment
Share on other sites

Willow, i can remember that someone made a part which jettisoned the fuel. (You'll have to look for that though, i can't remember in what thread it was).

Alternatively, you could create such part by modifying the part.cfg of an existing rocket/rcs engine. Modify the fuel consumption rate to something very high and make the thrust equal to zero. That should empty your tank very fast.

Link to comment
Share on other sites

Hey Cardinal thanks for the response, I thought about that option, I think I remember though that an empty fuel tank like an engine without tank is marked as spent and after that is no longer useable. The fuel transfer mod could get around this by leaving 0.001 units of fuel in the tank. I did not check how it works for fuel tanks but engines when marked spent are never used again not even if you add fuel to the relevant tanks.

My plan as a workaround was to have some big engines on the tanks combined with those towers you use to hold on to your rocket and dump the engines seconds before the fuel runs out. But the fuel transfer mod would be much cleaner and faster.

Link to comment
Share on other sites

I can't manage to get this to work with 0.16, that's the version I tried this on. I downloaded and installed the most recent release posted.

So I got the source ship built with the transfer pod (ship on cart in pic), transfer rcs tank and a 400L fuel tank. I got the destination ship with a rcs tank and a 1600 fuel tank. I waste the destination ships fuel down to about 200L then try to transfer 400L's of fuel from the source. But when I setup the ships and tanks and click 'transfer' it doesn't do anything.

Pic:

http://i.imgur.com/vT3ZC.jpg

Link to comment
Share on other sites

I tested the effect. And it's confirmed when a fuel tank is fully emptied it becomes marked as spent and the fuel transfer mod can't see those tanks in the list. I'm not sure if that's something the FTM can fix, I think it is an effect of the game logic itself. But emptying the tank to 0.001 litres would probably be a successfull workaround as long as no engines are draining the tank further.

If younata considers this a desired feature of course ;)

Link to comment
Share on other sites

I can't manage to get this to work with 0.16, that's the version I tried this on. I downloaded and installed the most recent release posted.

So I got the source ship built with the transfer pod (ship on cart in pic), transfer rcs tank and a 400L fuel tank. I got the destination ship with a rcs tank and a 1600 fuel tank. I waste the destination ships fuel down to about 200L then try to transfer 400L's of fuel from the source. But when I setup the ships and tanks and click 'transfer' it doesn't do anything.

Pic:

http://i.imgur.com/vT3ZC.jpg

https://github.com/younata/FuelTransferModule/issues/9

Your bug is reported. It's honestly not that high up in the priority list (In fact, the code is doing precisely what it should do by not letting you transfer 400 liters from a tank that only has ~200 liters - though it should auto-downgrade to just 100% of the remaining fuel if you are trying to grab more than it has), but it'll eventually get fixed.

I tested the effect. And it's confirmed when a fuel tank is fully emptied it becomes marked as spent and the fuel transfer mod can't see those tanks in the list. I'm not sure if that's something the FTM can fix, I think it is an effect of the game logic itself. But emptying the tank to 0.001 litres would probably be a successfull workaround as long as no engines are draining the tank further.

If younata considers this a desired feature of course ;)

You just want to empty fuel? That's doable, I'll add it as an enhancement.

https://github.com/younata/FuelTransferModule/issues/10

Link to comment
Share on other sites

I think you've misunderstood Deviantdigi (unless i'm the one who has misunderstood).

As i understand: Ship 1 (source) has 400 fuel. Ship 2 (destination) had 1600 and now just has 200. Transferring the 400 from ship 1 to ship 2 doesn't work.

Oh, hey. you're right. And he has the slider at "Transfer no fuel", which means the code is working exactly as expected...

My bad.

Link to comment
Share on other sites

Nice mod, I was wondering if you could code this to work on any thing that has a fuel meter, I.E. zoxygene, electrical energy, Etc. Then I could resupply my mun base with power and oxygen besides RCS fuel.

Edited by azawada
Link to comment
Share on other sites

You seem to be very defensive about your code and that "bug report" was very clear.

I knew there was a step I was missing, why I asked. But sorry for the confusion, I thought the slider was a progress bar XD. I tried again with this new slider theory you guys came up with.. :] worked.

Thanks for the mod and help.

Link to comment
Share on other sites

Due to the absence of a proper manual it took me quite a while to understand how the mod works. It would be nice if you could provide (new) users of the mod with an explanation how to use the mod.

I have found two bugs so far.

1) When trying to transfer RCS fuel, the program interface turns grey as soon as the detination tank has been selected. The user has no more control of the mod and looses the possibility to end the flight when the interface covers the small control screen (with Resume flight .......End Flight).

2) The mod only allows for 1 FUEL transfer to a ship. If a second refueling to that same ship is necessary, one has to exit the game and restart it.

I'm using version 0.1.4 of the fueltransfer mod, KSP 0.16, the only additional mod is Cart133.

Link to comment
Share on other sites

...two bugs so far.

1) When trying to transfer RCS fuel, the program interface turns grey as soon as the detination tank has been selected. The user has no more control of the mod and looses the possibility to end the flight when the interface covers the small control screen (with Resume flight .......End Flight).

2) The mod only allows for 1 FUEL transfer to a ship. If a second refueling to that same ship is necessary, one has to exit the game and restart it.

I can confirm encountering both of these bugs, but have found a workaround of sorts for #1) .... I am able to use the [] keys to change focus to the other ship and use the small control screen there (Resume flight .......End Flight) to return to the Tracking Center. (Note: I cannot actually do the RCS fuel transfer, just recover from the bug)

Edited by ptaylor25
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...