Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3150c50312 | ||
|
e507646519 | ||
|
2f99a60cbd | ||
|
e9cf28a648 | ||
|
ebe1720922 | ||
|
61e20f57ed |
@@ -114,3 +114,7 @@ v0.1.21
|
||||
* Minor bug fix, movefloor global.
|
||||
* Fixed movefloor so player doesn't fall through floor.
|
||||
* Transfer timer in moved nodes for pistons.
|
||||
|
||||
|
||||
v0.1.22
|
||||
* Added storage.
|
||||
|
38
crafting.lua
38
crafting.lua
@@ -23,6 +23,44 @@ minetest.register_craft( {
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "lwcomponents:storage_unit 2",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "group:wood", "group:wood" },
|
||||
{ "group:wood", "", "group:wood" },
|
||||
{ "group:wood", "group:wood", "default:chest" },
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "lwcomponents:storage_unit_locked 2",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "group:wood", "group:wood" },
|
||||
{ "group:wood", "", "group:wood" },
|
||||
{ "group:wood", "group:wood", "default:chest_locked" },
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "lwcomponents:storage_indexer",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "group:wood" },
|
||||
{ "group:wood", "default:chest" }
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "lwcomponents:storage_indexer_locked",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "group:wood" },
|
||||
{ "group:wood", "default:chest_locked" }
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "lwcomponents:cannon_shell 10",
|
||||
recipe = {
|
||||
|
99
docs/storage.txt
Normal file
99
docs/storage.txt
Normal file
@@ -0,0 +1,99 @@
|
||||
Storage
|
||||
-------
|
||||
|
||||
Storage is accommodated with two nodes, Storage Unit and Storage Indexer.
|
||||
Storage units can be interacted with like a basic chest, each with 32 slots,
|
||||
and visually join together when placed adjacent to each other. Units are
|
||||
generally accessed via indexers, which action all adjoining units as a
|
||||
single storage block. Multiple indexers can action a single storage block.
|
||||
|
||||
Only the owner can dig or access the form of the locked versions.
|
||||
|
||||
Unowned indexers can only access unowned units. Owned indexers can access
|
||||
units of the same owner or unowned units.
|
||||
|
||||
UI
|
||||
Search - top left.
|
||||
List - left.
|
||||
Channel - digilines channel of indexer.
|
||||
Input - middle.
|
||||
Output - top right.
|
||||
Filter - center right.
|
||||
Player inventor - lower right.
|
||||
|
||||
When the UI is accessed the storage is scanned, and its contents are
|
||||
displayed in the list. The list contains the following columns:
|
||||
Item button - pressing will place one of these items from storage into the
|
||||
output.
|
||||
10 button - pressing will place 10 of the item.
|
||||
<stack> button - pressing places a full stack.
|
||||
Count - the total number of this item in storage.
|
||||
Description - description of the item.
|
||||
|
||||
Note that the 10 and stack buttons may vary in number or not appear
|
||||
depending on the requirements of that item.
|
||||
|
||||
The form does not update while open. A request for more items than in
|
||||
storage will only deliver the amount in storage.
|
||||
|
||||
Terms can be entered into the search field, and when enter is pressed or
|
||||
the Search button is pressed, only items whose description contains these
|
||||
terms are shown in the list. That is if they match any of the space
|
||||
separated terms.
|
||||
|
||||
Any items placed into the input are placed into storage. If the filter
|
||||
is clear all items are accepted. If the filter contains items only these
|
||||
items will be accepted. Any items not accepted or that do not fit into
|
||||
storage are placed into the output.
|
||||
|
||||
When items are placed into the filter a copy is used and the item returns
|
||||
to where it was taken from. When items are removed from the filter they
|
||||
are disposed of.
|
||||
|
||||
Hoppers placed to the top or sides of an indexer will feed items into the
|
||||
input. Hoppers placed below an indexer will take items from the output.
|
||||
|
||||
Every 20 inputs the storage is consolidated to minimize fragmentation.
|
||||
|
||||
|
||||
Digilines messages
|
||||
|
||||
"output <item> <count>"
|
||||
or
|
||||
{
|
||||
action = "output",
|
||||
item = "<item>",
|
||||
count = <count>
|
||||
}
|
||||
Moves the item/s to the output. If count is omitted defaults to 1. If
|
||||
the requested amount is greater than in storage, only the stored amount
|
||||
is moved.
|
||||
|
||||
|
||||
"inventory"
|
||||
Sends a digilines message with it's own channel in the following form:
|
||||
{
|
||||
action = "inventory",
|
||||
inventory = {
|
||||
<items>
|
||||
}
|
||||
}
|
||||
The inventory key is an indexed list of items in storage. Each item
|
||||
entry is a table with the following keys:
|
||||
{
|
||||
name -- string, the name of the item, as <mod>:<name>
|
||||
description -- string, description of the item, same as in UI
|
||||
count -- number, the total number of this item in storage
|
||||
custom -- true if a custom item (has metadata), false if not
|
||||
pallet_index -- string if the item has a pallet index, otherwise nil
|
||||
id -- string, unique id of the item in storage
|
||||
}
|
||||
The description is derived in the following manner: from a custom
|
||||
description in metadata; if none then the short description from
|
||||
the item's definition; if none then the description from the item's
|
||||
definition; if none then the item's name, as <mod>:<name>.
|
||||
|
||||
Note: When sending output messages the simple item name, as <mod>:<name>,
|
||||
will work for most items, but not for custom items. With custom items, or
|
||||
to play it safe, use the table form of the output message and set the item
|
||||
field with the id field for the item from a returned inventory.
|
3
init.lua
3
init.lua
@@ -1,4 +1,4 @@
|
||||
local version = "0.1.21"
|
||||
local version = "0.1.22"
|
||||
local mod_storage = minetest.get_mod_storage ()
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ loadfile (modpath.."/cannon_shell.lua") (utils)
|
||||
loadfile (modpath.."/pistons.lua") (utils)
|
||||
loadfile (modpath.."/through_wire.lua") (utils)
|
||||
loadfile (modpath.."/camera.lua") (utils)
|
||||
loadfile (modpath.."/storage.lua") (utils)
|
||||
loadfile (modpath.."/extras.lua") (utils)
|
||||
loadfile (modpath.."/digiswitch.lua") (utils)
|
||||
loadfile (modpath.."/movefloor.lua") (utils)
|
||||
|
@@ -82,6 +82,9 @@ public domain.
|
||||
camera lens images derived from images from https://openclipart.org, which
|
||||
is public domain.
|
||||
|
||||
storage nodes images derived from images from https://openclipart.org, which
|
||||
is public domain.
|
||||
|
||||
player button images derived from mesecons button image.
|
||||
|
||||
cannon firing and explosion sound from tnt (TumeniNodes/steveygos93),
|
||||
|
@@ -13,7 +13,7 @@ CC BY-SA 3.0
|
||||
|
||||
Version
|
||||
=======
|
||||
0.1.21
|
||||
0.1.22
|
||||
|
||||
|
||||
Minetest Version
|
||||
@@ -67,6 +67,7 @@ Various components for mesecons and digilines.
|
||||
* Digiswitch, digilines controlled mesecons power.
|
||||
* Movefloor, similar to vertical mesecons movestone.
|
||||
* Camera, takes a representative image.
|
||||
* Storage, indexed storage units.
|
||||
* Mesecons Through Wire, transmits through 1 to 2 solid blocks.
|
||||
* Solid color conductor blocks, same as Solid Color Block but also mesecons
|
||||
and digilines conductor.
|
||||
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 64 KiB |
@@ -12,6 +12,9 @@ utils.settings.alert_handler_errors =
|
||||
utils.settings.max_piston_nodes =
|
||||
tonumber (minetest.settings:get ("lwcomponents_max_piston_nodes") or 15)
|
||||
|
||||
utils.settings.default_stack_max =
|
||||
tonumber (minetest.settings:get ("default_stack_max")) or 99
|
||||
|
||||
|
||||
|
||||
--
|
||||
|
1344
storage.lua
Normal file
1344
storage.lua
Normal file
File diff suppressed because it is too large
Load Diff
BIN
textures/lwcomponents_storage.png
Normal file
BIN
textures/lwcomponents_storage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
textures/lwcomponents_storage_framed.png
Normal file
BIN
textures/lwcomponents_storage_framed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
BIN
textures/lwcomponents_storage_indexer.png
Normal file
BIN
textures/lwcomponents_storage_indexer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
Reference in New Issue
Block a user