Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Wanderer on February 07, 2007, 02:25:18 pm

Title: Time it takes for a ship to die...
Post by: Wanderer on February 07, 2007, 02:25:18 pm
So how is the time that it takes from a ship to actually disappear from ship/object index lists after its hit points have reached zero? For several freighters i manually clocked something about 3.6 seconds but capital ships seem to have much larger 'dying time'. Is it related to ships total hitpoint count, shockwave values, set somewhere in the code, etc.... ?

So if any one has knowledge of this please tell me.
Title: Re: Time it takes for a ship to die...
Post by: redsniper on February 07, 2007, 02:44:59 pm
I think it's related to how much damage the explosion does. Although I also know that with proper fredding you can make a ship explode almost instantly without the whole death-roll thing.
Title: Re: Time it takes for a ship to die...
Post by: CP5670 on February 07, 2007, 03:08:54 pm
Yeah, it depends mainly on the damage. You can set a special explosion for the ship to control the dying time. You can also make it kamikaze if you want it to blow up instantly.
Title: Re: Time it takes for a ship to die...
Post by: Goober5000 on February 07, 2007, 07:28:55 pm
That's on my list of features to add. :)
Title: Re: Time it takes for a ship to die...
Post by: BS403 on February 08, 2007, 12:03:53 am
I thought it was based on the mass of the ship. I had a death star model take 10+ minutes to explode and it only had the hitpoints of the colossus.
Title: Re: Time it takes for a ship to die...
Post by: Wanderer on February 08, 2007, 12:31:25 am
Hmm.. i was thinking it more for this (http://www.hard-light.net/forums/index.php/topic,45089.0.html)... but as it was pointed out that ships may have different dying times due to SEXPs then i need to rework the whole thingye
Title: Re: Time it takes for a ship to die...
Post by: BS403 on February 08, 2007, 01:09:22 am
Ahh pay no attention to what i said.
Title: Re: Time it takes for a ship to die...
Post by: Goober5000 on February 08, 2007, 08:31:11 am
In general, for big ships:

Code: [Select]
delta_time = 3000 + 3000 + (int)(damage*4.0f + 4.0f*objp->radius);
That's in milliseconds.

You can see more detail, and more special cases, by opening the following link and searching for delta_time:
http://fs2source.warpcore.org/cgi-bin/cvsweb/cvsweb.cgi/fs2_open/code/ship/shiphit.cpp?annotate=2.70
Title: Re: Time it takes for a ship to die...
Post by: Wanderer on February 08, 2007, 09:17:28 am
Yay for Goober! That is exactly what i needed.

Big thanks once again.
Title: Re: Time it takes for a ship to die...
Post by: Goober5000 on February 08, 2007, 10:46:53 am
You're welcome. :)