Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - thamuzz

#1
Help / Harmony AccessTools help
July 25, 2022, 09:31:43 AM
I'm trying to access a method in a protected class:
public static void GenerateShip(EnemyShipDef shipDef, Map map, TradeShip tradeShip, Faction fac, Lord lord, out Building core, bool clearArea = false, bool wreckEverything = false)

The trouble spot is with the pass by reference on out Building core.  When I try to call:
Traverse.Create(shipCombatManagerType).Method("GenerateShip").Value(...)
I get an error saying that it can't call a method that doesn't exist.  When I try to call

Building core = null;
ref Building coreRef = ref core;
Traverse.Create(shipCombatManagerType).Method("GenerateShip",
                    DefDatabase<EnemyShipDef>.AllDefs.Where(def=>def.spaceSite).RandomElement(),
                    map,
                    null,
                    Faction.OfAncients,
                    null,
                    coreRef,
                    true,
                    true).GetValue();

I don't get any errors but core doesn't get set.  I've tried several other permutations, and I can't quite figure it out.
#2
Mods / Help IDing Problem Mod
August 29, 2021, 06:23:46 PM
My game regularly freezes, and I'm having trouble figuring out which mod is causing the problem.

The most frequent thing in the logs related to the crash is


Deep-saving destroyed thing Shuttle104070 with saveDestroyedThings==false. label=shipThing


although I'm not sure if that is the cause or just a proximal element.