Is it possible to add new core features?

Started by achan1989, September 20, 2015, 09:51:16 AM

Previous topic - Next topic

achan1989

I'm trying to add a new race property, but it looks like there is no sane way to do that.  Can anyone tell me otherwise?

The modding wiki mentions the existence of patching and C# injection, but gives no details.  Could those be useful at all?

Alistaire

#1
I've started writing the tutorial here.

TL;DR: You can't add a new <race> property, at least not easily (you need to rewrite tons of classes for it). You can however make a new <thingDef> property by making a custom thingDef class. Look at the Example and Counterexample for those.

achan1989

That's a great tutorial to have, much appreciated.

I had completely overlooked comp classes, so it was nice to have that pointed out :P
I don't fully understand them yet, but it looks like they might be sufficient for what I want to do.  Thanks.

Alistaire

I'll have to work on the comp part a bit. You might want to look into Rimfire's source code or CombatRealism's source code for it.

If you feel like getting more advise you could always join in on the RimWorldMod Slack (Warning: Tynan declined the invitation because it would take a lot off dev time. It's called Slack for a reason)