Ludeon Forums

Ludeon Forums

  • November 19, 2019, 09:17:08 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How can I replace enemy's mortars with cannons?  (Read 160 times)

pablo603

  • Colonist
  • ***
  • Posts: 201
  • A dead colonist
    • View Profile
How can I replace enemy's mortars with cannons?
« on: August 05, 2019, 07:17:59 AM »

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!
Logged

LWM

  • Colonist
  • ***
  • Posts: 449
  • Little White Mouse
    • View Profile
Re: How can I replace enemy's mortars with cannons?
« Reply #1 on: August 06, 2019, 12:21:21 AM »

From RimWorld/SiegeBlueprintPlacer.cs:

Code: [Select]
    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
Logged