[1.3] [KV] Change Dresser [ModSync RW]

Started by Kiame, May 14, 2018, 01:52:16 AM

Previous topic - Next topic

Kiame

Large re-writing of the code behind the original Change Dresser - https://ludeon.com/forums/index.php?topic=35632.msg365747#msg365747
Please consult the original forum thread for more details on Change Dresser.

Important
For anyone using the patch "Change Dresser Mending Patch" you can remove that mod. Change Dresser now includes it by default and will enable it only when Mending is in the mod list.

This is a new thread because it is NOT save game compatible with the previous version (also to not get confused while I support the older version).

I am planning for this version to be the version going into RW's release.

This mod can be added to new games or currently running games that do not use the previous version of Change Dresser.


Major Changes:
1. Added the ability to create Custom Outfits which can be assigned to a specific pawn (see screen shots)
Example:
Pawn 'Yuuka' has an awesome cowboy hat that she wants to wear with power armor. She doesn't care about which power armor, just that she wants to wear the cowboy hat in battle.

Yuuka can create a Custom Outfit with the legendary cowboy hat included and the 'Solder' outfit as the base. When she is drafted she will put on the cowboy hat first then all other apparel like normally (from the previous Change Dresser)
-Note: It is not required to have a base outfit selected. Leaving it as (None) will make it so only the selected apparel will be used.

2. Assigned Outfits will work the same way as they did previously (the underlying logic has been re-written)

3. The Mending Attachements will now first repair apparel that is used for Custom Outfits before moving onto other apparel. I've also decided it was much cleaner if the attachments no longer 'removed' apparel and hogged them while repairing, instead they are mended even if they get worn.

Important
The mod uses the 'force wear' mechanic to manage Custom Outfit apparel. If using Custom Outfits never Clear Forced for those pawns.

I have done testing on my side but with so many avenues in the code I very well might have missed something. Please understand that if you use this mod you may lose apparel. If you do please do your best to explain what happened when you lost the apparel so I can figure out what happened.

Beyond that please submit any and all feedback about these changes.

Thank you!

Steam

Direct Download:
1.3

B18
B19
1.0
1.2

Use ModSync RW to know if/when there's an update

GitHub (do not download from this link for use in game)

Mending Mod: https://ludeon.com/forums/index.php?topic=22894.0

Thank you translators!
Vaniat - Chinese Simplified and Traditional
Proxyer - Japanese
Ɲơɴɑɱɛ - German
Gidreess - Russian
Boundir - French
Xion - Spanish

Like my mods? Consider supporting me!










Chaos17

Thank you for your had work. Downloading it now  ;D

Kiame

Fixed an issue where Custom Apparel assigned to a pawn was lost when the pawn died.
Now when a pawn with Custom Apparel is killed, any assigned Custom Apparel that's not being worn will be returned to the best Change Dresser (based off filters and priority). If no applicable Change Dresser is found, the apparel will be dropped around the dead pawn.

Kiame

Custom pawn apparel colors should persist now. I broke it in the update  :-[

Kiame

Update:
Fixed an issue where deleting an Outfit would not remove it from the pawn buttons.

Kiame

Update:
Fixed an issue where 'alien' pawns could not be selected from the Custom Outfits window

Kiame

Update:
Added a new window in Change Dresser and Change Mirror: Color By Layer

This works alongside Color Apparel but instead of coloring apparel by piece, it's by layer.
If this extra menu is not desired it can be toggled off in the mod's options.

As part of this change some apparel may change color unexpectedly. For instance coloring a shirt will also color the pants because they are both on the same layer (on skin)

Kiame

Update:
Fixing an issue where pawns would not dress into a new outfit. Not sure what was causing the issue but looks like it was also happening in the previous version...

Kiame

Update:
Body Type dialog will be correctly hidden if the option is set.

Kiame

#9
Update:
Added a Mod Setting to persist the color of apparel. Defaulted to off

When enabled, an apparel's color will be saved off when worn by a pawn that dyes the apparel a different color. When the pawn removes the apparel, the apparel will be dyed to its original color.


Added ModSync RW support.

Harry_Dicks


Kiame

Update:
Fixed an issue where alien-race body colors could not be changed

Important
For anyone using the patch "Change Dresser Mending Patch" you can remove that mod. Change Dresser now includes it by default and will enable it only when Mending is in the mod list.

q_mi

Hey Kiame,

I'm not sure whether it is related? My game freezes every few minutes and throwing thousand of warnings below after I install Change Dresser. I love your mod. Keep up the good work


CanReserve original result: True
Verse.Log:Warning(String)
ChangeDresser.Patch_ReservationManager_CanReserve:Postfix(Boolean&, ReservationManager, Pawn, LocalTargetInfo, Int32, Int32, ReservationLayerDef, Boolean)
Verse.AI.ReservationManager:CanReserve_Patch4(Object, Pawn, LocalTargetInfo, Int32, Int32, ReservationLayerDef, Boolean)
Verse.AI.ReservationUtility:CanReserve(Pawn, LocalTargetInfo, Int32, Int32, ReservationLayerDef, Boolean)
WM.SmarterFoodSelection.FoodUtils:IsValidFoodSourceForPawn(Thing, Pawn, Pawn, Policy, Boolean)
WM.SmarterFoodSelection.<>c__DisplayClass0_0:<MakeRatedFoodListForPawn>b__0(Thing)
System.Linq.<CreateWhereIterator>c__Iterator1D`1:MoveNext()
System.Collections.Generic.List`1:AddEnumerable(IEnumerable`1)
System.Collections.Generic.List`1:.ctor(IEnumerable`1)
System.Linq.Enumerable:ToList(IEnumerable`1)
WM.SmarterFoodSelection.FoodUtils:MakeRatedFoodListForPawn(Map, Pawn, Pawn, Policy, List`1&, Boolean, Boolean)
WM.SmarterFoodSelection.Detours.FoodUtility.TryFindBestFoodSourceFor:Internal(Pawn, Pawn, Boolean, Thing&, ThingDef&, Boolean, Boolean, Boolean, Boolean, Policy)
WM.SmarterFoodSelection.Detours.WorkGiver_InteractAnimal.WorkGiver_InteractAnimal:TakeFoodForAnimalInteractJob(Pawn, Pawn)
WM.SmarterFoodSelection.Detours.TakeFoodForAnimalInteractJob:Postfix(WorkGiver_InteractAnimal, Job&, Pawn, Pawn)
RimWorld.WorkGiver_InteractAnimal:TakeFoodForAnimalInteractJob_Patch3(Object, Pawn, Pawn)
RimWorld.WorkGiver_Tame:JobOnThing(Pawn, Thing, Boolean)
RimWorld.WorkGiver_Scanner:HasJobOnThing(Pawn, Thing, Boolean)
RimWorld.<TryIssueJobPackage>c__AnonStorey1:<>m__0(Thing)
Verse.<ClosestThingReachable>c__AnonStorey0:<>m__0(Thing)
Verse.GenClosest:ClosestThing_Global(IntVec3, IEnumerable, Single, Predicate`1, Func`2)
Verse.GenClosest:ClosestThingReachable(IntVec3, Map, ThingRequest, PathEndMode, TraverseParms, Single, Predicate`1, IEnumerable`1, Int32, Int32, Boolean, RegionType, Boolean)
RimWorld.JobGiver_Work:TryIssueJobPackage_Patch1(Object, Pawn, JobIssueParams)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob_Patch1(Object, ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
Verse.AI.Pawn_JobTracker:EndCurrentJob_Patch1(Object, JobCondition, Boolean)
RimWorld.<StartFeedAnimal>c__AnonStorey3:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

Kiame

#13
hmm have not seen this one before. I'll take a look. I have smarter food selection as well so I'm not sure what the problem might be off the top of my head.

Just to verify this is a new save and not a save which was using the old change dresser?

mrsebseb

Got the same-ish warning, on a new save, causing the game to stutter to a degree I find unplayable. I don't use Smarter Food Selection though but way too many other mods.
I apparently forgot to save the log with the warning. but figured I'd give you a heads up anyway. I'll add the warning I get when I can.