Referencing a particular textile in C#

Started by Plymouth, August 21, 2018, 03:25:16 PM

Previous topic - Next topic

Plymouth

I've just started delving into C# and came into an obstacle. I don't know how to reference materials written down in XML.

Supes

you might need to be a bit more specific, are you talking about ThingDef.defName or do you mean the stuff that Things are made of.

if you are looking at what something is made from in the XML tag <stuffCategories>then have a look at

Thing.Stuff

(where Thing is the Thing you are looking at) this gets you the ThingDef of what something is made of (eg Synthread, Jade)

if you want the StuffCategoryDef instead, you can look at

Thing.Stuff.stuffProps.categories

this is a list of StuffCategoryDef (eg Woody, Stony, Fabric) the stuff that the thing is made of belongs to.

RawCode

what exactly you want?

there is defdatabase class that handle all defs and allows you to read and ever write to database.