WeaponStats

MOD Desc
Adds a ‘Weapons’ tab – list of ranged, melee, explosive and other weapons present on the current map.

When in dev mode, there is a ‘D’ button on each line which shows some debug info.

Here is an updated and enhanced version for B19:
https://filedn.com/lWv3afQJbf54nYvdSVxmJe8/WeaponsTabB19.zip



Also seeing a black window, this is being spammed in the logs when I open it. I do have mods adding weapons.Exception filling window for WeaponStats.MainTabWindow_WeaponStats: System.NullReferenceException: Object reference not set to an instance of an object at WeaponStats.RangedWeapon.fillFromThing (Verse.Thing th) [0x00000] in :0 at WeaponStats.MainTabWindow_WeaponStats.DoWindowContents (Rect rect) [0x00000] in :0 at Verse.Window+c__AnonStorey2C4.m__1B1 (Int32 x) [0x00000] in :0 Verse.Log:Error(String)Verse.c__AnonStorey2C4:m__1B1(Int32)UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, GUISkin, Int32, Single, Single, GUIStyle)

Exception filling window for WeaponStats.MainTabWindow_WeaponStats: System.NullReferenceException: Object reference not set to an instance of an object at WeaponStats.MainTabWindow_WeaponStats.getAppropriateTab (Verse.Thing th) [0x00000] in :0 at WeaponStats.MainTabWindow_WeaponStats.DoWindowContents (Rect rect) [0x00000] in :0 at Verse.Window+c__AnonStorey2C4.m__1B1 (Int32 x) [0x00000] in :0 Verse.Log:Error(String)Verse.c__AnonStorey2C4:m__1B1(Int32)UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, GUISkin, Int32, Single, Single, GUIStyle)What is this?

So basically the base class for weapons is Thing class which I suppose is common for every item.. from the instance I get name, market value, position on the map, hit points.. basically stats that every item has.. there should not be a problem.Then I need to get weapon specific attributes: stats (accuracy, cooldown etc.) are in Thing.def.statBases; range and damage are in Thing.def.Verbs … in the mod I was simply looping through statBases and Verbs thinking that every weapon has them, but apparently not as trying to loop through a null variable produces the error which posted.So if you had such problems with this mod earlier, now you may see a row with some missing data instead of seeing nothing at all.


Leave a Reply

Your email address will not be published. Required fields are marked *