Script mod loads but static constructor never fires — [Tunable] kInstantiator not triggering
I'm building a standalone Sims 3 script mod called SimReserve. The assembly loads correctly (confirmed in ErrorTrap's Loaded Assemblies list every session) but the static constructor never fires — no notifications appear and no interactions inject onto any object.
I have (perhaps foolishly) also been using Claude Code in addition to Visual Studio and
S3PE **What I've verified/tried:**
- `[assembly: Tunable]` and `[assembly: PersistableStatic]` both present in AssemblyInfo.cs
- `[Tunable] public static bool kInstantiator = false;` on the field directly
- Bootstrap class is a normal non-static `public class` (not `static class`)
- Compiled with Roslyn (linker version 48.0, matching working mods)
- corflags `0x00000003` (ILONLY + 32BITREQUIRED) matching working mods
- XML resource type `0x0333406C` with instance ID = FNV64 of `SimReserve.Core` generated by S3PE's FNV64 button
- Packaged manually in
S3PE - Tried both `World.OnWorldLoadFinishedEventHandler +=` (public accessor) and raw `ldsfld/Delegate.Combine/stsfld` on `sOnWorldLoadFinishedEventHandler` via IL patch
- Compared byte-for-byte against twinsimming_Attend University Online which works in my game
- Tested a minimal NomTest mod mirroring the Pausinator tutorial exactly — also fails
**Core.cs:**
```csharp
using System;
using Sims3.Gameplay.CAS;
using Sims3.Gameplay.EventSystem;
using Sims3.Gameplay.Utilities;
using Sims3.SimIFace;
using Sims3.UI;
namespace SimReserve
{
public class Core
{
[Tunable]
public static bool kInstantiator = false;
private static string sBootError = null;
static Core()
{
try
{
World.OnStartupAppEventHandler += OnStartupApp;
LoadSaveManager.ObjectGroupsPreLoad += OnPreLoad;
World.OnWorldLoadFinishedEventHandler += OnWorldLoadFinished;
World.OnWorldQuitEventHandler += OnWorldQuit;
}
catch (Exception ex)
{
sBootError = ex.Message;
}
}
private static void OnPreLoad() { }
private static void OnStartupApp(object sender, EventArgs e)
{
string msg = sBootError != null
? "SimReserve boot FAILED: " + sBootError
: "SimReserve: startup fired OK";
StyledNotification.Show(new StyledNotification.Format(
msg, StyledNotification.NotificationStyle.kGameMessagePositive));
}
private static void OnWorldLoadFinished(object sender, EventArgs e)
{
StyledNotification.Show(new StyledNotification.Format(
"SimReserve: world load fired",
StyledNotification.NotificationStyle.kGameMessagePositive));
try
{
if (Household.ActiveHousehold != null)
StartSimReserve();
else
EventTracker.AddListener(EventTypeId.kEventSimSelected,
new ProcessEventDelegate(OnSimSelected));
}
catch (Exception ex)
{
StyledNotification.Show(new StyledNotification.Format(
"SimReserve inject error: " + ex.Message,
StyledNotification.NotificationStyle.kDebugAlert));
}
}
private static ListenerAction OnSimSelected(Event e)
{
try
{
if (Household.ActiveHousehold != null)
{
StartSimReserve();
return ListenerAction.Remove;
}
}
catch { }
return ListenerAction.Keep;
}
private static void OnWorldQuit(object sender, EventArgs e) { }
private static void StartSimReserve()
{
LedgerManager.OnWorldLoad();
SimReserveInjector.InjectAll();
SimReserveInjector.InjectAllSims();
SimReserveInjector.SetupReactivity();
}
}
}
```
**AssemblyInfo.cs:**
```csharp
using System.Reflection;
using System.Runtime.InteropServices;
using Sims3.SimIFace;
[assembly: AssemblyTitle("SimReserve")]
[assembly: AssemblyDescription("SimReserve Financial Simulation Mod")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SimReserve")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: Tunable]
[assembly: PersistableStatic]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: Guid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890")]
[assembly: AssemblyFileVersion("1.0.0.0")]
```
Any help identifying what's missing would be greatly appreciated. Running game version 1.67.2