Default Outfit sets

Started by Shinzy, April 18, 2015, 03:53:09 PM

Previous topic - Next topic

Shinzy

Halllooo!

I tried to rummage around the xml files but couldn't find any place where these things
(see the attachment) are made from

Where can I make my own default sets for my custom clothes from?
like set 'Hurley' which then contains the clothes I tag as such

this would be nice little addition as I've got some talent specific clothing
or would I have to stick with the Worker/Soldier sets

[attachment deleted due to age]

skullywag


private void GenerateStartingOutfits()
{
Outfit outfit = this.MakeNewOutfit();
outfit.label = "Anything";
Outfit outfit2 = this.MakeNewOutfit();
outfit2.label = "Worker";
outfit2.filter.DisallowAll();
foreach (ThingDef current in DefDatabase<ThingDef>.AllDefs)
{
if (current.apparel != null && current.apparel.defaultOutfitTags != null && current.apparel.defaultOutfitTags.Contains("Worker"))
{
outfit2.filter.SetAllow(current, true);
}
}
Outfit outfit3 = this.MakeNewOutfit();
outfit3.label = "Soldier";
outfit3.filter.DisallowAll();
foreach (ThingDef current2 in DefDatabase<ThingDef>.AllDefs)
{
if (current2.apparel != null && current2.apparel.defaultOutfitTags != null && current2.apparel.defaultOutfitTags.Contains("Soldier"))
{
outfit3.filter.SetAllow(current2, true);
}
}
Outfit outfit4 = this.MakeNewOutfit();
outfit4.label = "Nudist";
outfit4.filter.DisallowAll();
foreach (ThingDef current3 in DefDatabase<ThingDef>.AllDefs)
{
if (current3.apparel != null && !current3.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs) && !current3.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso))
{
outfit4.filter.SetAllow(current3, true);
}
}
}

In OutfitDatabase. Looks like tis hardcoded :(

Could you extend this with one of those injector class thingies?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Shinzy


BBream

I made the mod for you. This mod include "OutfitDef" and you can add what you want. It is just barely tested. Use carefully!

[attachment deleted due to age]

1000101

I'm glad someone asked this, I was about to.

Grabbed your code BBream, credit where it's due.

I wonder, with all the mods doing similar things, if a community mod library might be in order.  To house common tasks such as various advanced recipes, adding outfits, unlocking benches with multiple technologies, etc.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

BBream