Help with custom weapon

Started by VisualValse, March 21, 2018, 11:01:55 PM

Previous topic - Next topic

VisualValse

I've been working on a mod to add elements from Destiny/2 into RimWorld and I'm wondering if there is any way I can attach a condition to a projectile that will cause a pawn to explode/project and AOE on death? Even if it's C#, I can attempt to stumble my way through it.

Thanks.

jamaicancastle

I think this is the easiest way: Create a HediffComp (component) class in C#. Override its Notify_PawnDied method to cause an explosion at the pawn's location. Creating a hediff and adding the comp to it are simple XML. Then it's just a matter of getting a projectile to apply your hediff, which is actually the subject of Jecrell's C# modding tutorial in the stickies.

VisualValse

Quote from: jamaicancastle on March 22, 2018, 08:54:28 AM
I think this is the easiest way: Create a HediffComp (component) class in C#. Override its Notify_PawnDied method to cause an explosion at the pawn's location. Creating a hediff and adding the comp to it are simple XML. Then it's just a matter of getting a projectile to apply your hediff, which is actually the subject of Jecrell's C# modding tutorial in the stickies.

Lovely! I'll give it a shot. Thanks!