NPC Corpses do not decay

Open discussion forum. For topics that do not fit anywhere else.
Locked
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm

NPC Corpses do not decay

Post by tekproxy »

I only did some light digging, and what I found was in corpseControl.

Code: Select all

program control_Corpse(corpse)
	if ( corpse.NPCTemplate() ) // If it's an NPC, this just returns 0
		return 0;
	endif

	var settings := CP_GetSettingsCfgElem("Corpse");
	var decay_wait := CInt(settings.CorpseDecay);
	if ( !decay_wait )
		return 0;
	endif

	Sleep(decay_wait);
	corpse.SetDestroyable(1);
	corpse.MakeRemains();

	return 1;
endprogram
Is this intentional? I'm thinking maybe Austin wanted different NPC corpses to decay at different speeds. I didn't want to spend lots of time digging into this if someone that already knows could give me an answer in a few seconds :).

[edit]Added the word "corpses" after NPC, for clarification.[/edit]
Last edited by tekproxy on Sun Mar 04, 2007 7:59 pm, edited 1 time in total.
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

I use that decay system on my live 097 shard and it works with only minor mods related to my owner's mark items not decaying. There's a minor bug in the corpse methods somewhere that I reported, but it's just console spam to do with the call depth.

The corpse is created by the core. By the time this script runs you are looking at the corpse, not the npc. The settings file contains the decay value of the corpse, after which the corpse is turned into random bones (remains). The contents of the corpse are transferred to the remains.

If you want to see my scripts, let me know.
Locked