Jump to content

How to make permanent corpses disappear?


AtomsChosen

Recommended Posts

I decided to make Workshop Robots unprotected in the creation kit. However a problem I am running into is that when these robots die, their corpses don't disappear. What determines if corpses are able to disappear and how would I go about making permanent corpses disappear with the corpse checks the game does?

Link to comment
Share on other sites

Depending on the robots and your design, you could try these:

   - unchecking the Respawn flag on their Actor record (then waiting for/performing manually a Cell reset)

   - attaching a script to them then call/remotely calling Disable() on them OnUnload

   - manually removing the corpses with Delete() (note: unless they're promoted to be persistent ([PP]) a conventional Delete() or even the console function "MarkForDelete" should work)

   - use a script extender that force-deletes them even if they're persistent (not recommended for published mods and should only be used if you're at least 100% sure you know what you're doing)

Edited by LarannKiar
Link to comment
Share on other sites

  • 4 weeks later...

@LarannKiar, isnt there a default script that would disable the container, e.g. the actor? Im asking because im searching for a default script which does precisely this but not just for actors, disables them when done. I could use fragments of the noodle cup script in fallout 4 though, but it will only work on activators.

Link to comment
Share on other sites

12 hours ago, Qrsr said:

@LarannKiar, isnt there a default script that would disable the container, e.g. the actor? Im asking because im searching for a default script which does precisely this but not just for actors, disables them when done. I could use fragments of the noodle cup script in fallout 4 though, but it will only work on activators.

Unfortunately I don't know about any vanilla default script that remote disables object references but if you fill the container references into a ReferenceCollectionAlias then basically this script should work:

Make sure to attach it to it to your RefCollectionAlias.

Scriptname YOURSCRIPTNAME extends RefCollectionAlias Const


Event OnUnload(ObjectReference akSenderRef)			; event is sent automatically (i.e., without even registration) when one of the reference in the RefColl (that Papyrus calls it "akSenderRef") gets unloaded
	If akSenderRef as Actor				; try to cast akSenderRef as Actor to check if akSenderRef is an Actor
		If (akSenderRef as Actor).IsDead() == true
			If akSenderRef.IsDisabled() == false
				akSenderRef.Disable()
			EndIf
		EndIf
	EndIf
EndEvent

"Basically" because it doesn't check whether the actor has a Quest Item in their inventory or is persistent or is flagged as temporary ([T]) flag in the console, so eventually it would get disabled even deleted OnUnload if the reference is not persistent anyway) but if you determine, thus know exactly what reference may end up in the RefColl and will get disabled OnUnload then I think it should be okay in most cases.

Edited by LarannKiar
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...