* make materials.lua with hades, minetest game, farlands items
* make textures file for central handling
* make mods game agnostic
* take out the trash
* handle multiple seats in sofas
* add github luacheck workflow and various luacheck fixes
* add fluxionary scope creep
* fix devtest breaking right to a name policy
Co-authored-by: wsor4035 <24964441+wsor4035@users.noreply.github.com>
Co-authored-by: SFENCE <sfence.software@gmail.com>
This commit performs both lossless and lossy compression on every .obj and .png in homedecor. The .png files were all 100% losslessly compressed using ect.exe and optipng.exe (more details below) at maximum settings. The .obj files were lossy-compressed so that comments were removed, trailing 000's were removed and all numbers rounded to 3 decimal places max. Blender exports at 6 decimal places but for minetest, 3 decimal places is the absolute maximum a person with anything under a 256K screen will ever need.
## Results
```
Original entire modpack size: 6343.5 KB
New entire modpack size: 5312.2 KB
Total Reduction: 1031.3 KB (16.3% less)
```
Please note that actual media size is likely more like 4,500 KB so media reduction is more around 20-25%.
## Details / What actions were actually performed
Used these programs:
https://github.com/ExeVirus/Compress-Objhttps://sourceforge.net/projects/optipng/https://github.com/fhanau/Efficient-Compression-Tool
Ran this command on every .obj: (fast)
```
luajit.exe compress.lua -f <file> -precision 3
```
Ran these commands on every .png: (slow)
```
ect.exe -9 -strip --allfilters-b <file>
optipng.exe -o7 -strip all -clobber <file>
```
Note that for future compression, I recommend only using optipng.exe instead of both. ECT can get better results but it takes a LOT longer and only ever saves another 1-2% of the file size. Not worth an extra 10-20 seconds per texture file in my opinion.
## Time spent
Roughly 2 Hours from start to finish + commit + PR
if you express the connections in ascii where N is the Node 1 is connected and 0 is not connected:
```
y+0: 010
1N1
010
y+1: 010
111
010
y-1: 010
111
010
```
This code structure is more easy to read / a very close representation of the sketched layers.
```
Undeclared global variable "mesecon" accessed at ...etest/mods/homedecor_modpack/homedecor_lighting/init.lua:852
Undeclared global variable "mesecon" accessed at ...etest/mods/homedecor_modpack/homedecor_lighting/init.lua:898
```
- Add screwdriver to optional_depends
- Fix luacheck warnings (mostly removing unused/legacy stuff)
Note: sm_light used to be a light_source value for lattice small lantern,
but when this was changed, only half of the lines were deleted
(including the declaration). The other half has been preserved because
it was part of an if-arm that "seems" unrelated (but it only seems).
- Improve french translation
if mesecons, put "off" rope lights in creative inv, and drop them as "off" as
well. else, put "on" in creative inv and drop "on"
allow right-click on rope lights only if no mesecons
also cache minetest.get_modpath("mesecons")
for backward compat, they'll resond to the usual strings, too:
"off" -> 0
"min" -> 3
"med" -> 7
"hi" -> 11
"max"/"on" -> 14
all dimmable nodes have been renamed to bear the light value in their
names, and aliased.
the non-dimmable lights still respond as before
("off" or n < 4; "on" or n > 3)
merge table and standing lamps into the new code
of all the relevant lights, the plasma ball is the only one that remains
on/off-only, since dimmable doesn't make sense there.
That one, and any future lights that get the on/off-only treatment, will
use the previous on/off behavior, i.e. turn off with the messages "off"
or "low" or a number < 4, and turn on with "med", "hi", "max", "on" or
a number > 3
This alters the behavior of table/standing lamps - they will no longer
cycle brightnesses by right-click. Like all other controllable lights,
they'll just toggle on/off. If there's enough demand for it, I'll add
that feature back in at a later date.
allow non-dimmables to respond to "off", "low", "med", "hi", "max", "on"
number messages for dimmables:
0 turns the light off
1-3 sets it to "low"
4-7 sets it to "med"
8-11 sets it to "hi"
12+ sets it to "max" (i.e. full-on)
non-dimmables:
a number > 3 or the strings "med", "hi", "max", or "on" turn the light on
a number < 4 or the strings "off" and "low" turn the light off
digiline stuff to be more generic, and add various digilines connections
rules to complement mesecons rules.
Mesecons must be present to get the "wallmounted" rules for digilines nodes.
Without mesecons, nodes that want wall rules will get alldir rules instead.
Add mesecons support to table and standing lamps (off -> max -> off).
Add digilines support to all other lights that now support mesecons,
except rope lights, since they're a mesecon conductor.
(will approach that last one later)
"off", "low", "med", "hi", "max". Any other message is ignored
shift-punch to set the digiline channel
only connects from X/Z directions
right-click still cycles brightness as before
also adds protection check for right-click brightness changing
Each light connects only according to what sides make sense.
For example:
* a plasma lamp cube or large lattice lamp will connect from all 6 sides
* a ground lantern will only connect from its NSEW sides, not its top or
bottom
* a glowlight slab, glowlight cube, or lattice cube uses the same rules as
mesecons lamps, so its four edges and it back/bottom, whatever its
orientation, but not its top/front.
* a (kitchen) ceiling lamp, and a (hanging, exterior) ceiling lantern will
only connect from the top.
Rope lights are defined as a conductor, just like a mesecons wire,
so if mesecons is present, they will default to off unless powered by
a mesecons wire/switch/etc.
You can still right-click-toggle individual segments on/off.
Ceiling rope light connection rules are a little funky, but they work
(I wanted them to only connect from the top, but I couldn't get it
just right). Floor-orientation connections are straightforward.
also removed debug prints
Lights are forced-on when placed, and remain so
until they receive a mesecons "off" signal.
Lights can be toggled on/off independent of the
mesecon signal state by right click, which will
persist until the next signal transition,
which will change the light to follow.
with right-click.
Rework glowlight slab and cube textures, simplify,
use overlays and compositing, so that the bulk
of the light can switch between a dark, matte surface,
and a bright surface with central glare gradient, and
so that the surface and eging respond to param2 color.
Tweak all other relevant nodes so that their light
source changes to a darkened (or even translucent
texture) when off.
On/off switching doesn't affect things like oil lamps,
candles, chandeliers, etc. Just basically the stuff
that would be electric-powered in real life.
If in a protected area, only that area's owner can
turn the light on/off.