Jump to content

[Plugin] KIS Box of Shame


Recommended Posts

Unknown how/what changed in .15, hiding this in a spoiler to prevent accidental BFBVFS. If you\'re still running .14x for some reason, you can still use this.

Just a little quick plugin to transfer fuel between ships, shouldn\'t take too long, right? Wrong.

The code to actually find and store the vessels, fuel types, and tanks was untouched since I first compiled this monstrosity yesterday. It worked perfectly then, it works perfectly now. Many hours later, the GUI is still being a moody unresponsive teenage punk, and the scene transition and part message handler are still baffling arcane nightmares.

Rant over, here\'s what I\'ve got now:

screenshot1sg.jpg

For those of you who do not have bionic image enhancing eyes, there are actually two ships in the inky void there.

I think I finally have the ESC menu fail bypassed with a ductape, caramel, and sprinkle combination, but it\'s so unwieldy I feel like a script kiddie. This is unacceptable as I do many foolish things, but I do not do script kiddie.

I was really hoping to get a basic version out this morning, but that\'s just not going to happen. I apparently ended one ship\'s flight by accident, and am very very tired, so I\'m going to admit defeat for now, and try again tomorrow.

Updated a bit.

Edit: Just in case anyone wants to see me code in it\'s current snarled state:

http://dl.dropbox.com/u/74137297/KISFuelTransferDock.cs

Still doesn\'t do useful stuff, but the only true bug I could find with this version was that the vessel matrix doesn\'t clear it\'s contents when ending/switchinging flights. Of course, that\'s only because I never told it to.

License GPL

Link to comment
Share on other sites

It\'s not functional for actually doing anything right now, I just posted the code in case I had solved a problem someone else was still having.

-Where is this 'refuel' thread?

There\'s only two things it does right now:

-Handle GUI stuff in a separate static class.

-Read/store information about vessels and fuel tanks in another separate static class.

I haven\'t added any checks on distance yet, other than the parts needing to be within the ~2km 'off rails' zone. It\'s still in the phase of making sure it\'s working with valid data. I think I found an array of <vessel> in the FlightGlobals, and may end up using that instead, if having the fuel transfer parts reporting themselves doesn\'t work out, though it appears to be working perfectly as it is now.

The real problem is the GUI handling, KSP + Unity wrappers make the GUI system downright arcane, and that\'s what I was fighting last night.

Once I get the GUI setup in a working fashion, actually moving the fuel will be fairly straightforward, as everything I could possibly need to know to get it done is already stored in dictionaries and a master matrix.

I think I\'m just going to land the ships next to the launch pad for testing now, too much time/effort getting them rendezvoused in orbit.

Link to comment
Share on other sites

DF 0.34.08 is finally out, so I\'m not likely to be working on this for a little while.

The GUI code is now in a much more orderly formation, and the only technical parts left are restructuring/repurposing the vessel/fuel matrix as needed, and adding the fuel requests. If someone wanted to take parts of this and make their own fuel transfer plugin while I\'m off in Uristan, go right ahead. I did a bunch of fuel related stuff in my atmo engine plugin for my Broadswords, here\'s the code for that too:

http://dl.dropbox.com/u/74137297/KAtmoEngine.cs

Feel free to copy/paste/rewrite/toast/jam whatever you like out of them.

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