Infinite stat recursion on Consciousness for a new weapon. Help please.

Started by ExoticButts, December 05, 2017, 09:45:56 AM

Previous topic - Next topic

ExoticButts

Tried posting on Steam discussions, with no response, so I decided to try here.

I'm making a depleted uranium rifle, with the intention of it being mid-powered in terms of outright damage, causing no bleeding at all (despite firing bullets) but igniting hit pawns and inflicting burns. The weapon loads up fine, fires fine, but upon impact on any pawn, it causes a form of NullPointerException whereby the game seems to try to force itself to find a bleedRate, regardless of there not being one. This causes the infinite Consciousness calculation.

I can't justify giving it bleeding effects as the custom damagetype is "Cauterized Gunshot", i.e. no blood loss inflicted. Applying a bleedRate to the current code also did nothing to solve the problem, either at decent levels or miniscule levels.

One of my other weapons has fully working code that doesn't cause bleeding, so I'm uncertain of what the true cause is. As far as I can tell, it's something to do with the game not wanting a projectile to ignite something.

This mod uses no assemblies, but it does use the Damageworker_Flame workerClass, which might be the cause of the problem, although the T-9 Incendiary Launcher in vanilla uses it as well.

So, ultimately, I turn to the modding community here. What could be the problem, and if you know what the issue is, please let me know how to solve it.

If you need the code itself, check the attachments. They are altered versions of my full files that include ONLY what the depleted uranium rifle uses.

A thanks in advance to anyone who can help me with this; the sooner this gun is working, the sooner I can make some other interesting weapons and potentially get the mod up on the Steam Workshop :)

EDIT: A friend of mine working as a programmer pointed out that I was inflicting the custom hediff of Cauterized Gunshot, but also inflicting a vanilla Burn. I realise that the former IS the latter and removed the additional Burn, which fixed the error :D

[attachment deleted by admin: too old]