[1.0] Mend And Recycle

Started by notfood, August 06, 2016, 09:02:41 PM

Previous topic - Next topic

shenniko

Hi,

would it be possible to change the research level on this? or make a lite/patch version of the mod?

I'm playing Lord of the Rims, and am unable to repair anything due to the research level being Industrial.

Dont get me wrong, i know i can go into the xml and change the research to remove electricity and change the level to Neolithic.. but next time the mod updates, im guessing that will be overwritten..

Thanks

Shenn

Canute

shenniko,
just do it yourself.
Edit the
/MendAndRecycle/Defs/ResearchProjectDefs/ResearchProjects.xml
remove
<prerequisites><li>Electricity</li></prerequisites>
And if this don't help, you can change
<techLevel>Industrial</techLevel>
into
<techLevel>Neolithic</techLevel>
.

vovik

sorry, in Injet() method after sortapparelbycomplexity after all operations with filters they were not applied as a result repair recipes.
this method, last four statements:

static void SortApparelsInComplexity() {
            // select and group ThingDefs by complexity
            var query = (
                from def in DefDatabase<ThingDef>.AllDefs
                where def.IsApparel ||  def.IsWeapon
                select new { def = def, isComplex = HasComponents(def), isApparel = def.IsApparel}
            );

            var mendComplexApparel = GetCleanFilter(ResourceBank.Recipe.MendComplexApparel);
            var mendSimpleApparel = GetCleanFilter(ResourceBank.Recipe.MendSimpleApparel);
            var mendComplexWeapon = GetCleanFilter(ResourceBank.Recipe.MendComplexWeapon);
            var mendSimpleWeapon = GetCleanFilter(ResourceBank.Recipe.MendSimpleWeapon);

            foreach (var item in query)
            {
                ThingFilter filter;
                if (item.isApparel) {
                    if (item.isComplex)
                    {
                        filter = mendComplexApparel;
                    }
                    else
                    {
                        filter = mendSimpleApparel;
                    }
                } else {
                    if (item.isComplex)
                    {
                        filter = mendComplexWeapon;
                    }
                    else
                    {
                        filter = mendSimpleWeapon;
                    }
                }

                filter.SetAllow(item.def, true);
            }

            ResourceBank.Recipe.MendComplexApparel.fixedIngredientFilter = mendComplexApparel;
            ResourceBank.Recipe.MendSimpleApparel.fixedIngredientFilter = mendSimpleApparel;
            ResourceBank.Recipe.MendComplexWeapon.fixedIngredientFilter = mendComplexWeapon;
            ResourceBank.Recipe.MendSimpleWeapon.fixedIngredientFilter = mendSimpleWeapon;
        }

Nun liebe Kinder gebt fein acht
Ich bin die Stimme aus dem Leere
Ich hab euch etwas mitgebracht
Ein heller Schein am Firmament
Mein Herz brennt

notfood

Oh Vovik, you don't need to do that. It's an object, it resides inside ResourceBank.Recipe.* already.

Try testing with ResourceBank.Recipe.MendComplexApparel.fixedIngredientFilter == mendComplexApparel, it will come as true.

vovik

#304
Yea, i dont need to do that - you dont need to do that.
Look, im not saying that you did errors, i see that i can fix it - i fix it. Assuming that i dont need to put that code there i use 1.0.1.1 version from your github.
Result is: all recipes using same recipe pool but still accepting their assigned items - yea, mod works, but interface does not cope with that, after applying patches its all aok.
Result:
https://imgur.com/a/u1uRbrx

So i fixed that.

Also, job driver for mending and for recycle dont save their state and toil does not execute InitAction() after save if pawn is already working on it - this results in bug where pawns stand doing nothing if they were saved and loaded while mending.
Following code saves state and fixes this behavior
JobDriver_Mend
public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.Look(ref workCycle, "workCycle", 1f);
            Scribe_Values.Look(ref workCycleProgress, "workCycleProgress", 1f);
            Scribe_Values.Look(ref costHitPointsPerCycle, "costHitPointsPerCycle", 1);
        }

and in JobDriver_Recycle
public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.Look(ref workCycle, "workCycle", 1f);
            Scribe_Values.Look(ref workCycleProgress, "workCycleProgress", 1f);
            Scribe_Values.Look(ref costHitPointsPerCycle, "costHitPointsPerCycle", 1);
            Scribe_Values.Look(ref processedHitPoints, "processedHitPoints", 1);
        }
Nun liebe Kinder gebt fein acht
Ich bin die Stimme aus dem Leere
Ich hab euch etwas mitgebracht
Ein heller Schein am Firmament
Mein Herz brennt

vovik

Here is super-lite version i am using now - fixed noticable bugs, no additional structures and items that sometimes pop out even if they are forbidded, source included
Nun liebe Kinder gebt fein acht
Ich bin die Stimme aus dem Leere
Ich hab euch etwas mitgebracht
Ein heller Schein am Firmament
Mein Herz brennt

notfood

#306
The missing ExposeData is a valid bug but you are being vague again about other bugs. I wish you would use git properly to submit a PR instead of distributing things I won't support.

Fixed in master.

Schwartz

Using a Change Dresser mod item set to accept only 100% durability, good-legendary, marine helmets, marine armor, shield belt,

Rimworld hangs with these settings in conjunction with the workbench set to mend items that will fit into the dresser. I can either remove the dresser or remove the mending bills. Since I don't know which mod is to blame, or if it's possibly a bad interaction, I'm posting this to both.

paragonid

> But i wondering too, and at my first use of the new release i spawned one mending kit with the devs tools ! :-)



PS: sry no spoilers on forum

LiteEmUp

any known hard incompatibilities?? also is this likely compatible with repair workbench mod?? i'm trying to decide if i should keep that one or get this mod


no replies on the steamworkshop, so maybe in here i would get better answers

Canute

Since both mods are doing basicly the same i wouldn't recommended to use them both together.
You should try it out self, play one colony with this mod, later anothe colony with the other.

Kiame

#311
Quote from: Schwartz on January 13, 2019, 11:34:44 PM
Using a Change Dresser mod item set to accept only 100% durability, good-legendary, marine helmets, marine armor, shield belt,

Rimworld hangs with these settings in conjunction with the workbench set to mend items that will fit into the dresser. I can either remove the dresser or remove the mending bills. Since I don't know which mod is to blame, or if it's possibly a bad interaction, I'm posting this to both.

I'll try to reproduce this tonight. IIRC I added a check in Change Dresser to not drop items that were 100% hp as pawns would keep reparing apparel that was not damaged.

One thing you could try is modify the mend's bills' details to make sure you're not trying to mend apparel the has 100% hp.

Ruisuki

#312
does the resource payout vary depending on the remaining health of the equipment when you recycle a piece of equipment? Will a 50% hp synthread t shirt give me less synthread than a new one?

vovik

Quote from: Ruisuki on September 17, 2019, 09:19:16 PM
does the resource payout vary depending on the remaining health of the equipment ...
does not, equipment looses durability imgame when recycling(for immersion) and resulting amount does not vary epending on remaining health since it is dynamic during recycling
Nun liebe Kinder gebt fein acht
Ich bin die Stimme aus dem Leere
Ich hab euch etwas mitgebracht
Ein heller Schein am Firmament
Mein Herz brennt

Ruisuki

Quote from: vovik on September 18, 2019, 01:30:29 PM
Quote from: Ruisuki on September 17, 2019, 09:19:16 PM
does the resource payout vary depending on the remaining health of the equipment ...
does not, equipment looses durability imgame when recycling(for immersion) and resulting amount does not vary epending on remaining health since it is dynamic during recycling
got it thanks. Any reason why I can't make mending kits? I created new bills meet the skill requirements have appropriate leather and steel unforbidden and set the bill radius to unlimited. It's set to colony production not suspended and not to a specific colonist. I can make other equipment and recycle but can't get the actual kits for some reason