Hello, I have decided to update my KSP from 1.8.1 to 1.10.1 and found the issue that few weapon packs I am using get this error, which only occurs on some weapons. I am using Runway project BDA but since that project has no official forum post I am posting it here. The issue doesn't occur merely at aviator arsenal weapons, so that's also why I am not posting it in specific weapon mod threads. Here is the error:
[LOG 13:30:41.294] PartLoader: Compiling Part 'AviatorArsenal/Cannons/Hispano mk2 Enclosed Barrel/hispanoMK2enclosed/N-37'
[EXC 13:30:41.310] NullReferenceException: Object reference not set to an instance of an object
BDArmory.Modules.ModuleWeapon.GetInfo () (at <1a20dbc044c547a8a2dda274d66fc98e>:0)
PartLoader.CompilePartInfo (AvailablePart newPartInfo, Part part) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
PartLoader+<CompileParts>d__56.MoveNext () (at <c1858a3f77504bd1aaa946fdccf84670>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
Since the game freezes loading at this stage, I cannot know what is happening, but if I remove any of those broken parts, it stops at another one and loads only if all of them are removed fully. Anyone encountered this problem or has any idea what can be causing this?
EDIT: From looking at the BDA code, the GetInfo method gets the weapon type, ammo, and all other information. But when I checked the weapon, it is not including all the info. Specifically the explosive boolean and bulletType. I suppose that is causing the nullPointerEx right?
EDIT2: After further investigation I found out that indeed that weapons hasn't the bulletType configured, nor its explosive mass. Explosive miss can be omitted I think, but the test will show...
EDIT3: Yes, explosive is omitted, and adding any bulletType was sufficient to make it work. Now to fix all other broken weapons of weapons packs....
EDIT4: Has BDA weapons configs changed between 1.8.1 and 1.10.1? Because it seems BDA weapons now has airDetonation which wasn't there? How does these airDetonation variables work, if asomeone can tell? I mean its quite obvious how it works, but at what range does the bullet explode? The distance to the target when the bullet is fired or when the bullet is in flight? Or maybe at radar locked target range automatically, or with the timing set to true, at specific distance no matter what? How to time it thou? Any specifics would be sueful and greatly appreciated!
(After testing I found out airDetonation simply detonates the bullets at the max air detonation range (in SPH, couldn't find out how it can be defined in config its called maxAirDetonationRange in config) even when the target is closer, so if it misses, it doesn't explode at his distance. The airDetonationTiming has the functionality to explode at target distance.
EDIT5: I also found proximityDetonation exists but no weapons from stock BDA nor weapon pack is using it. Does it work as bullet proximity detonation like when missile explodes when in proximity? And if so, what variable can set the proximity fuse distance?
(I found out after testing that it works like that, exploding in proximity, but it also needs detonationRange = float variable for the detonation distance and airDetonation true.)
So tl,dr, I fixed all issues and documented my process of doing that.