Jump to content

[DEV HALTED][0.90] ChopIt! Detach parts in flight! [v2.6.0; 2015-01-03]


marce

Recommended Posts

Dev halted like stated here

Update 16.12.2014: Recompiled for 0.90

If you don't like the MaxChopDuration to "0", this will remove the requirement to wait.

I often thought: "why can't my Kerbals remove even the smallest part from a vessel". Of course there is KAS which does awesome things, but I wasn't particularly interested in grabbing. At least not always. Since I haven’t found a mod which allows me to do that and a query in the IRC channel showed no result either I quickly hacked something together myself.

Simply put: this mod allows you to detach every part to which you added the ModuleChopIt (be careful: in the download is a MM config which adds it to all parts because I’m lazy) in flight.

And since recently you can also let parts explode after a (configurable) countdown runs down to zero, if you want to (can be fully disabled via config).

There are some configuration options, which are applied globally, not per part:

  • EVAOnly: if set to False the action is always visible, not only on EVA (like on probes) – default is True
  • SurfaceAttachedOnly: if set to False the action is also available for stack attached parts – default is True
  • EjectionForce: a small force is applied to push the part a bit away – default is 1.5
  • ChopContSoundFile: if you don’t like the sound it plays, change the path to a sound file of your liking - default is ChopIt/Sounds/CI_Chop_cont
  • ChopEndSoundFile: if you don’t like the sound it plays, change the path to a sound file of your liking - default is ChopIt/Sounds/CI_Chop_end
  • EnableHighlightParent: if set to True it will add an additional action which allows you to highlight the parent part - default is False
  • ParentHighlightInterval: the duration (in frames) the parent should be highlighted - default is 120 (about 2s)
  • SelfDestructionActive: activate the self destruct feature - default is True
  • SelfDestructionOnlyWithoutParent: if set to True only not attached parts have the feature - default is True
  • DefaultTimerValue: Sets the starting value for the timer - default is 10 (seconds)
  • ShowSelfDestructionCountdown: If set to True a message with the remaining time is shown every second - default is True
  • TimerSoundFile: URL to the sound file played every second - default is ChopIt/Sounds/CI_Beep
  • PlayTimerSound: if set to False the timer sound is not played - default is True
  • ShowTimerManipulationActions: If set to False Increase/decrease Timer actions are hidden (to remove UI clatter) - default is True
  • ExplodeConnectedParts: If set to True the parts directly connected to the "bomb" will explode as well - default is True
  • IncreaseExplosionPotential: If set to False th explosion potential will not be changed - default is True
  • MultiplierForExplosionPotential: Defines the factor the explosion potential of the part is multiplied with - default is 1.25
  • IncreaseExplosionPotentialOfConnectedParts: If set to True the explosion potential of the directly connected parts will be multiplied as well - default is False
  • ExplodeWholeVessel: If Set to Ture the self destruct will explode every part on its vessel - default is False
  • MinChopDuration: min time it takes to chop a part - default is 1.5
  • MaxChopDuration: max time it takes to chop a part - default is 120
  • ChopDurationFunctionParamK: chop time calculation function parameter - default is 2.8856454251540913
  • ChopDurationFunctionParamD: chop time calculation function parameter - default is 9.641447136629273
  • ChopDurationFunctionStackPenaltyFactor: the penalty (multiplication factor) for stack attach - default is 2
  • MaxChopDistance: the distance in which your Kerbal has to stay during chopping; be careful that the distance from the center of the Kerbal to the center of the part is calculated (important for big parts) - default is 2.5

The function calculating the required time is: ((2.8856454251540913*Log[x] + 9.641447136629273)*(1 + x*0.01))/1.5

You can't change the function itself, but the k and d parameters and the lower and upper bonds, that should give you a LOT of flexibility!

If you are using EVAOnly=False there are no time constraints since this is the "cheat" or "maintenance" mode used to remove parts from vessels before deleting mods (to avoid having KSP delete the vessel).

I’m fully aware that this mod can be used in a very cheaty way. For example you could remove empty fuel tanks to reduce weight without a decoupler.

I personally only created it to remove small parts when on EVA which I can somehow explain to myself. Therefore, I decided against making the action available for ActionGroups, automatic detachment is not the intended usage.

Everything else is up to you.

I also made a short video to demonstrate the functionality.

Javascript is disabled. View full album

In this post I show a few pictures how the kaboom feature works.

Based on a user's request I realized that I can be sometimes quite hard to remember which part is the parent of another (like "did I build this rocket bottom up or top down?"), especially for stack parts. With this mod it's important to know that or very unwanted things can happen. Therefore, I added an additional action to highlight the parent.

This step needs a bit of explanation. I did decide for an additional action instead of doing it automatically when the action menu is opened, because that would require an additional addon running all the time and I wanted to keep the footprint of this mod small. I also decided to disable this feature by default, because the parent part is obvious most of the time for surface attached parts which are the actual target of this plugin and I don't want to clutter the action menu more than necessary. But if you want it or need it, you can simply turn it on in the config.

I’m creating the thread directly in releases since it’s such a small mod that I hope not to have added to many wtfs. Additionally I don’t plan to add more advanced functionality or safeguards for stuff like detaching a docked part (beware of that, I suppose that crazy things may happen). However, if you do find bugs please tell me and I’ll try to fix them.

  • v2.6.0: added a new part - a small, KAS enabled probe core with vessel self destruct ability
  • v2.5.5: CKAN enabled
  • v2.5.4: recompiled for 0.90
  • v2.5.3: recompiled for 0.25, changed folder structure, requiring util lib
  • v2.5.1: Hotfix for unwanted action triggering
  • v2.5: massive changes. Chopping now takes time & the MM patch is not required any more.
  • v2.1.1: code refactoring & even further performance improvements
  • v2.1: bigger explosions, even more config options and improved performance
  • v2.0.1: added option to hide timer manipulation actions
  • v2.0: added self destruct feature
  • v1.1.1: built against 0.24
  • v1.1: added optional parent highlighting
  • v1.0: initial release

Mod Download, License and Source

Finally I’d like to thank Starwaster & taniwha who helped me realizing that I was operating too low level and therefore increased plugin quality a lot.

I hope it will be useful for someone :)

Edited by marce
2.6.0 release
Link to comment
Share on other sites

Yup. I think you are a robot. Nice going!

Hey, since I'm waiting for the creative department to finish models & texture @ActiveStruts and ZI has a RL weekend I had to do something, right? :wink:

Thanks anyway!

Link to comment
Share on other sites

So....This could save my multi-day of real time mission when a decoupler malfunctions? If i set surface attach and eva only to false of course

I you want to use it this way, yes it should work.

However, be careful: it will detach from its parent. So if you built the rocket bottom up you'll end up with the decoupler still sitting on the upper end.

Since it is difficult to remember which part was the parent (at least for stack parts) I added a function to highlight the parent, so that you can look at which part you have to activate the detach action. Please see the soon to be updated OP for details and the new download.

Javascript is disabled. View full album
Link to comment
Share on other sites

I wonder what that all means.

Well, it seems that through my work on ActiveStruts I had my head full of joints and so I actually tried to destory the attachJoint of parts. Then I ran into problems because physical insignificant parts doesn't have one.

The two of them pointed out that I'm thinking too low level since there is part.decouple() which does exactly what I want :wink: I consider this an improvement of the core functionality, how small it might be.

Link to comment
Share on other sites

:huh: Are you happy marce ? Now we'll have to face a new threat: vandalism ! Be careful kerbals, some evil gremlins will chop your fuel lines, probe, SAS module, RCS thrusters, batteries, ... :D

If only we can also the animation of a kerbals become mad and trying to remove some part by dragging it, beat it, use his big head as hammer, ...

Funny idea and thank you for this plug-in.

Link to comment
Share on other sites

Animations will be quite hard to do (because there is no doc mostly, like to make a kerbal suit himself to a custom seat) anyway it was just a joke of course ;).

I think of a really useful use of your mod and I have an actual example: as I don't use KER that's much, I would like to remove it, I can do it "the hard way" but KSP will aslo play the same hard way with all my ships which have a single small KER chips on them (too bad !), with your mod, I can set up one or more chop-chop/lumberjack mission to first remove all those KER chips I no longer want, then remove safely the mod.

That's lead to a new mod/a feature added to your mod: auto remove all surface attached (without other parts connected to them) part of our choice.

So people can safely remove mod with this kind of parts: KER, Mechjeb, HullCAMVDS, ... there can be a list of vessels (including debris) using the part and a confirm ("do you really want to chop this part for good: Y/N").

Link to comment
Share on other sites

That's lead to a new mod/a feature added to your mod: auto remove all surface attached (without other parts connected to them) part of our choice.

So people can safely remove mod with this kind of parts: KER, Mechjeb, HullCAMVDS, ... there can be a list of vessels (including debris) using the part and a confirm ("do you really want to chop this part for good: Y/N").

I agree that this functionality can be useful, but I'm sorry to say that it's simply out of scope of this mod which I wanted to keep small and simple from the beginning (as stated in the OP).

Think about this mod as "remove [small] surface attached parts on EVA" and nothing more. :wink:

What you suggest involves a whole lot more logic and only thinking about it shows me many problems.

Wherever possible (like MJ) I personally add the module to existing parts instead of using the mod parts, so that I don't have a problem when I remove the mod.

Anyway, doing such a mod removal plugin is nothing I could do easily (if at all), so maybe you suggest it as an idea/request and hope that one of the experienced modders will pick the idea up.

Link to comment
Share on other sites

Very nice mod, thanks a lot.

It came in handy when my rescue mission on Laythe found that the lander was a bit heavy. Since they were on the surface for months, I didn't think it was cheating if they got out the hacksaw and removed a bunch of empty rcs tanks, landing legs, and other bits and bobs. Just made it back into orbit with about 10 fuel to spare. :)

Link to comment
Share on other sites

Very nice mod, thanks a lot.

It came in handy when my rescue mission on Laythe found that the lander was a bit heavy. Since they were on the surface for months, I didn't think it was cheating if they got out the hacksaw and removed a bunch of empty rcs tanks, landing legs, and other bits and bobs. Just made it back into orbit with about 10 fuel to spare. :)

You're welcome :)

I think it's not cheating if only small(er) stuff is removed by Kerbals, since in reality opening clamps for some parts could be used and astronauts can handle small tools to remove minor connections.

So what you did is full in the scope I had in mind when creating this.

If you see any bugs: please tell me

Link to comment
Share on other sites

Haha! I just checked and you released this during my problem. I started having it in the morning of the 19th and it continued through to the 20th. If I'd spent more time on the forum and less time working on the problem, maybe I'd have seen this :)

Take that as a lesson, kids. Read the forum instead of trying to solve your problems!

Link to comment
Share on other sites

Hehe, You saying that just made me wish for this mod days ago when a decoupler failed to decouple and no-one helped me.. If only I could've chopped it off! Sigh.. As it was, I just sent a rescue rescue mission to grab everyone and the Science but yeah... being able to actually detach something that should've detached would've been a lot of help then..

This mod is one of my 'won't play without it' now :P

Link to comment
Share on other sites

@marce: don't want to be a pain on your back :cool: it would be nice to have changelog (using spoiler tag eventually) in the 1st post + version in archive name, it helps to know which version we get (especially for people like me who download thing and use them some time later).

Link to comment
Share on other sites

Haha! I just checked and you released this during my problem. I started having it in the morning of the 19th and it continued through to the 20th. If I'd spent more time on the forum and less time working on the problem, maybe I'd have seen this :)

Take that as a lesson, kids. Read the forum instead of trying to solve your problems!

:D

This mod is one of my 'won't play without it' now :P

I feel honored, thank you! :wink:

Make EVERYTHING a decoupler!

[i was going to say more but it sounded dumb when I read over it so I'm leaving that part out xD]

Ahm, thank you I suppose?

@marce: don't want to be a pain on your back :cool: it would be nice to have changelog (using spoiler tag eventually) in the 1st post + version in archive name, it helps to know which version we get (especially for people like me who download thing and use them some time later).

Agreed, should have done that. I'll figure something out soon. Ugly workaround: the dll version should be set correctly if I didn't mess that up too.

Link to comment
Share on other sites

Agreed, should have done that. I'll figure something out soon. Ugly workaround: the dll version should be set correctly if I didn't mess that up too.

Thanks :) appreciated.

It's not a workaround, even ugly, it's IMHO mandatory and the bare minimum (that's why version in library itself has been added for, even most of the plug-ins here doesn't interoperate together which make this less critical) !

Link to comment
Share on other sites

  • 4 weeks later...

Updated to v1.1.1

This is update is only a rebuild against 0.24 for sanity reason. So far everything is working fine for me, if you see any issues please report them. Thanks.

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