[A12] Containers For Stuff (v1.1.1)

Started by Wivex, August 12, 2015, 02:45:22 PM

Previous topic - Next topic

Wivex

Description:

This mod adds automated container prototypes to the game, which behave as multislotted stockpiles and require no micromanagement to operate.



Features and Behaviour:

       
  • Container is fully automatic. Build it, set storage properties and your pawns will know what to do.
  • It is compatible with trade beacons. You can sell items from inside.
  • It is compatible with any other mod that checks global items lists.
  • If you need a specific item from container storage, you can get it via container's items UI tab.

Known Issues:

       
  • From my knowledge, it's impossible to remove or cover individual stored item's labels.
  • Stored items textures are piled beneath the storage texture. It might be possible to remove them, but it's not in my priority for now.
  • Currently, it doesn't show stored items in colony's stock list. (Can't change vanilla UI)
  • Items freezed in the Fridge still show their state as not refrigerated, although they are kept preserved.
  • Simaltenious destruction of multiple fully stacked containers may cause game to stagger for a while on low grade PCs. Lots of calculations for item's scattering required.

Information for Modders and Enthusiasts:

       
  • This mod is a prototype and provide basic behaviour for the containers as a new class of furniture. If you want to contribute to expand this concept, i'll be glad to cooperate.
  • This mod expands the vanilla hauling system. If your mod do the same it could be not compatibile.
  • Containers use CompContainer component which can be added to any building of Building_Storage class. It has xml configured itemsCap property. (Values between 2 and 15 are adviced)
  • Any kind of feedback is welcome.

Changelog:

Hotfix 1.1.1:
- Fixed a bug: pawns unable to haul corpses.

Version 1.1:
- Fixed a bug: stored items being created anew and loose their properties.
- Fixed a bug: reshuffling items between different stockpiles and containers when storage priorities are changed now working properly.

- Container functionality is now granted by CompContainer, which can be added to any building of Building_Storage class. It has xml configured itemsCap property. (Values between 2 and 15 are adviced)
- Made container's items UI tab automatically resizeble, depending on ItemsCap property.
- Added new container type - Fridge. Restricted to store food and keeps it from spoiling. Requires power to operate.
- Freezing functionality is granted by CompRefrigerated which can be added to any building of Building_Storage class, with CompPowerTrader attached to it too.
- Some xml changes and optimization.


Downloads:
Credits:

       
  • Thanks to mrofa for textures from Clutter mod.
  • Thanks to Community Core Library for the source base for CompRefrigerated.
  • Thanks to Latta for adding the Korean language support.
  • Thanks to modding community for tips and advice.

[attachment deleted due to age]

Adamiks

Nice! But do colonists know that there are more than 1 resource on 1 cell? I mean, do they will take for example wood from it and then steel or do i need to change which item is in "out slot"?

Wivex

They know, cause i don't use container's inventory as an object where things are. I just allow pawns to pile things up where container is placed. "Stored" things are still free to use for all the global item checks, trading beacons etc.

Adamiks

It almost make me to play Rimworld again! ;D

But no, i'm playing STALKER (shadow of chernobyl) now + i'm waiting for better sappers AI or at least animals herding (read = next alpha ;d). Strategy games like Rimworld are boring after some time if you know what you're doing. For example if i would be a noob i would have so much drama in the colony (colonists dying, sappers breaking walls, starvation etc), but because i know how to deal with sappers and normal raids, i know how to deal with ice... i forget how to write this ;d anyway after long playing i know most (if not all) of the tips and i'm pretty good in Rimworld so it's boring for me now... I've made like 3-4 modpacks with a lot of mods with patches created by me and i don't think it's worth it (too much time consuming for some playing)...

Wivex

It's good to be back each new alpha anyway.  ;)

DNK

#5
If this works as advertised, it's f-ing amazing and kudos to you good person. I've been waiting for a proper container code for a long time in this game.

It would be nice if you coded it such that there was an xml line in the ThingDefs file that let us choose how many storage slots a furniture item had. That's my only critique. It seems it's hard-set at 10 always now, right?

Ninefinger


Toggle

Selling broken colonist souls for two thousand gold. Accepting cash or credit.

Wivex

Quote from: DNK on August 12, 2015, 06:54:45 PM
It would be nice if you coded it such that there was an xml line in the ThingDefs file that let us choose how many storage slots a furniture item had. That's my only critique. It seems it's hard-set at 10 always now, right?

I had it planned since i've wanted to make a universal class for containers, so other mods can be based on it. Will implement in later versions

popster99


The13thRonin

This is amazing! I wish I knew how to code in C#... I'm so jealous :(.

I know this is asking a lot but is there any chance that you could make different versions of this... For example:

Pallets that accept construction goods...

Crates that accept foodstuffs...

Ideally it'd be cool if you could get the items to show up on the containers but to increase the number underneath so instead of seeing (75) you see (300) for example.

Wivex

Quote from: The13thRonin on August 13, 2015, 04:27:20 AM
I know this is asking a lot but is there any chance that you could make different versions of this... For example:
Pallets that accept construction goods...
Crates that accept foodstuffs...
I cannot make every container for any taste, i provide tool to do so.
You can do it yourself with xml editing of container's def:
Changing <AltitudeLayer>ItemImportant</AltitudeLayer> to <AltitudeLayer>Item</AltitudeLayer> will make container texture appearing underneath the stored items.

Adding the following inside <building>...</building> section:

      <fixedStorageSettings>
        <filter>
          <categories>
            <li>FoodRaw</li>
          </categories>
        </filter>
      </fixedStorageSettings>

will make storage accept only raw food categories and so on.

Quote from: The13thRonin on August 13, 2015, 04:27:20 AM
Ideally it'd be cool if you could get the items to show up on the containers but to increase the number underneath so instead of seeing (75) you see (300) for example.
I can't do anything with existing item labels so far. Changing the item's stacks in the container inventory list (1 stack of 300 instead of 4 stacks of 75) will only lead to confusion, because it provides no visual information about really occupied slots. It is possible to do specified containers, like safes, to store silver in stacks over 9000, but i see no real necessity of doing so.

skullywag

Ill be looking at this for my storage mod. I had implemented MD2s DSU code to my storage mod before but this is what I really wanted to do, ill give it a go soon and feedback to you Wivex, ill grab you on slack if i hit any hurdles. :)
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Dragoon

If build the containers near a trade beacon can we sell the items inside?
Quote from: faltonico
I truly can't understand that sense of balancing a LOT of modders have, pouring more resources on something doesn't make it more difficult, but more annoying. It is not engaging, even if i'm swimming in silver at late game ¿why to bother?, why all the effort to get there?.

Wivex

Quote from: Dragoon on August 13, 2015, 09:00:13 AM
If build the containers near a trade beacon can we sell the items inside?

Yes