Jump to content

[0.24.2] DebRefund v1.0.13


Vendan

Recommended Posts

It this supposed to recover the launch clamps? Logically it should but I just landed back at KSC and I could see the clamps sitting there on the pad. The end of mission screen didn't list them either.

Link to comment
Share on other sites

I want my clamp money back!

Blame Squad and the fact that debris doesn't give any recovery refund. Sucks, I know, but there isn't a lot to be done about it...

EDIT: apparently

Debris, that is parts without an attached control part (command pod or probe core), don't give a recovery screen when they are recovered. However they do refund the cost for a successful recovery - and the same distance-based calculation is applied. You can check this yourself by bringing up the debug console (accessible via Alt+F2).
Edited by ObsessedWithKSP
Link to comment
Share on other sites

Just add a module manager patch to your mod to make them super cheap (refurbish cost) or free.

If you do, don't forget FASA launch clamps.

EDIT: where is the best place for the dll?

Link to comment
Share on other sites

Just wanted you to know, Kerbal recovery is very easy to add (though it technically kills them first the way I have implemented it). Science recovery was being tricky for me and I couldn't get it working. I think everyone's pretty much agreed that DebRefund is better than StageRecovery, so I'm giving you full permission to use whatever you want from it, if there's anything remotely useful :P I'm going to see about having KCT defer funds recover to DebRefund if it's installed, which should be easy enough to do, but our recovery requirements are slightly different (since you assume some parts aren't recovered and KCT needs to know which parts those are for the Inventory. Therefore KCT will say all the parts are recovered but DebRefund will only refund partially. Not really an issue, just a slight "incompatibility"). If you don't mind, I'm going to check out your source for figuring out how to use the message system. That will be of much use to me later on :)

Link to comment
Share on other sites

Just wanted you to know, Kerbal recovery is very easy to add (though it technically kills them first the way I have implemented it). Science recovery was being tricky for me and I couldn't get it working. I think everyone's pretty much agreed that DebRefund is better than StageRecovery, so I'm giving you full permission to use whatever you want from it, if there's anything remotely useful :P I'm going to see about having KCT defer funds recover to DebRefund if it's installed, which should be easy enough to do, but our recovery requirements are slightly different (since you assume some parts aren't recovered and KCT needs to know which parts those are for the Inventory. Therefore KCT will say all the parts are recovered but DebRefund will only refund partially. Not really an issue, just a slight "incompatibility"). If you don't mind, I'm going to check out your source for figuring out how to use the message system. That will be of much use to me later on :)

Message system is fairly easy. If you are interested, I could add in a check for "does KCT exist", and if so, just pass the vessel, or whatever you want, like a list of parts/whatnot, to it. Just give me an easy to access method and tell me what you are looking for :)

Link to comment
Share on other sites

Message system is fairly easy. If you are interested, I could add in a check for "does KCT exist", and if so, just pass the vessel, or whatever you want, like a list of parts/whatnot, to it. Just give me an easy to access method and tell me what you are looking for :)

A list of part names as strings is all I need. Unfortunately my knowledge of reflection and general API-ness is rather limited, so I have no idea how to actually make anything open to you. Then again, Kerbal_Construction_Time.KCT_Utilities.AddPartToInventory(String partName) may suffice if you can call that. It's a public static void. Let me know if you're going to do that though, so I can delegate recovery checking to you and we don't get duplicate items added to the inventory from my recovery code. If you need something else, let me know and I'll see what I can do.

Link to comment
Share on other sites

A list of part names as strings is all I need. Unfortunately my knowledge of reflection and general API-ness is rather limited, so I have no idea how to actually make anything open to you. Then again, Kerbal_Construction_Time.KCT_Utilities.AddPartToInventory(String partName) may suffice if you can call that. It's a public static void. Let me know if you're going to do that though, so I can delegate recovery checking to you and we don't get duplicate items added to the inventory from my recovery code. If you need something else, let me know and I'll see what I can do.

One more thing, would you be interested in adding a "damage value" so I can pass in how hard they hit down? I know you probably wouldn't use it at first, but it may play a part later on, and then I we don't run into issues with different method signature mismatches.

Link to comment
Share on other sites

One more thing, would you be interested in adding a "damage value" so I can pass in how hard they hit down? I know you probably wouldn't use it at first, but it may play a part later on, and then I we don't run into issues with different method signature mismatches.

Doesn't hurt to add it. Just tell me what I need to add. Once a part enters the inventory I don't keep track of it individually, so I'm not sure what use I will have for it without a rewrite, but I like having options :D

Edit: Just thought of a use. I would have a random chance based on the damage value of the part being useless for future builds, but still salvageable as scrap. Then the funds recovery can still occur no problem and I can just not have those parts be added to the inventory. Adds some extra flavor to using DebRefund with KCT.

Edited by magico13
Link to comment
Share on other sites

Having all red landings, which leads me to ask: How exactly is the chute drag calculated here? Furthermore, on weights, do the script take the difference between a full and an empty fuel tank into consideration when calculating if the parts lands safely?

Link to comment
Share on other sites

So I did some quick research. The formula for drag/mass ratio seems to be:

sum of (drag * mass of chute) / (sum of mass of all parts) 

An empty BACC SRB has a mass of 1.5 t. A Mk-2R Radial Parachutes has 0.15 t mass and 500 drag deployed.

One parachute:

500 * 0.15 = 75 / (1.5 + 0.15) = 45.45..

Would be a failure.

Two Parachutes:

500 * 0.15 * 2 = 150 / (1.5 + 0.15 * 2) = 83.33..

Some damage.

Three Parachutes:

500 * 0.15 * 3 = 225 / (1.5 + 0.15 * 3) = 115.38..

Safe recovery.

As a rule of thumb I would say 1 parachute per 1 t mass makes a reasonably recovery.

I am not sure why I have to multiply the drag with the mass of the parachute, maybe someone could shed some light there?

Link to comment
Share on other sites

That's all I need, I'll take a look at it. Also, everyone, launch clamps autorecover next time you put a ship on the launch pad, so I don't need to do anything there!

Ah nifty, I'll watch the Funds counter next launch. Your RealChute support seems to be working, my last couple of trips I had it back in.

Link to comment
Share on other sites

Brian--Griffin: welcome to the forum!

That's because in stock KSP drag is proportional to mass! (Weird, right?) Every part has a drag coefficient, a part's drag force is equal to its drag coefficient times its mass, and the way stock parachutes work is that when deployed they just increase the drag coefficient to the specified value from the default (usually 0.2).

Link to comment
Share on other sites

For temporary compatibility between DebRefund and RealChutes on my system, I will be simply removing the modulemanager files to make the stock chutes realchute-based. That way I can use the stock chutes, compatible with DebRefund on my discard stages and use RealChutes on my main module.

I thought I'd tell everyone the genius little hack while I was at it so they could use the two mods together. I also mentioned this in the RealChute thread.

Link to comment
Share on other sites

For temporary compatibility between DebRefund and RealChutes on my system, I will be simply removing the modulemanager files to make the stock chutes realchute-based. That way I can use the stock chutes, compatible with DebRefund on my discard stages and use RealChutes on my main module.

I thought I'd tell everyone the genius little hack while I was at it so they could use the two mods together. I also mentioned this in the RealChute thread.

Working RealChute support was put in a few hours ago. What you suggest didn't work with the previous as DebRefund simply checked for the presence of RealChutes and skipped calculating drag for all parachutes.

Link to comment
Share on other sites

Is anybody else experiencing crashes when they enter the VAB with DebRefund installed?

Running the 64-bit Windows version of KSP here, with the latest ModuleManager installed, if that helps.

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