Topic: New furniture item: "Chest" for storing things  (Read 12781 times)


Dungeon Smash

« on: April 26, 2019, 02:04:14 AM »
Sometimes the cabin tends to get a bit cluttered, especially in long games.  It's perfectly possible to stash large piles on a single tile, but it looks messy to simply dump everything on the floor.

It would be nice to be able to build a furniture item called "Chest".  I would imagine it would function similar to a cellar, but without the added benefit of keeping food fresh.

It would particularly be nice for clothing items, since those seem to tend to pile up the most.

Faatal

« Reply #1 on: April 26, 2019, 07:02:41 PM »
The BAC mod has this built in.

Brygun

« Reply #2 on: June 16, 2019, 02:38:13 AM »
The BAC mod has this built in.

It does???

*Brygun keeper of the BAC wanders off to check the mod*

hmm... probably Carpentry...

Yep...

Wooden Treasure Chest.

Well... sort of.

It will create a nice graphic of a chest. As to whether it will display on top or under the piles of stuff isn't something I can code. Possibly picking up and dropping it will change the display sequence.

There is also an outdoor table with a pretty big graphic to clean things up.

A hard coded storage location would, AFAIK, have to be coded by Saami or Erkka. That is the only way (AFAIK) to have the cellar like graphic affect of deactivating the display of all the pile of stuff. The chest, table or other item function as big things hopefully covering the pile.

The BAC furniture items could well display as if the chest was bursting with clothes. Which might fit your immersion too.

« Last Edit: June 16, 2019, 02:41:41 AM by Brygun »

Dungeon Smash

« Reply #3 on: June 17, 2019, 01:52:25 AM »
Yes, I was a little surprised to learn this was already in the mod too. I built one in the game, and you can indeed make it display on top of the other items by dropping it on top (I roleplay this as "closing the lid".) It does appear that larger items like cloaks are poking out the sides, but my chest at home isn't that different...
I agree that it would need special coding, and probably belongs more in the suggestions area.

Night

« Reply #4 on: February 01, 2020, 10:34:11 AM »
Currently attempting to create this with more realistic functionality, had a question for anyone interested in using this mod when I complete it, as I'm pondering ways to "open" the chest, just in terms of user-friendly operating. One idea I had was to have a craftable item called "Open Container", this would activate my mod when crafted into the inventory, opening up the container's UI.

I could also, implement it as a hotkey (will probably do this by default) but, I'm wondering what other peoples opinions are. If I use crafting as the opening action, it would allow you to modify the time it takes to open containers, possibly more.

Oh also, this should allow anyone else who wants to make "container mods" to do so, as ill be implementing some custom options for changing container UI and settings.

Edit: after many hours I have made significant progress, but haven't completed it yet. May be awhile before I release as I'm leaving sunday, we'll see though. I was hoping to take my projects with me.
« Last Edit: February 01, 2020, 08:25:11 PM by Night »
URW Character Menu - Cheating menu by a player, for the players.
URW Character Designer - Design your characters sprite!

Privateer

« Reply #5 on: February 01, 2020, 08:39:39 PM »
One main issue in dealing with containers is urw treats all contents as fluid, any defining separation of items lost.

 Closest I ever got in-game was arrow quivers.
To help is it's own reward.
Mods:
https://www.unrealworld.fi/forums/index.php?action=profile;area=showposts;sa=attach;u=10 Player Quests, Arrow quiver, Bee hives honey & mead, Massive menus, Fish Farmer, Combat trainer, Player made markers, Weaving, Wood stacks, Chicken coop Fish cuts, string&bone.

Night

« Reply #6 on: February 01, 2020, 09:16:21 PM »
One main issue in dealing with containers is urw treats all contents as fluid, any defining separation of items lost.

 Closest I ever got in-game was arrow quivers.

I am inter-oping with C# and memory editing to store the data outside of the game. I'm using some mod files to control the UI and container creation, still pondering what would be required to safely delete a container once I've created it though, maybe require that its emptied first, otherwise item loss can occur. Here is my current progress with the official modding syntax:

Code: [Select]
[SUBMENU_START:ContainerTest]

.New Container. "Hunting horn" *CARPENTRY* /1/ [EFFORT:1] [PHYS:hands] [noquality]
{Knife} <Small knife> [noquality]
[NAME:(C)Chest]
[WEIGHT:5000]
[TYPE:container]

.New Worn Container. "Hunting horn" *CARPENTRY* /1/ [EFFORT:1] [PHYS:hands] [noquality]
{Knife} <Small knife> [noquality]
[NAME:(W)Pouch]
[WEIGHT:28g]
[TYPE:container]

.Open Container. "Hunting horn" (1) /.1/ [PHYS:hands] [no quality]
{Container} [ground] +'Nearby Containers'
[NAME:Open]
[WEIGHT:0]

.Place Container. "Hunting horn" (1) /.1/ \1h\ [PHYS:hands] [no quality]
{(C)*} (1) +'Container to be placed' [remove]
[NAME:Place]
[WEIGHT:0]

.Wear Container. "Hunting horn" (1) /.1/ [PHYS:hands] [no quality]  ///// Not Currently Complete
{(W)*} (1) +'Container to be worn' [remove]
[NAME:Wear]
[WEIGHT:0]

.Takeoff Container. "Hunting horn" (1) /.1/ [PHYS:hands] [no quality] //// Not Currently Complete
{(W)*} (1) +'Container to be worn' [remove]
[NAME:Takeoff]
[WEIGHT:0]


[SUBMENU_END:ContainerTest]

When creating a new container to be used by the engine, the player will use the crafting system to activate when the container created is to be modified and tracked for the engines use... So this would look something like....

Step 1. Craft Container
 
Step 2. Place/Wear Container using crafting mod

Step 3. C# Mod reads "Place" or "Wear" item created from crafting mod, then modifies this items details to match the designated container. In addition, certain memory that is not used by containers normally will be used to insert an ID that the engine will use to identify that specific container.

Step 4. C# Mod stores the containers real ID and new ID into dictionaries along with information on what item ID's are stored in the container and their quantities. From this, additional properties may be applied in updated versions by taking the ID's and reading the game's item struct for their data, then calculating things such as, how much weight the current container has. This will also be an essential component for interacting w/ and displaying information on the C# UI.

Step 5. C# Mod saves containers data to a readable file, under the current characters file directory. Containers will be saved in a "Containers" folder. The files in the containers folder will relate to each individual container by the unique ID and XY overworld and localworld co-ordinates for location tracking down to the tile. The file name will look like this: "(ID)[x, y|x, y] ItemName.cont". Contained within this file will be data related to the real item ID's for the stored items and their quantities.

Step 6. C# Mod handles loading of containers and condition handling to stop potential bugs from occurring by user error.

Step 7. When "Place" or "Wear" is overwritten in the game's data, and when a new "Place" or "Wear" item is created, it will create a new entry in the players known item struct, allowing new containers to overwrite and repeat.

Step 8. .... many more possible steps I'm missing, but this is the general concept I am shooting for.

This should also allow people to create their own containers that the engine can use, I'm not sure what effects different properties of the crafting system will have. I do know you can insert variables for the crafting system to use via Carb Water Fat and Protein, despite the item not being marked as something that can use these, the data will still be written to where these would be used, and therefor can be used by the engine as user-based input.

Currently, creating your own container looks like this:
.New Container. "Hunting horn"   *CARPENTRY*   /1/   [EFFORT:1]   [PHYS:hands] [noquality]
{Knife}   <Small knife> [noquality]
[NAME:(C)Chest]
[WEIGHT:5000]
[TYPE:container]

I'm sure some things could be removed/modified here that aren't needed, but the important thing is the name starts with the engines syntax for identifying containers, (C) represents a container that is placed on the ground, (W) represents a container that can be worn. When the engine identifies a new container has been created via "Place" or "Wear" crafting, it will take the identified container (via looping through the players inventory and detecting which object has decreased in quantity) and copy its data over to the newly created "Place" or "Wear" item, and then mark it for the engine. It will also, remove the (C) or (W) from the containers name, as it is now an active container used by the engine.

I have some additional ideas down the road, but this is as far as I have gotten in concept and code.

If you are interested in the C# source, here is a pastebin link:
https://pastebin.com/gNL03pSi

It will expire in 24 hours, complete source may or may not be released when finished.
« Last Edit: February 01, 2020, 09:31:17 PM by Night »
URW Character Menu - Cheating menu by a player, for the players.
URW Character Designer - Design your characters sprite!

JP_Finn

  • Honorary Lifetime Supporter
  • Member
  • *
  • Posts: 1190
  • Total likes: 646
  • Thawed Finn in SoCal
    • View Profile
« Reply #7 on: March 01, 2020, 09:13:37 PM »
I've not modded the game myself, but played since ~20years ago. So take as a pinch of salt.
Instead of over sized item to cover other graphics or requiring hard coded functionality, 2 ideas come to mind:

1) create the chest/box/crate/barrel as a craftable, non-mobile, but pickable, pack animal; then inventory control would be same as with other 'pets'
2) create the chest as an cup/bowl that takes all/other types of goods, as they now allow foods, not just liquids (if that's changed): berries, herbs et cetera.

ineedcords

« Reply #8 on: March 01, 2020, 11:53:51 PM »
Sometimes the cabin tends to get a bit cluttered, especially in long games.  It's perfectly possible to stash large piles on a single tile, but it looks messy to simply dump everything on the floor.

It would be nice to be able to build a furniture item called "Chest".  I would imagine it would function similar to a cellar, but without the added benefit of keeping food fresh.

It would particularly be nice for clothing items, since those seem to tend to pile up the most.
It's a good idea but I think it should be bigger in scope, in the form of "storage room".
Prerequisite ideas: Shovel, stones, boards.
This could be a good day to utilize your squirrels hides.