[1.5] Collapser - A simple way to deal with overhead mountains

Started by Jaxe, August 26, 2018, 09:10:17 AM

Previous topic - Next topic

Jaxe

Collapser
Version 1.7



Built for RimWorld 1.5
Powered by Harmony
Available on Steam Workshop

Remove overhead mountains on collapse as long as there is non-overhead mountain roof next to the collapse.

Without this mod there is no way to remove overhead mountain, no matter how many times it collapses it does not go away. With this mod if an overhead mountain roof collapses and there is a non-overhead roof on a tile directly adjacent to it then the overhead mountain will be removed.

While there are other mods that enable removing overhead mountains manually like normal roofs, this mod restricts it to only edges of mountains so you could technically remove a whole mountain as long as you start from the edge and work inwards.



This mod can be added or removed from a savegame at any time without issue.

INSTALLATION


Wanderer_joins

You could maybe make it work for larger patches of overhead mountain. Until recently we were able to collapse small isolated patches of overhead mountain in vanilla (up to 10x10) . It has been flagged as a bug and fixed, but it makes sense to be able to collapse small hills.

Jaxe

Quote from: Wanderer_joins on August 27, 2018, 04:31:41 AM
You could maybe make it work for larger patches of overhead mountain.

I'm not sure I understand what you mean by larger patches of overhead mountain. As long as an overhead mountain borders a non-overhead mountain tile, this mod will remove the aforementioned overhead mountain tile when it collapses. So you could remove an entire mountain as long as you collapse the outside first and work inwards.

Wanderer_joins

I meant something like that, when you deconstructed A the whole core collapsed and disappeared. But it's a detail. Nice mod.


Jaxe

Quote from: Wanderer_joins on August 27, 2018, 11:53:43 AM
I meant something like that, when you deconstructed A the whole core collapsed and disappeared. But it's a detail. Nice mod.

The funny thing about making this mod is it took less code to implement it than trying to word what it does. If the core collapsed from your screenshot then I would say that's working as intended and how physics should be. It's definitely not a precise roof removal mod like some others but hopefully it's useful for getting rid of stubborn overhead mountains that float in midair like that.

Urubaen

Hi, your mod seem to cause a bug on my save where my game crash when i destroy a roof on a small moutain. I already bypasse the bug by using devmode for cleaning the moutain but it can probably happen to another player.

The roof at the left on the screenshot collapse and this error appear indefinitely and my map becam grey except when i pause the game (and i'm totally sure that this collapse cause the bug i try few times to destroy the roof)

Root level exception in Update(): System.IndexOutOfRangeException: Array index is out of range.
at Verse.RoofGrid.RoofAt (int,int) <0x00039>
at Collapser.Patch.AdjacentUnroofedTiles (Verse.IntVec3,Verse.Map) <0x000ab>
at Collapser.Patch.Prefix (Verse.IntVec3,Verse.Map) <0x0015a>
at (wrapper dynamic-method) Verse.RoofCollapserImmediate.DropRoofInCellPhaseTwo_Patch1 (Verse.IntVec3,Verse.Map) <0x00040>
at Verse.RoofCollapserImmediate.DropRoofInCells (System.Collections.Generic.List`1<Verse.IntVec3>,Verse.Map,System.Collections.Generic.List`1<Verse.Thing>) <0x00211>
at Verse.RoofCollapseBufferResolver.CollapseRoofsMarkedToCollapse () <0x000b3>
at Verse.Map.MapPreTick () <0x0012a>
at Verse.TickManager.DoSingleTick () <0x0010b>
at Verse.TickManager.TickManagerUpdate () <0x0018b>
at Verse.Game.UpdatePlay () <0x00026>
at Verse.Root_Play.Update () <0x0009d>


[attachment deleted due to age]

Jaxe

Thanks for the report, I'll be posting a fix for this soon. Was this mountain you cleared right on the maps edge?

Jaxe

Updated to v1.1
- Fixed overhead mountain check only applying to 3 sides
- Fixed null reference when collapsing at map's edge

Jaxe


Jaxe

Updated to v1.4:
- Added support for RimWorld 1.2
- Removed support for RimWorld 1.0

Jaxe


Jaxe


Jaxe