C# RimWorld info snippets

Started by Architect, April 14, 2014, 05:12:58 PM

Previous topic - Next topic

Architect

For those interested in C# programming and who may have run into issues you feel could benefit others, I was thinking you all could feel free to post them here. I'd appreciate it if this thread could be limited purely to questions followed by solutions, so no experimental or theoretical things :P

I'll start off with posting the most recent issue I had as it took place here:
Quote from: Tynan on April 14, 2014, 03:57:55 PM
Deconstruction requires that the faction be set. You can only deconstruct your own stuff. Yes, all building have a faction; maybe I should remove this because it's insensible. But anyway.

So just do

Thing t = ThingMaker.MakeThing( def );
t.SetFactionDirect( Faction.OfColony );
GenSpawn.Spawn(t, pos);

Note the use of SetFactionDirect during init.
Check out BetterPower+ and all its derivatives by clicking the picture below.

It adds many new methods of power generation and uses for it, as well as other things such as incidents.