XCOM 2
Not enough ratings
Remove Corpses Console Command
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
38.771 KB
11 Jul, 2024 @ 5:19pm
1 Change Note ( view )

Subscribe to download
Remove Corpses Console Command

Description
What if you wanted to farm 200+ kills on the Avenger Defense mission, but Windows said, "Pure virtual function being called while application was running (GIsRunning == 1)"?

Launch the game with the commandline option "-allowconsole", press tilde or slash to open the console, and type "RemoveCorpses" to delete the dead. It won't remove downed XCOM soldiers, but no guarantees it won't dematerialize your dead VIP. I recommend removing corpses at least once every few dozen kills (depending on how good your computer is); it can't fix a save file that has already reached the turn it crashes on, but you can safely add this mod mid-campaign and even mid-mission if things are getting slow.

Before this mod, I crashed at about 204 kills. Reloading the save would always lead to a crash at the start of my next turn (when the game tried to autosave). After reloading the mission from when I had about 54 kills and regularly removing corpses, I've gotten to 319 kills without a problem.

"Why does it delete the same aliens when I rerun the command?"
The mod reads The History to get a list of all units; if a unit has ever existed in the current mission, it will be in The History. Purging them from the timeline is an unnecessary, complicated step, so the mod just deletes all the dead aliens, regardless of whether or not they've already been deleted. Fear not, their laggy presence as both potential zombies and 3D models only exists in the past. They will still make the save take longer to load as the game reconstructs the events of the mission though.

No mod class overrides, just one X2DownloadableContentInfo exec function. Should be compatible with every mod, and I assume it works with WOTC (I don't own it).

Credit to Charles (https://gaming.stackexchange.com/a/396246). I had to learn how to mod this game because of you. Feel free to steal what I've already stolen (legally by StackOverflow's Creative Commons copyright rules).
7 Comments
nintendoeats 27 Jul, 2024 @ 7:02pm 
What I want to know is why having too many corpses causes a pure virtual function call :/
Haite 20 Jul, 2024 @ 7:41pm 
THANK YOU
I dreamt with something like this. I think corpses disappearing after certain number of turns, but still collected at the end, would be a more, "elegant" solution, but I'm grateful with whatever we got.
Mumbole  [author] 18 Jul, 2024 @ 10:04am 
@MrCloista They still count as collected.
Mumbole  [author] 18 Jul, 2024 @ 10:03am 
@Skarsatai 2.0 JazzimoX's is correct, the deletion of the corpses gets appended to The History, it doesn't remove any bytes from the save file.
MrCloista 18 Jul, 2024 @ 8:47am 
How does this affect Corpse Economy? Do they still count as collected or not? This could be actively extremely detrimental to a campaign.
JazzimoX 17 Jul, 2024 @ 3:44pm 
Based on the author's comment on not changing The History of a save, sounds like the size would stay the same I think.
Skarsatai 2.0 17 Jul, 2024 @ 12:26pm 
Is this going to help with unable to reload a save in tactical when it reached a size above 30mb especially with lost ? Does it still increase after removing the corpses?