melee weapon def doesn't work

Started by kito1z, December 31, 2023, 06:44:23 AM

Previous topic - Next topic


Error occurs when I try spawn axe by dev mode:
System.NullReferenceException: Object reference not set to an instance of an object


<?xml version="1.0" encoding="utf-8"?>
  <ThingDef ParentName="BaseMeleeWeapon_Sharp">


I'm not sure if it's still relevant, but I went on some issues recently with my own weapons and worked a while to resolve them, so here it is...

I'm pretty sure "<MoveSpeed>0.1</MoveSpeed>" is NOT an allowed <StatBases> for a weapon. Pretty sure this will cause some errors.
You should try something using <equippedStatOffsets> <MoveSpeed>0.1</MoveSpeed> </equippedStatOffsets> instead (or something similar, i'm writing from memory).

You'll need a "<description>This is an awesome axe</description>", probably after your label.

Less important, but concerning "Axe.png" --> is not an error I think but you dont need the ".png" which is considered default (you can store some .psn for example without any risk of confusion).