Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - FuriouslyEloquent

#1
Ideas / Re: Your Cheapest Ideas
July 13, 2018, 08:20:04 AM
I just wrote an extension of CompPowerBattery for purposes of extending battery functionality, however I discovered a limitation in ThingDef.ConnectToPower. That Property checks that any Comp of that ThingDef is a CompPowerBattery; I propose allowing a sub-class of CompPowerBattery as well.

For my purposes, I've replaced that property getter with a harmony patch.
static bool ConnectToPower_getter
{
if(this.EverTransmitsPower) {
return false;
}
for(int i = 0; i < this.comps.Count; i++) {
if(typeof(CompPowerBattery).IsAssignableFrom(this.comps[i].compClass)) {
return true;
}
if(typeof(CompPowerTrader).IsAssignableFrom(this.comps[i].compClass)) {
return true;
}
}

return false;
}
#2
Quote from: temple_wing on June 13, 2018, 01:26:39 AM
Exception thrown out when trade ship coming:

System.IndexOutOfRangeException: Array index is out of range.
at (wrapper managed-to-managed) object.ElementAddr_3_4 (object,int,int,int) <0x000a2>
at RimWorld.SlotGroupManager.SlotGroupAt (Verse.IntVec3) <0x00023>
at RimWorld.StoreUtility.GetSlotGroup (Verse.IntVec3,Verse.Map) <0x0003c>
at AdvancedStocking.ThingUtility_TryAbsorbStackNumToTake.TransformStacklimitIfOnShelf (int,Verse.Thing) <0x00062>
at (wrapper dynamic-method) Verse.ThingUtility.TryAbsorbStackNumToTake_Patch0 (Verse.Thing,Verse.Thing,bool) <0x00030>
at Verse.ThingWithComps.TryAbsorbStack (Verse.Thing,bool) <0x0003b>
at (wrapper dynamic-method) Verse.ThingOwner`1<Verse.Thing>.TryAdd_Patch1 (object,Verse.Thing,bool) <0x00303>
at Verse.ThingOwner.TryAddOrTransfer (Verse.Thing,bool) <0x0005b>
at Verse.ThingOwner.TryAddRangeOrTransfer (System.Collections.Generic.IEnumerable`1<Verse.Thing>,bool,bool) <0x00165>
at RimWorld.TradeShip.GenerateThings () <0x00121>
at RimWorld.IncidentWorker_OrbitalTraderArrival.TryExecuteWorker (RimWorld.IncidentParms) <0x00264>
at RimWorld.IncidentWorker.TryExecute (RimWorld.IncidentParms) <0x0001b>
at RimWorld.Storyteller.TryFire (RimWorld.FiringIncident) <0x00062>
at RimWorld.Storyteller.StorytellerTick () <0x0009a>
at Verse.TickManager.DoSingleTick () <0x003c2>

Verse.Log:Error(String)
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


---------------------------------------------------------------------------------------
Got this exception 274 times within 1 second.

AdvancedStocking.GetStackLimit Could not find Emu leather custom stacklimit. Returning 1
Verse.Log:Warning(String)
AdvancedStocking.Building_Shelf:GetStackLimit(ThingDef)
AdvancedStocking.Building_Shelf:GetStackLimit(Thing)
AdvancedStocking.ThingUtility_TryAbsorbStackNumToTake:TransformStacklimitIfOnShelf(Int32, Thing)
Verse.ThingUtility:TryAbsorbStackNumToTake_Patch0(Thing, Thing, Boolean)
Verse.ThingWithComps:TryAbsorbStack(Thing, Boolean)
Verse.ThingOwner`1:TryAdd_Patch1(Object, Thing, Boolean)
Verse.ThingOwner`1:TryAdd(Thing, Int32, Boolean)
Verse.Pawn_CarryTracker:TryStartCarry(Thing, Int32, Boolean)
Verse.AI.<StartCarryThing>c__AnonStorey0:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:StartPath_Patch1(Object, LocalTargetInfo, PathEndMode)
Verse.AI.<GotoThing>c__AnonStorey0:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:JumpToToil(Toil)
Verse.AI.<CheckForGetOpportunityDuplicate>c__AnonStorey2:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:StartPath_Patch1(Object, LocalTargetInfo, PathEndMode)
Verse.AI.<GotoThing>c__AnonStorey0:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.Pawn_JobTracker:StartJob_Patch1(Object, Job, JobCondition, ThinkNode, Boolean, Boolean, ThinkTreeDef, Nullable`1, Boolean)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
Verse.AI.Pawn_JobTracker:EndCurrentJob_Patch1(Object, JobCondition, Boolean)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

Happens when a pawn trying to put some emu leather into a shelf.

First issue should definitely be fixed, I noticed that orbital traders were organizing their stock on the map but outside the map bounds. The second should be as well, but I will need to confirm.
#3
Quote from: makute on June 11, 2018, 07:23:39 AM
Hi FuriouslyEfficienty, my fridges dissapear after being constructed, just like explained here: https://ludeon.com/forums/index.php?topic=32980.msg407256#msg407256

Your RimFridge! loads after Advanced Stocking and I got Blueprints disabled, like you advised to Box20, but they keep dissapearing.

This is the error log: https://drive.google.com/file/d/1VbyBLp4__NWg_x_BJt18eXX5_43PUZLI/view?usp=sharing

Edit: I tried with Kiame's RimFridge and it works flawlessly.

From your error log
QuoteLoading game from file Autosave-1 with mods Core, HugsLib, JecsTools-1.0.9.12, SaveGamePatches-1.1, WorkTab, StackMerger, Rimworld-Hand-and-Footware-master, ResearchTree, ReplaceWalls, RelationsTab, RBSE - Lite Edition 1.83, QOLTweaksPack, PrisonLabor, SmartMedicine - Release, Pharmacist, OHU-Dropships-1.57, No Mood Loss Prisoner Sold or Died, Miniaturisation-0.18.0, Mending, MedicalTab, Locks, KK_MovableSandbags, KK- Corrected WorkgiversB18, Zombieland, GiddyUpCore-18.7.8, GiddyUpRideAndRoll-18.1.11, GiddyUpCaravan-18.3.2, battlemounts-18.7.2, FollowMe, FluffyBreakdowns, FlagstoneCheaper3perA18, Doors-Expanded, CombatExtended, CombatExtendedGuns, SimpleSidearms-1.2.5, RunAndGun-0.18.3.4, ColonyManager, Clutter Furniture, Campfires-Can-Cremate-Corpses, Blueprints, AvoidFriendlyFire, AreaUnlocker, AnimalTab, Ancient Crashed Ships Drop Components, AllowTool, MiningCo. AlertSpeaker, MiningCo. SpotlightTurret, ImprovedAnesthetic, ParasiteTendsMatter, PlantCuttingIsForGrowers, ShipPartsRefactored, ShootingSkillEnhanced, SkillOverhead, TableDiner_Simple, VanillaFriendlyBatteryExpansion, ViableWeaponTrading, VisiblePants, RT_Fuse-B18-1.1.1, AdvancedStocking-0.5, Cooks Can Refuel, ExtendedInspectData-1.1.18.5, Grenade Fix Rearmed, Hand Me That Brick, Notifications Archiver, and rimworld-rimfridge-A18-shelf
I see BluePrints right after CampFires-Can-Cremate-Corpses. Per that forum link you posted, I would disable that mod and try again. Thanks
#4
Releases / Re: [B18] [KV] RimFridge [ModSync]
June 06, 2018, 04:54:18 PM
Quote from: Kiame on June 06, 2018, 09:55:25 AM
From my understanding FuriouslyEloquent is going to re-release the entire mod with the small change because there is no way to 'patch' inheritance at the class/code level
And this is most correct. I'm just performing a last few tests here.
#5
Releases / Re: [B18] [KV] RimFridge [ModSync]
June 05, 2018, 05:52:03 PM
Kiame, after some minor tweaks I've been able to get RimFridge (and subsequently ASAR) working with my Advanced Stocking mod. It was very simple, I just changing the superclass from Building_Storage -> AdvancedStocking.Building_Shelf and inserting my new Stock tab in to the Def's inspectorTab field.

Would you have an issue with me linking to a modified release of your RimFridge mod? Thanks.
#6
Quote from: temple_wing on June 04, 2018, 11:03:14 PM
Doesn't throw this exception on newly created game.
Is your SaveGamePatches mod a one-time-use mod? I loaded game multiple times with that mod activated. Does that damaged my saved file?
Looks like thing.def.stackLimit is being less than 0, how can it be?
My save game patches should only apply upon loading a game that did not have that mod, it will log a short message when doing so. However, the changes it makes will be persistent if you save. I would follow Canute's advice, otherwise I intend to write an equivalent component to safely unload a mod from a save game; but that may be a few weeks coming. If you are familiar with modding and RimWorld XML Def patching, it simply extends that method to the save game file itself upon load.

As to the stackLimit question, my mod changes how the game accesses the stackLimit in certain places, and it most certainly was returning 0 occasionally due to a bug. I've just tested butchering on a pre existing game and it now works correctly. Thanks for the heads up.

As a note you should be able to remove my mod and besides some red logs, you'll lose your shelves. Once again, I should have a solution for this at some point in the future.
#7
I've added custom stack limits per shelf to my advanced stocking mod. Let me know how that works for you.
#8
Quote from: Canute on May 30, 2018, 04:00:25 PM
And i notice the max. stock weight only depend on the quality.
Maybe the material should affect the max. stock weight too.
If you don't want ad an extra resource modifierer just use the "Work to build" one.
Since steel is 100%, wood is with 70% lower and plasteel is 220% it would reflect the material in a good way.
Added a stuff based factor to my Stat, as well as a floor based component. The floor component works even if the shelf is not on only 1 floor type ...
<li Class="AdvancedStocking.StatPart_StuffDef_Fallover">
        <stuffCategoryFactors>
          <Metallic>2.0</Metallic>
          <Woody>0.75</Woody>
          <Stony>1.5</Stony>
        </stuffCategoryFactors>
      </li>
      <li Class="AdvancedStocking.StatPart_Floor">
        <wetFactor>0.5</wetFactor>
        <roughFactor>0.5</roughFactor>
        <metalFloorFactor>1.2</metalFloorFactor>
        <stoneFloorFactor>1.1</stoneFloorFactor>
        <fabricFloorFactor>0.8</fabricFloorFactor>
        <woodFloorFactor>0.8</woodFloorFactor>
      </li>
#9
Quote from: sumghai on May 31, 2018, 01:31:57 AM
Following your advice, I believe I managed to get the Stock tab to show up in for the third-party SmallShelf. However, it appears that the weapon stack sizes have defaulted to one per cell:
This goes back to what I had said previously, my mod does not actually change stack sizes. There are 2 special jobs; one that will take 2 stackable things and combine them past their stackLimit, the other will overlay a single item in a cell onto another cell with multiple items. In essence, I treat 1 cell of the shelf normally and 1 cell as a stockpile. With a single celled shelf there are not two stackable things to combine.

With my mod you can see pawns organizing the shelf as it is not instantaneous, with increasing time as shelf stock increases.
#10
Quote from: sumghai on May 30, 2018, 07:30:43 PM
Just had a play around with Advanced Stocking - neat mod! I've been looking for a way to more efficiently manage my colony's armories for some time, as I've never been happy with a single knife or pistol taking up a whole shelf space.

That being said, I'm trying to set up some shelves to act like weapon racks, but I haven't been able to get things working exactly the way I want to.

At the moment, I have a standard 1x2 shelf set to store steel knives and autopistols, and I assumed that Advanced Stocking would keep both weapon types in separate piles/squares on the same shelf. Instead, both the knives and autopistols are mixed in with each other.  I'm not fully familiar with all the settings in the Stock menu, so some pointers would be greatly appreciated.

Failing that, I've also downloaded the Single Shelf mod, and have been trying to edit the patches for Advanced Stocking to enable stock management for those shelves too (defName = SmallShelf), but the Stock tab doesn't seem to show up. Any ideas?
Thanks for the kind words. I too have yet to get things working as I want to, so its nice to be in good company ;).

The problem with a single celled shelf and my mod is that my mod works by having a normal cell that will be filled, and having custom organization jobs to either overstack or overlay items from 1 cell to another. Thus hauling operates normally, and I've created a secondary system (Stock) that does not directly interact.

The fundamental problem is conceptual, in that I am attempting to make a specific exception to a core RimWorld concept; all stackable items are limited by stack size. I am violating this but trying to do so as minimally as possible, hence why I am making the pawns perform distinct jobs when violating them. However, it seems several people want to have LESS items on the shelves than stack size, so I might be patching things a little deeper.

As to your patch issues, I think the issue is with the shelf_patch.xml. Instead of extending the existing sequence with the new DefName, you need to copy the original <Operation Class="PatchOperationSequence"> node and change the defName to SmallShelf. You should have 2 PatchSequences that each start by testing for the Defname and ThingClass.
#11
Quote from: Canute on May 30, 2018, 04:00:25 PM
Nice solution with the shelf's, a bit work intensive through the manual stocking but still nice work.
It works fine with stackable, weapon and appareal.
But it didn't work with chunk's or corpse.
And execp. wood shelf got a stock weight of 267 Kg, so it should carry 10 chunks. But i can't stack them up.
Same to corpse.

And i notice the max. stock weight only depend on the quality.
Maybe the material should affect the max. stock weight too.
If you don't want ad an extra resource modifierer just use the "Work to build" one.
Since steel is 100%, wood is with 70% lower and plasteel is 220% it would reflect the material in a good way.
To be candid, my limits for various things are a mess. Plus, it seems some folk actually want to REDUCE the maximum stack size on a shelf ... so I will probably be making some adjustments.

For the meantime, let me add Chunks and Corpses to a new overstack (25x overstack, no overlay) strategy. At least I put all of that into a Def. I'll probably end up placing a chart or such on the main posting.
    <AdvancedStocking.ShelfOrganizeModeDef>
        <defName>ChunksCorpseOverstack</defName>
        <label>ChunksCorposeOverstack</label>
        <order>5</order>
        <overlayLimit>1</overlayLimit>
        <overstackRatioLimit>25</overstackRatioLimit>
        <allowedThingCategories>
            <li>Chunks</li>
            <li>Corpses</li>
        </allowedThingCategories>
    </AdvancedStocking.ShelfOrganizeModeDef>


As to the stats, I did not see a StatPart for material and I thought the stat effects for a material in vanilla is located in the material's ThingDef. My plan is to actually have floor settings impact storage weight, so when I get to that I'll explore material effects.
#12
Ideas / Re: Your Cheapest Ideas
May 30, 2018, 02:03:26 PM
If you could please make the MainTabWindow_Inspect.PaneTopY property either virtual, or attribute the getter with [MethodImpl(MethodImplOptions.NoInlining)].

I was attempting to fix some bugs in Zone Inspect Data including some minor visual UI stuff, however I could not override the PaneTopY property with harmony as it was being inlined, which can only be fixed on your end. I would prefer making the method virtual, but either would suit the task. Thanks.
#13
Bugs / Code Error in StorageSettings.ExposeData()
May 30, 2018, 01:54:17 PM
Checked over Mantis, did not see this error. There is a subtle code error in the StorageSettings.ExposeData() method with the arguments to the ThingFilter's constructor.

In the StorageSettings() constructor, you see that the ThingFilter is created with a callback to TryNotifyChanged()
public StorageSettings()
{
this.filter = new ThingFilter(new Action(this.TryNotifyChanged));
}


But when the StorageSettings is serialized, it does not pass this callback to its ThingFilter.
public void ExposeData()
{
Scribe_Values.Look<StoragePriority>(ref this.priorityInt, "priority", StoragePriority.Unstored, false);
Scribe_Deep.Look<ThingFilter>(ref this.filter, "filter", new object[0]);
}


I discovered this error when I was attempted to wrap ThingFilter.settingsChangedCallback and I discovered that the original value was null once the StorageSettings had been re-loaded. I expect this is having certain very subtle effects, and it may be why it takes a few ticks after changing a zone's filter before it is fillable.
#14
Just for clarification, you would want a slider somewhere that adjusts the maximum stack size on a shelf? So for instance, for a normal shelf (not overstacking/overlaying or any of that garbage  :P) set to carry meals, there would be a slider with values for 1-StackLimit. If you selected 3, then no more than 6 meals (3 meals * 2 cells) could be stored. Is that correct?

This would be implementable but I did not initially consider it as my goal was to place more things on shelves and not less.

If I could provide a slider for each ThingDef allowed to be stored, would that work?
#15
After some thoughts, I decided to post my proof of concept extension of Incidents into Problems (hence the ITIL joke). I've add several additional components and am trying several new approaches to scenario creation. My primary inspiration for this is Crusader Kings 2 (yeah I'm sick, but we both play RimWorld so ...) and their event style, which I will be attempting to bolt onto RimWorld. Lets see ...

GitHub Link

Description
A hacker sets up camp outside your base, sending threats of extortion backed by hacking your turrets. This cycle continues until you pay, develop countermeasures, or eliminate the threat.

Dependencies

  • Harmony - Included

Features

  • Creation of an ProblemWorker that extends IncidentWorker, but provides access to a persistent copy with storage. Its a thin wrapper and interface in one ...
  • StorytellerComp_Problem and ProblemManager to manage problems
  • DynamicCommManager - Add new CommConsole options/Faction dialog options, as well as tie ins to the LetterManager
  • DynamicComponentManager - Add/remove stateful ThingComps onto Things
  • ResearchTaskManager - Be notified when research completes. Lock/unlock and reset research progress. Useful to create repeatable research based tasks
  • Some additional dialog work
  • Dynamic jobs related to this scenario

At this time I have not balanced anything at all, not message delays or anything else. Presently I launch this Incident entirely via developer menu. Be forewarned, this will continue until the hacker is destroyed, and it is possible that later cycles of hacking coincide with raids. Or during peaceful trader visits ...

As another note, you should be able to remove this mod if things get too hairy and you'll be left with a bunch of red logs but your game should continue.

Wishlist

  • Add mystery, and have players investigate to find identity of hacked ally base
  • Expand searching for the hacker. Maybe some event if players approach hidden site on world?
  • Creation of ambush on hacker with allied base
  • Additional taunts if hacker kills pawn/animals
  • Make hacker have an actual camp with tent from Camping mod if it is installed

Really this is just to see how far I can take things. I have a few more grounded ideas that I will probably move onto before this is complete.