How can I replace enemy's mortars with cannons?

Started by pablo603, August 05, 2019, 07:17:59 AM

Previous topic - Next topic

pablo603

I have created a cannon with all the textures and stuff. I don't want to delete mortars entirely. I just want to change the build scheme during their sieges so they build those cannons instead of mortars. Is it even possible at all? Any help is appreciated!

LWM

From RimWorld/SiegeBlueprintPlacer.cs:


    private static IEnumerable<Blueprint_Build> PlaceArtilleryBlueprints(float points, Map map)
    {
      IEnumerable<ThingDef> artyDefs = from def in DefDatabase<ThingDef>.AllDefs
      where def.building != null && def.building.buildingTags.Contains("Artillery_BaseDestroyer")
      select def;
    ...
        ThingDef artyDef = artyDefs.RandomElement<ThingDef>();


So if you add that tag to your cannons, they will start to show up.  If you remove it from the vanilla mortars, they will no longer show up.

It should be safe to change?  I don't see Artillery_BaseDestroyer mentioned anywhere else in the code...

--LWM