Jump to content

[LE] Alternate way to cleanup dead bodies?


Recommended Posts

I've made a mod which features an arena, you may fight in it yourself, or set teams against eachother and sit back and enjoy the carnage, but either way you can end up with a lot of corpses rather fast. I want to be able to 'clean up' the corpses in the cell as easily as possible, perhaps by pulling a chain which activates a script of some sort. Does anyone have any ideas for a simple solution to this ailment?

Link to comment
Share on other sites

If these are all custom NPCs you placed(not vanilla ones), you could try an easy script(apparently only works for things created through placeatme/actoratme):

Event OnCellDetach()
    if self.IsDead() == true
        self.Delete()
    endif
EndEven

They will be deleted whenever the player leaves the cell, but they have to be dead before then.

 

If these are spawning actors(the "M" markers):

Event OnCellDetach()
    self.SetCriticalStage(self.CritStage_DisintegrateEnd)
EndEvent

Finally if you expect these actors to respawn and are placed in the cell(not created by PlaceAtme/ActorAtMe) and you checked the "Respawns" box on their references, you can let the game clean them up when the cell resets(if the encounterzone allows for it).

Edited by AnishaDawn
Link to comment
Share on other sites

I will give you an idea that i was going to do, but i'm not gonna... i'm one step before i retire from public modding for good this time...


Whenever a dead body needed to be clean/delete a group of hounds would enter the arena and start eating the corpse.

This does require to create 'custom made VFXs' cause there is nothing like this in the game, like pieces of flesh, blood and bones are thrown everywhere when the hounds start eating (splatter).

Plus, either create a custom animation or adapt the existing one for the hounds when they eat the corpse.


@ AnishaDawn

The "Delete()" function should be used ONLY on "Unique" actors, the "Delete()" function does not work the same way as with everything else, this function will completely delete the actor from the game, this means the "Base Actor".


To delete actors you should always use the function "SetCriticalStage()", but the "SetCriticalStage()" need 2 functions to work otherwise it will not fire:



EVENT SomeEvent....
Self.SetCriticalStage(3)
Self.SetCriticalStage(4)
ENDEVENT




This function is not 100% bulletproof as the majority of this game functions, it has a flaw that under certain circumstances a weird glitch can occur.


Glitch:

- You can call "SetCriticalStage()" and the actor disappear/be deleted, but if you don't leave the cell and you save after the deletion has occurred and then load that save the actor might re-appear, and keep re-appearing everytime you enter that cell.

From what i have understand this can happen when you call the functions and at the same time your system is overloaded / working like hell, as a result some of it's internal 'Hard Coded' function don't actually fire.


To avoid this happening in my 'Arena' and messing up the "Master Controller" which listens to specific 'Arena NPCs', which each and a specified number of npc access the Master Controller "OnDeath()" to execute the Master Controllers arena functions on each arena session.


I move the npcs to a dump cell to delete them in this order:

OnDying()

SetCriticalStage(3)


OnDeath()

MoveTo(DumpCell)

SetCriticalStage(4)




I hope it helps and have a happy modding.

Edited by maxarturo
Link to comment
Share on other sites

I doubt he will run into a unique NPC fighting in his own arena. He also should be able to test if they are and not allow them to fight at all.

 

I wonder if a simple .disable command would work here without breaking the game. A .disable would remove them from sight (only).

Be interesting to see if the game then removed them as normal over time. Rather than adding the .markfordelete after that command.

 

Or if they are all custom NPCs a .disable would remove them from sight and a .markfordelete will remove them completely on next game load.

From what I understand (not that I've ever had any problem removing custom NPSs) .markfordelete can be touchy. I'm pretty sure this is due to the

fact there are NPCs you shouldn't kill or remove marked as unique. Also Skyrim has a room of the dead for a reason ...

 

Again, I wonder if a simple .disable command would work here set on the Custom NPC script triggered from on death.

 

You could also just script move the dead body to custom death storage someplace in your mod and let the game

remove them as it normally would with any dead body.

Edited by NexusComa2
Link to comment
Share on other sites

Thank you, everyone!
So how I have it set up is there's two 'stations' for each team with buttons labelled "Goblin Grunt", "Gladiator", "Bait Male" for example, and when you click the button of your choosing that NPC is spawned at an X marker inside of a cage (unless it's something large like a bear, then it's spawned on one side of the arena in the open). So you'd spawn maybe a "Gladiator" in each cage and then open the cage doors with a lever and they'd run out and slice at each other until only one remains. This all works flawlessly too thanks to a lot of scripting help from people on these forums.

So the 'M' you see when placing a levelled actor is not visible in the CK, it just spawns copies of that NPC at the X marker every time you press the same button via a script on the activator.
Just thought I should clarifying in case that gives you guys a better idea of what would work?

In the meantime I will experiment with these suggestions. Thanks again!

-EDIT- Also, that 'Corpse Removal Hounds' idea is amazing but way beyond what I know how to do! :D

Edited by ManKannon89
Link to comment
Share on other sites

I've made a mod which features an arena, you may fight in it yourself, or set teams against eachother and sit back and enjoy the carnage, but either way you can end up with a lot of corpses rather fast. I want to be able to 'clean up' the corpses in the cell as easily as possible, perhaps by pulling a chain which activates a script of some sort. Does anyone have any ideas for a simple solution to this ailment?

Hey, thanks for the help!

The script spawns them with a place at me command so I tried to compile the first script you gave but I get these errors-

"IsDead is not a function or does not exist"

"cannot compare a none to a bool (cast missing or types unrelated)"

 

I am an incredible scripting noob btw, no idea what they're about haha

 

Link to comment
Share on other sites

If your script extends 'ObjecReference' and it's attach to an activator, then it should point towards that actor.

Example:



Scriptname MyArenaScript extends ObjectReference

Actor Property MyActor01 Auto

EVENT SomeEvent...
If ( MyActor01.IsDead() )
; Do Something...
EndIf
ENDEVENT



If your script is added to the actor, then it should extend actor.

Example:



Scriptname MyArenaActorScript extends Actor

Event SomeEvent....
If ( Self.IsDead() )
; Do something...
EndIf
ENDEVENT



I hope it helps.

Edited by maxarturo
Link to comment
Share on other sites

  • Recently Browsing   0 members

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