Remove Corpses Console Command

If you liked this item, please rate it up on Steam Workshop page.

Author: Mumbole

Last revision: 12 Jul, 2024 at 00:19 UTC

File size: 38.77 KB

On Steam Workshop

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).