[B18] [KV] Mending ChangeDresser Patch [ModSync]

Started by Kiame, November 13, 2017, 10:13:54 PM

Previous topic - Next topic

Kiame

A patch for Mending which allows pawns to remove apparel from ChangeDressers.


Mod load order:
Mending must be before this patch-mod


Steam: B18

Direct Download:
A17
B18


Github


Like my mods? Consider supporting me!






Nightinggale

#1
Nice work. Allowing those two mods to work together is something, which I have been wishing for  :D

Quote from: Kiame on November 13, 2017, 10:13:54 PMOnly supports Change Dresser - BETA (A17+)
the older version of ChangeDresser is not supported.

Mod load order:
Mending must be before this patch-mod
This is precisely what I wrote ModCheck for (well that and actual conditional patch operations depending on presence of other mods). The following should display an error if the mods aren't set up correctly, which not only makes it easier for users to get it right, it should also prevent people from posting about problems due to not having the right order.
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="ModCheck.isModLoaded">
<modName>Change Dresser - BETA</modName>
<yourMod>Mending Change Dresser Patch - A17</yourMod>
<errorOnFail>true</errorOnFail>
</li>
<li Class="ModCheck.isModLoaded">
<modName>Mending</modName>
<yourMod>Mending Change Dresser Patch - A17</yourMod>
<errorOnFail>true</errorOnFail>
</li>
<li Class="ModCheck.loadOrder">
<modName>Mending</modName>
<yourMod>Mending Change Dresser Patch - A17</yourMod>
<errorOnFail>true</errorOnFail>
</li>
</operations>
</Operation>


While ModCheck supports adding patchmods into the main mod itself, I only considered xml patches. In this case it's a DLL, which injects into another DLL. This takes place before PatchOperations are even called meaning there is nothing I can do to make it optional short of a complete redesign and rewrite.
ModCheck - boost your patch loading times and include patchmods in your main mod.

Canute

Kiame,
since i just saw the mending patch, what do you think about a hightech changedresser.
These changedresser need power and can slowly (1-10% each day) repair stuff inside.
Orcouse you need Mending mod and research, and some extra automatic mending research.

Kiame

#3
Ha! i'm sad i didn't think of that!

Let me brainstorm some.


Nightinggale
Thanks i'll take a look at that

Kiame

#4
Quote from: Canute on November 14, 2017, 03:20:59 AM
Kiame,
since i just saw the mending patch, what do you think about a hightech changedresser.
These changedresser need power and can slowly (1-10% each day) repair stuff inside.
Orcouse you need Mending mod and research, and some extra automatic mending research.

A18 version of change dresser now has a mending attachment which can be built which'll do just this. The mending rate may be a little high but the energy cost I hope balances it out. Feedback will be helpful!

https://ludeon.com/forums/index.php?topic=35632.0
QuoteMending Attachment
-Size: 1x1
-Cost 250 steal + 6 components + 20 wood/stone/steel
-Energy: 10 W (not in use) or 300 W (in use)
-Place next to (touching) a Change Dresser to have apparel automatically mended/repaired
-Research Required: Mending & Multi-Analyzer
-Mending Mod not required (highly recommended though once it's updated to A18)
...
Mending Attachment
Will detect if apparel needs to be mended. Can only mend one apparel at a time. To make the process faster, multiple Mending Attachments can be built around a single dresser but only one apparel will be repair still (it'll be faster though!)
A single Mending Attachment can also be attached to more than one dresser as long as they're touching.

Canute

Nice work, now A18 just need to be released ! :-)

QuoteA single Mending Attachment can also be attached to more than one dresser as long as they're touching.
With touching  the dresser, you either end up with cross setup with the mending in the middle, or behind each dresser an attachment.

It is maybe possible to made these attachments like toolbox for workbenches, so they auto. link to dresser in the surrounding, and max. 2 attachment can link to 1 dresser. Same like the toolbox.


Kiame

Quote from: Canute on November 15, 2017, 03:54:31 AM
Nice work, now A18 just need to be released ! :-)

QuoteA single Mending Attachment can also be attached to more than one dresser as long as they're touching.
With touching  the dresser, you either end up with cross setup with the mending in the middle, or behind each dresser an attachment.

It is maybe possible to made these attachments like toolbox for workbenches, so they auto. link to dresser in the surrounding, and max. 2 attachment can link to 1 dresser. Same like the toolbox.

It wouldn't be difficult. I just liked the concept that the mending attachment would 'physically' pull the apparel out of the touching dressers. Also if the desire is to only fix apparel in one dresser it would be easier to manage by touching. I will consider this though.

Canute

Yep, only 1 apparel in 1 dresser should be mended.
I just wanted a bit more placing variation, beside cross setup, or placing the attachment behind the dresser.

Another thing.
Normaly you need mending kits to mend stuff. And i think that still  cheap but balanced at this way.
But when you attachment just need power, i would place a few of them just to mend stuff primary.
So maybe you need to fuel up these with mending kits too.

Kiame

I was considering that but it runs into issues like requiring Mending mod be installed (which some may not want). My hope is that the power requirement will be a large enough tradeoff - 300 is sizable (assuming no mods that add larger power sources) but I could see about increasing it to 500 or even 1000 W (1,000 i htink is too high though).

Nightinggale

Quote from: Canute on November 15, 2017, 12:29:26 PM
Yep, only 1 apparel in 1 dresser should be mended.
I assume that's one at a time, meaning once the item has 100% health, it moves on to the next one and over time everything will be 100%.

Quote from: Canute on November 15, 2017, 12:29:26 PMNormaly you need mending kits to mend stuff. And i think that still  cheap but balanced at this way.
But when you attachment just need power, i would place a few of them just to mend stuff primary.
So maybe you need to fuel up these with mending kits too.
Remember that there are two mending mods and only one of them use mending kits.

Quote from: Kiame on November 15, 2017, 12:49:28 PM
I was considering that but it runs into issues like requiring Mending mod be installed (which some may not want). My hope is that the power requirement will be a large enough tradeoff - 300 is sizable (assuming no mods that add larger power sources) but I could see about increasing it to 500 or even 1000 W (1,000 i htink is too high though).
This mod patches the mending DLL, meaning the auto repair building would fit best inside this one rather than the dresser mod. If you need to make something conditional based on the presence of mending kit thingdef, then that should be doable too, either with vanilla PatchOperationFindMod (A18 only) or ModCheck for xml and if it needs to be a check in C#, then I should be able to make the code for that as well without too much hassle.
ModCheck - boost your patch loading times and include patchmods in your main mod.

Canute

A few mods got ingame checks if some item/recipe exist or not.
Fertile field/Vegetable garden at example.
Why you don't do the same.
Add your own mending kit, and do a check if another mending kit exist, then disable your recipe/item.
And add both mending kits to the fuel list for the attachment.

And power is relativ, 1000 is just one fueled generator.
And at my last colony with Ramtomics mod, i got 30k power surplus (ok you need these power for the weapons for these mod).
But i would definitv build a fueled generator to have an attachment mend my stuff, special when a pawn don't need to do it.

Kiame

#11
Just to be clear the conversation around mending is for the a18 update of change dresser, not this mod  :)

It is possible to add diffs conditionally though my current hope is to avoid the overhead as i would like the tradeoff to be the extra power needed - extra power costs more resources than making stacks of mending kits

Fair point canute. And since the mending attachment is later in the game 1k power is not as outrageous. Ive been playing tribal starts lately and i spend so much time w/ lower power 300 seems like a lot   :P

Nightinggale

Quote from: Kiame on November 15, 2017, 01:07:32 PMIt is possible to add diffs conditionally though my current hope is to avoid the overhead as i would like the tradeoff to be the extra power needed - extra power costs more resources than making stacks of mending kits
I'm with you on this one. Since it's something, which happens frequently in the background (every X ticks presumably), it shouldn't require too much CPU power. If all it does is searching through the list to identify something, which needs mending and then work a bit as well as switch between high and low power usage, the CPU load will be less than if it starts to search for items in stockpiles, adds a job to make colonists feed it with items or anything of that sort.

Quote from: Kiame on November 15, 2017, 01:07:32 PMFair point canute. And since the mending attachment is later in the game 1k power is not as outrageous. Ive been playing tribal starts lately and i spend so much time w/ lower power 300 seems like a lot   :P
You can mix this with other mods, which allows you to turn power on and off based on battery levels, time, outdoor light level etc and none of this is highly advanced relative to mending. As a result, it will be possible to mend say 4 hours each day or only when solar panels are active or whatever you can supply the power for if you use this feature in early/mid game. With this in mind, I too would go for something like 1000 power usage when active and then see how well it works ingame.
ModCheck - boost your patch loading times and include patchmods in your main mod.

Kiame


ShadowXIII

#14
Today I got following error while right clicking onto the mending bench with a selected colonist.

Method not found: 'ChangeDresser.WorldComp.get_DressersToUse'.
at (wrapper dynamic-method) Mending.WorkGiver_DoBill.TryFindBestBillIngredients_Patch1 (RimWorld.Bill,Verse.Pawn,Verse.Thing,bool,Verse.Thing&) <0x001df>
at Mending.WorkGiver_DoBill.StartOrResumeBillJob (Verse.Pawn,RimWorld.IBillGiver) <0x0015b>
at Mending.WorkGiver_DoBill.JobOnThing (Verse.Pawn,Verse.Thing,bool) <0x0023f>
at RimWorld.WorkGiver_Scanner.HasJobOnThing (Verse.Pawn,Verse.Thing,bool) <0x0001e>
at RimWorld.FloatMenuMakerMap.AddUndraftedOrders (UnityEngine.Vector3,Verse.Pawn,System.Collections.Generic.List`1<Verse.FloatMenuOption>) <0x00605>
at (wrapper dynamic-method) RimWorld.FloatMenuMakerMap.ChoicesAtFor_Patch2 (UnityEngine.Vector3,Verse.Pawn) <0x00242>
at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn) <0x00125>
at RimWorld.Selector.HandleMapClicks () <0x00179>
at RimWorld.Selector.SelectorOnGUI () <0x00014>
at RimWorld.MapInterface.HandleLowPriorityInput () <0x00033>
at RimWorld.UIRoot_Play.UIRootOnGUI () <0x001ad>
at Verse.Root.OnGUI () <0x000c6>



When I have build a mending bench, some jobs won't be done by the colonists. For example my crafter won't cut stones anymore. After deconstruct the bench, the jobs will be executed again.