Game Development Community

Breakable box

by Tuomas Kaukoranta · 03/05/2009 (6:36 am) · 15 comments

So I was trying to find GG resources to make destructable objects, I found something and decided to "re-post" it here with my own models and explosion effect, particles and sound from findsounds.com

UPDATED: 3/7/09
If you have downloaded earlier version, and update to this, you can delete the rubble.png, it's not in use anymore.

Heres the link:
http://www.mediafire.com/?ynyjunm0twl (FIXED 4.13.2010)

The .rar includes box.dts and debris.dts in their own folder /shapes/box/
There is the box.cs with the explosion script, object datablock and explosion stuff.
Then there are particle I made too.

NOTE: For TGE

To install it, extract the .rar to starter.fps and exec the box.cs in game.cs

You'll find the box in Misc category in editor with the name exBox.

Pic:
http://i301.photobucket.com/albums/nn54/Sgt_Gloppy/exboxes.jpg

Feel free to use this where ever you want.

#1
03/05/2009 (1:43 pm)
Any install instructions? I can't get it to work, I tried just copying the files over but it doesn't show up in the misc section in the world editor creator.
#2
03/05/2009 (4:52 pm)
Thanks for releasing... very nice... Yeah a install doc would have been nice, I agree but overall, thank you very nice work.

Will
#3
03/06/2009 (7:09 am)
@Will
Thanks, Its always a pleasure to hear positive feedback.

@Sgb
Forgot to tell you to exec this, to do so, open starter.fps/server/scripts/game.cs and you see alot of execs (something like this exec("./player.cs");) right after them add exec("./box.cs");

Oh and this has been made for TGE, I don't know if this works with TGEA.

#4
03/06/2009 (10:43 am)
Installation should be a no-brainer. I remember the old destructible object post -- it was my early inspiration for destroyables.
Quote:I don't know if this works with TGEA
It will, you would only have to change the AudioProfile(BoxBreakSound) to SFXProfile(BoxBreakSound) to make it TGEa compatible. The damage handling method is the same across the two engines. It took me only 5 minutes to port Kaboom! to TGEa.
#5
03/06/2009 (12:16 pm)
Thanks Thomas, it shows up now and I can add it, however when I shoot at it, it will just disappear, it doesn't break or emit any particle effects, just poof gone. I am using TGE 1.5.2
#6
03/06/2009 (1:18 pm)
cute, the debris is a bit bouncy though, like rubber shrapnel
yes, works in TGEA
#7
03/06/2009 (2:16 pm)
Thanks for all the feedback, good to know that this works with TGEA. @Sgb Im using 1.5.2 aswell but I see the effect, I'll look into it and inform you if I find out what is wrong with it.
#8
03/07/2009 (12:03 am)
@Sgb

Try this to see the effect:

At the end of box.cs or breakableBox.cs there is the schedule with the time of 150MS or 100MS, change it to 200 or 300, that should do it.
#9
05/19/2009 (11:45 am)
Hello,

I've been experimenting with breaking objects, and thought I would check out your files here as it seems like the most updated. I'm a user of 1.5.2 and have installed this into my own project...the box folder into /data/shapes and the box.cs into the /server/misc part. I've put in the appropriate paths in the box.cs, where the calls are made, as well as in the cs.bak. Here's where my problem lies. When I'm in the f11/f4 editor, the new box in the misc file (I've since changed from exbox to a more appropriate name for what I'm doing) doesn't appear when I click on it. More specifically, I click on Misc to drop-down, then click on 'crate' (which you had named exbox before I tweaked it to my needs) but nothing happens.

I'm gonna look at the older destructible object file that was mentioned up above, but would like some constructive feedback here. I feel like I'm missing something?

Thanks.
#10
05/19/2009 (12:19 pm)
I should also mention that I have checked the shapeFile path on my StaticShapeData, and I'm pretty sure that this correct. this is the path I'm using.. "~/data/shapes/box/box.dts" Again, feels like I'm missing alota something here and feedback would be greatly appreciated. :)

update: I've verified that the path isn't the problem, by moving the box.dts and it's partner into different folders...but still can't get he 'crate' to produce anything on my map, from my editor.
#11
05/19/2009 (7:48 pm)
Interestingly enough, I went back and put the code into the actual demo version.. It worked without a hitch. So the question is, what does this depend upon in the demo version, which my own project doesn't have? :)

*Rolls up the sleeves*
#12
05/19/2009 (8:46 pm)
Okay, got it. From the demo I had to pull the staticShape.cs and radiusDamage.cs files and place them in the appropriate place in my project.

Very nice resource.
#13
06/05/2009 (6:26 am)
This is fun! Much better than just %obj.delete();
#15
04/13/2010 (3:16 am)
Link fixed.