RimWorld

RimWorld

Character Editor
Do not add apparel when adding pawn.
There's a species mod I was using that disallows all apparel on the pawn, and when creating an instance of such pawn in the editor, logger logs the following exception (and creation fails):

Exception filling window for CharacterEditor.EditorUI: System.NullReferenceException: Object reference not set to an instance of an object
at CharacterEditor.ApparelTool.ReplaceAndWearRandomApparel (Verse.Pawn pawn, RimWorld.Apparel a, Verse.ApparelLayerDef ald, System.Boolean pawnSpecific) [0x00150] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.ApparelTool.Redress (Verse.Pawn pawn, CharacterEditor.Selected selected, System.Boolean originalColors, System.Int32 numberOfLayers, System.Boolean pawnSpecific) [0x0009b] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.PawnCreator.CreateNewPawn (Verse.PawnKindDef pkd, RimWorld.Faction f) [0x002d9] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.PawnCreator.AddOrCreateNewPawn (System.Collections.Generic.List`1[T] lpkd, RimWorld.Faction f, Verse.IntVec3 pos, Verse.Pawn pawnFromSlot) [0x00052] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.PawnCreator.AddOrCreateNewPawn (Verse.PawnKindDef pkd, RimWorld.Faction faction, Verse.IntVec3 pos, Verse.Pawn pawnToReplace) [0x0000d] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.BlockPawnList.AAddStartPawn () [0x00018] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.SZWidgets.ButtonImage (System.Single x, System.Single y, System.Single w, System.Single h, System.String texPath, System.Action action, System.String toolTip) [0x00029] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.BlockPawnList.DrawTopBottons (System.Int32 x, System.Int32& y, System.Int32 w) [0x00026] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.BlockPawnList.Draw (System.Int32 x, System.Int32 y, System.Int32 w, System.Int32 h) [0x00034] in <f160cb54a36643798f2d8df5164f717a>:0
at CharacterEditor.EditorUI.DoWindowContents (UnityEngine.Rect inRect) [0x00015] in <f160cb54a36643798f2d8df5164f717a>:0
at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x00165] in <c36f9493c9844ddaa7fb5c788416098f>:0
Verse.Log:Error(String, Boolean)
Verse.Window:InnerWindowOnGUI(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

I used ILSpy to trace it to the line in CharacterEditor.PawnCreator.CreateNewPawn

val.Redress(null, originalColors: true, -1, pawnSpecific: true);

and

foreach (ApparelLayerDef item in list)
{
pawn.ReplaceAndWearRandomApparel(null, item, pawnSpecific);
}

I'm trying to fix this myself, but the decompiled code in ILSpy cannot be recompiled, and there's no code available. I'm now looking into the species mod to add some apparel layers.
< >
Showing 1-1 of 1 comments
Rexaurus 4 Apr, 2021 @ 10:26am 
If you don't mind, could you specify which species mod it was? Because I'm having the exact same problem with the Android Tiers and Android Tiers TX mods, I will be starting a new discussion so this problem gains a higher visuability.
< >
Showing 1-1 of 1 comments
Per page: 1530 50