How can I remove corpses?

How can I remove corpses? - Crop unrecognizable man cleaning computer system unit

One of my biggest problems with XCOM 2, specifically the Avenger Defense mission, is the enemy corpses. When you save a game, and reload it, it saves the position of all the corpses, so corpses don't disappear at all. If you're like me, and you use the Avenger Defense mission as a way to fully promote your squad, once you get to 50 enemies killed it starts lagging hard, due to the amount of corpses on screen.

What setting do I need to tweak in the .ini files to remove corpses? This is getting fairly annoying as I have had to force evac when my team was healthy enough to continue the fight, but my computer couldn't stand it anymore.



Best Answer

I wrote a console command for this for a mod.
I don't have time to publish a mod at the moment but you can easily copy this function into your own mod that you can create with XCOM 2 Development Tools from Steam.

Guide to create mods is here:
https://www.reddit.com/r/xcom2mods/comments/5oz2n5/how_to_compile_metamods_with_long_war_2/

You also need to enable the Console.

This function should keep all the corpses for looting if looting is possible.

exec function RemoveCorpses() {
    
    local XComGameStateHistory History;
    local XComGameState NewGameState;
    
    local XComGameState_Unit UnitState;
 
    History = `XCOMHISTORY;
    
    NewGameState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("Cleanup corpses");
    
    foreach History.IterateByClassType(class'XComGameState_Unit', UnitState) {
        
        // IsSoldier()
        // XComHQ.IsUnitInSquad(UnitState.GetReference())
        if( UnitState.IsPlayerControlled() || UnitState.bSpawnedFromAvenger ) {
            
        } else {
            if (UnitState.IsDead()) {
                UnitState = XComGameState_Unit(NewGameState.CreateStateObject(class'XComGameState_Unit', UnitState.ObjectID));
                
                class'Helpers'.static.OutputMsg("Removing Corpse of " $ UnitState.GetFullName() $ " " $
                        UnitState.GetMyTemplateName());
                
                UnitState.RemoveUnitFromPlay();   
                NewGameState.AddStateObject(UnitState);                
            }
        }
    }
    
    
    `XCOMGAME.GameRuleset.SubmitGameState(NewGameState);
}



Pictures about "How can I remove corpses?"

How can I remove corpses? - Person Holding Can With Blue and White Knit Sweater
How can I remove corpses? - Close-Up Photograph of a Can
How can I remove corpses? - Yellow Haired Woman in Brown Hat Illustration



How do you get rid of a corpse?

Injection into the legitimate body disposal system (e.g. morgue, funeral home, cemetery, crematorium, funeral pyre, cadaver donation) or killings at a health care facility (e.g. Ann Arbor Hospital Murders and Dr. X killings) Burning, often in a building (e.g. possibly the Clinton Avenue Five)

Can you remove corpses Fallout 4?

Look at the corpse, open console, click on corpse, type "markfordelete", hit enter. Done. The next time the cell is loaded, the corpse will be gone.

What is cleaning a dead body called?

Cleaning after dead bodies is the work of crime scene cleaners known as bioremediation experts, forensic cleaners or crime scene cleaners. These people are trained to reduce this trauma by thoroughly disinfecting the corpse and area. These professionals also provide compassionate services to affected people.

Why do we put salt on dead body?

Table salt may temporarily preserve the corpse underground by osmotic withdrawal of cellular water with additional inhibition of microbial growth and decomposition by highly saline environments. However, table salt poured over the body instead of being instilled inside cavities increases the rate of decomposition.



Getting Rid of Respawning Corpses ⚰️ Fallout 4 No Mods Shop Class




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Anete Lusina, Anna Shvets, Tima Miroshnichenko, Alexander Sergienko