Jump to content

[0.16] Oi3 Demolition Inc - TNT Pack


Neomatt

Recommended Posts

Do you feel your Kerbals bored, lacking the excitement of a big explosion near their command pod? Tired of cleaning space debris? Want to add that special "deathtrap" touch to your ships?

Well, worry no more! Oi3 Demolition Inc. thought about you, and gives you the best way to achieve this with one simple part: the TNT Pack.

2012-08-08_00002.jpg

v0.3.1: improved GUI for remote (now disappears and appears only if packs are "on") and added beepbeep sound (unzip the sound_beep.wav to the main KSP_WIN/Sounds directory).

v0.3: added C4 pack (remote-triggered), improved on existing code, improved textures.

v0.2: improved on explosions (new parameters in the .cfg: "maxExplosion" is the maximum number of TNT packs exploding per vessel, and "maxExplosionPerTick" the max number of packs at the same time).

v0.1: first release.

- (optional) Kerbals can place TNT packs on nearby ships

- (optional) put a "5...4...3..." countdown

- (optional) altitude-triggered explosions

But what does it do?

It's very simple: once stuck on any discarded stage, the TNT Pack will be prepared to blow up all the pieces.

Once the TNT Pack decoupled, it will trigger a short countdown of 5 seconds (that you can change in the .cfg file), and voilà! No more parts floating in low-orbit!

One pack per discarded vessel is enough for all cleaning needs.

Can I put more than one pack on a future discarded part? How about twenty!

Sure! When in doubt, more boom! The maximum per discarded vessel is 10 packs (above, they don't count).

Sounds great! How do I install it?

Get the file here: http://dl.dropbox.com/u/27482871/Oi3_v0.3.1.zip

It contains the source code, the plug-in dll for explosives, and the TNT Pack part. Just put the files where they should be, and you're all set!

The explosions didn't hurt me! I want weapons!

Well, it IS space: since the TNT Pack destroys any debris (it's its main goal), it has no projectile value, since nothing is sent flying.

That model kinda sucks.

Yeah, it was my first 3D modeling experience. It does the job, but if someone wants to re-do the model (or add other kinds of explosive), he/she's free to propose them here.

Anyway, tell me what you think, if it helps you clean your orbital space without finicking with the save file, or if you just wanted to emulate Wile E. Coyote. :

Edited by Neomatt
Link to comment
Share on other sites

Wow, already used this to shred my (Defunctish) Mir clone station.... good work.

Too bad theres no way to have a Kerbalnaut grab it and stick it satchel charge -like to the side of something....

Link to comment
Share on other sites

I should have put a v0.1 somewhere. And a roadmap. :D

I released it because after a few days of coding, it doesn't crash KSP when I detonate some packs. It can definitely be improved.

Too bad theres no way to have a Kerbalnaut grab it and stick it satchel charge -like to the side of something....

This would be the next step for destroying debris, but I need to think about how it can be done in 0.16; maybe some sort of "put a pack if your Kerbal is near a vessel" thing.

It's at the "end" of the roadmap since I need to learn about GUIs, and create some sort of "remote detonator" (which can track/explode some packs and leave the rest alone).

Two things.

Can the explosion be made bigger?

Can YOU add more tnt packs of varying explosion sizes and times?

I'm only guessing things about explosions now. I realized this morning that the max explosion potential must be 1 (fuel tanks are at 0.8), so putting 3, 10 or 100 like I did doesn't make them bigger.

But if I explode many packs at the same time, the physics engine cries for mercy. I'll probably change this to "explode them at nearly the same time, with a small delay and an upper limit for the number of packs".

That's definitely something I need to investigate and improve on; I want some fireworks too.

As for many packs with various sizes and times... well, my goal is that for the size, you just add more packs, and for delayed explosions, you can clone the part and change the timer in the CFG; I'd like to keep it at "one pack per functionality" if possible (timed, remote, etc).

Could you make a version that explodes on impact? I'd love to use these as genuine bombs for planes that actually damage things.

They have crash resistance like any other part (maybe a bit high; it's still editable in the CFG), so they'll explode on the ground if they reach it . For damage, not sure it will work best with my code; as I said, it destroys the vessel with the part, and only collision damage seems to work in KSP (which is why rockets "explode" randomly; a part explodes, and then it's often 2 tanks crashing into each other due to inertia).

You can try to put "timeBeforeExplosion=999" in the CFG; I need to check what happens in that case, but it should explode (and it's the "normal" way they explode, and what I should try to emulate).

But I like the idea of "pack that doesn't explode by itself", since I already had to do something similar for the current one (as I said, exploding a few packs at the same time explodes KSP too). Not sure how I can limit the number of "timed" packs on a vessel, though.

Otherwise, in my roadmap, there's also sound (a "beep...beep...beep" prior to detonation, spaced by one second) and making a better texture/model.

I'll edit the first post with what I plan to do.

Edited by Neomatt
Link to comment
Share on other sites

First of all thank you for this mod. I like it! The only thing i don't like so much is the shape. Although the sticks of dynamite make it absolutely clear what kind of purpose the part has, i would have preferred something more in the shape of a mine or a package of C4 with a timer. Unprotected dynamite at the side of a rocket doesn't really appeal to me (mind you, the 3D model in itself is quite well done).

Link to comment
Share on other sites

First of all thank you for this mod. I like it! The only thing i don't like so much is the shape. Although the sticks of dynamite make it absolutely clear what kind of purpose the part has, i would have preferred something more in the shape of a mine or a package of C4 with a timer. Unprotected dynamite at the side of a rocket doesn't really appeal to me (mind you, the 3D model in itself is quite well done).

I chose the TNT since it's the most "childish" explosive I could think of; my goal was to make something ACME, not something serious. :)

I did hesitate a while between this and a C4 pack, to appease the Mythbuster in me. Maybe when I get around to make a remote-detonated pack, I'll add a new model and use C4 for this one.

Also, thanks guys for the nice comments on the model/texture! It was my first foray into Blender, so I'm glad it's okay.

edit: I did a quick test at lunch: the "small delay to explode more?" It works great.

I'll test some values (and maybe group some), but just putting a minimal delay and detonating the packs 10 per 10 at the same time should be enough.

re-edit, okay, with 100ms between explosions and 12 packs per explosion, it works nicely without crashing.

I did a "too much vessel" with 72 packs, and a "fireworks vessel" with 19 packs per booster and 6 boosters, they all exploded very nicely without too many errors/deadlocks in the logs. No crashes or lag.

I'll do a release later; still want to put some sound.

Edited by Neomatt
Link to comment
Share on other sites

If you put the 'dynamite' on a rocket engine and stage in space no explosion occurs, the stage just vanishes.

On the engine? Is it on the rocket when you get up? Doesn't it melt?

Maybe I'm missing something here; can you take a picture of your ship in space?

edit: I cannot find a way to put it on the engine, no matter what. How did you do it?

re-edit: ooooooooh, I get it! The display of the stages to the left! However I did have an explosion...

re-re-edit: okay, sometimes I lose the stage display on the left, sometimes not. The explosion happened every time (maybe I changed something? Doubtful).

I need to find the root cause of this bug (me or SQUAD? Or both...), but right now, I have no clue.

The only thing I have as a workaround is to "quit" to the tracking center and get back to my ship.

Edited by Neomatt
Link to comment
Share on other sites

v0.2 is here, with only the new bigger explosions.

Limit of packs is 16 per vessel (you can put more, but they won't explode), and they blow by group of 4 with a 100ms delay.

I know I put more before, but sometimes it crashed hard. So, to be safe, those are the values (you can change both of them in the .cfg if you want to try).

Next step: countdown sound. Then this week-end, I may try to make a GUI for remote explosives.

Edited by Neomatt
Link to comment
Share on other sites

Okay, I'll try out the Kosmos pack tonight. Maybe it's not compatible in some way with my pack.

Download link is bad.

Oops, .zip takes 1 'p'. Fixed.

Edited by Neomatt
Link to comment
Share on other sites

Okay, I'll try out the Kosmos pack tonight. Maybe it's not compatible in some way with my pack..

Okay, I did a few tests with the Kosmos pack; it exploded each time.

However, I noticed something important that may explain the "I didn't see the explosion, it just disappeared"; when the explosion... explodes, it is fixed at a point in space, with no velocity.

That means that if you're going at 3000m/s and the explosions takes 0.5s to go from start to finish, you're going to look at it when it's at 10m (start of explosion, you just decoupled) to 1510m (when it's ended) in half a second.

It creates a quick "fwwt" explosion that can be easily missed, except if you change focuses on the discarded part before it exploded.

Since it's how explosions work (both IRL and in KSP) and that the exploding part depends on SQUAD, I wouldn't call it a bug per se.

You can always try the new pack, put 3-4 more TNT packs, and change the .cfg to want 1 explosion per tick; that will create a quick sequence of explosions, but always "near" you (since the not-yet-exploded packs will travel around your speed).

Link to comment
Share on other sites

New release, with remote-triggered C4 packs, new textures, etc. When in doubt... :)

Also, I cleaned up the code a lot, since it was needed for the remote packs.

Next step (today maybe?): finally do the countdown sound for the timed pack, and maybe a quick beepbeepbeep for both packs just before detonation.

Link to comment
Share on other sites

How about a audible countdown? like " 30 seconds to detonation", etc?

Two issues with that: one, it's 5 seconds (but I could do a 5...4...3...), and two, the duration is variable. So, you could have "5...4...BOOM".

I'm not saying no, but I do like the beeps. :)

I did a 0.3.1 with the beepbeep sound, and I like how parts travelling far (especially the C4) are just beeping like explosive Sputniks. :)

I also improved the GUI a bit for remotes; now, it appears/disappears only when a pack can be exploded (i.e. is decoupled).

edit: hmm, it seems to have some issues with multiple packs (GUI stays/disappears).

I'll double-check on that.

Otherwise, anybody got an idea on how to do a "Jeb goes to an existing debris and adds a C4 pack"? I can imagine how the "add a pack to the debris" part should work, but for him to carry it/place it, I'm not sure how it could work,

Edited by Neomatt
Link to comment
Share on other sites

Wow, that plugin looks cool ! Only problem is, now nobody's going to download my bomb plugin :(...

Whoops, I missed that one when I searched for previous explosive plug-ins. Sorry.

And I did see your PM, I'm responding when I have time (in French probably, since we are both).

Link to comment
Share on other sites

I installed everything well in their respective folders, but I aparace blue and tells me that is not compatible with this version of KSP. I have a 0.16 KSP

Sounds like a file is missing.

Do you have the .dll directly in KSP_win/plugins (no folder)?

Did you put the sounds in the main "sounds" folder?

Link to comment
Share on other sites

  • 3 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...