374 Commits

Author SHA1 Message Date
Aaron Suen
46c8a6d555 Add wind ambiance to trees, varying with altitude. 2019-09-01 10:07:48 -04:00
Aaron Suen
39dea8a2ae MAJOR: Code quality audit using luacheck.
- Removed lots of unused variables, a few shadowed identifiers.
- Removed a few sections of dead code.
2019-08-31 09:26:53 -04:00
Aaron Suen
80a2f8277c Be even more conservative about using stackfamily merge logic. 2019-08-31 08:02:06 -04:00
Aaron Suen
7d1d1e9602 Fix a long-standing race condition bug in limited_abm processing.
ABM action calls are delayed until a background timer picks them
up, but it passes in the original args and assumes that the nodes
haven't changed.  In addition, it bypasses our bug #8378 hack,
because that check is done in the abm action call but NOT the
background worker timer.

Do a check in the worker to make sure the node to be acted on has
not changed since the call was queued, and just let the call miss
and waste in that case.

Note that this automatically implicitly handles any #8378 issues
that may still be present since it has to force a fresh check of
the node to be operated on anyway.
2019-08-30 23:49:00 -04:00
Aaron Suen
3c5d7e200b "Family" stacking API
If items have a common "stackfamily" property in definition, then
they combine stacks; name and metadata are effectively ignored and
any name is considered acceptable for the combined stack name.

This is used by Lux to allow it to stack naturally instead of the
player having to lay them out spaced on the ground to "cool" them
all to the same level, since all Lux changes dynamically anyway.
2019-08-30 22:36:44 -04:00
Aaron Suen
458043fa18 Make ezschematic from tree growth into a full-fledged API.
I may use this for other companion content.
2019-08-27 21:41:03 -04:00
Aaron Suen
fe2c153f9e Clean up all lua code style.
Formatting rules based on Paul Kulchenko's perl-based formatter...
http://notebook.kulchenko.com/programming/lua-beautifier-in-55-lines-of-perl
...using a single tab for indent.

Mostly pure whitespace changes.
2019-08-27 19:14:51 -04:00
Aaron Suen
aa1c5d860f Fix some warnings.
- Missing "local" in translation code.
- Super-long-standing warning about duplicate aliases via oldnames.
2019-08-27 07:31:45 -04:00
Aaron Suen
d1ff1d400c More succinct translation to better fit screen. 2019-08-26 21:27:12 -04:00
Aaron Suen
5a07edbb5a Player Guide Translations
- Fix tab switching events for formspecs.
- Add padding to fix cutoff text rendering issue.
- Added more pt and pt_BR translations from Terifo.

Note that when you call translate() on a piece of
text, it merely adds translation tags around it to
request that it be translated client-side, but when
the client submits formspecs, the button values are
the actually translated text, which you can't
trivially access server-side.  That means that we
need to use different button fields, not just count on
different button name/values, for events.
2019-08-26 21:02:06 -04:00
Aaron Suen
8a0319e7d1 Fix new player guide translations... 2019-08-26 01:01:58 -04:00
Aaron Suen
bc7b449b05 Translations to Portugese by Terifo. 2019-08-25 19:06:16 -04:00
Aaron Suen
4d245b850b Fix lualocals. 2019-08-23 21:18:14 -04:00
Aaron Suen
28108e1e40 Add translation support, esp. for TouchTips.
Translations are currently by holistic strings, i.e.
no parameterization.  This may create some busy
work for translators, but gives them more freedom
to account for differences between languages.

A translation template file is written out to the world
path on game start, so translators have a seed to
work from.
2019-08-23 20:40:33 -04:00
Aaron Suen
8c2181b250 Make node sounds on spinning too. 2019-08-14 21:46:55 -04:00
Aaron Suen
5651e94100 Slightly randomize sound pitch by default.
This will make stacked/repeated sounds play slightly differently
so you can hear from the interference patterns that there is more
going on underneath the surface.  It also adds volume to dispersed
ambient effects like fire.
2019-08-14 18:28:24 -04:00
Aaron Suen
86cc55c12b Basic door node setup and recipes.
- Craft door panels by chiseling with a rod.
- Rotate door panels.
- Hammer in rod to act as hinge pin.
- Dig out hinge pin, dig up panel.
2019-08-13 21:06:13 -04:00
Aaron Suen
22e11bf471 Revert "Remove (expensive) issue8738 workaround."
This reverts commit 68c6f6671121b1b72b62db97858c25c82f6e834f.

I was able to reproduce the issue, in a case when it was definitely
NOT a falling_node mishap.  Snuffing fire by placing a node against
the last bare face of embers apparently creates a race condition,
in which the node you place can be removed instead of only fire
being removed.
2019-04-13 00:11:03 -04:00
Aaron Suen
db5cbd3de4 Avoid lighting bugs, players messing w/ inventory via CSM. 2019-04-09 21:06:55 -04:00
Aaron Suen
3a8908e9d8 Sound code crash. 2019-04-07 17:45:26 -04:00
Aaron Suen
54293a24be Oops... 2019-04-07 00:03:06 -04:00
Aaron Suen
c1828219e6 Refactor social sounds subsystem.
Standardize the "play a sound for everybody except the player who
is already playing it client-locally" logic into one place.

Fix failure to correctly detect tool speeds for some things, i.e.
when the player is using a tool but the capability used on a node
is actually inherited from the hand.

Note that this may allow pummeling with wrong tools (e.g. repacking
soils with spades) along with accompanying inappropriate tool wear,
but this should be minor and avoidable, and can be fixed later...
2019-04-06 23:51:05 -04:00
Aaron Suen
eba101c93a Fix sound doubling issues. 2019-04-06 23:42:23 -04:00
Aaron Suen
617aa4704f Dug sounds for old node, not new. 2019-04-06 21:28:11 -04:00
Aaron Suen
68c6f66711 Remove (expensive) issue8738 workaround.
I suspect that the problem that I actually observed was caused by
falling_node behavior, and NOT by an abm.  This workaround cannot
remain without firm evidence that it solves an actual problem.
2019-04-06 20:50:58 -04:00
Aaron Suen
80d3d9708c Deprecate player:get/set_attribute to player:get_meta(). 2019-04-06 20:46:13 -04:00
Aaron Suen
a674184df0 Fix deprecated getpos -> get_pos. 2019-04-06 20:34:13 -04:00
Aaron Suen
fe727d0145 Social digging/placing sounds.
Normally these play only locally for the client doing the
digging/placing.  Explicitly play them to other nearby clients.
2019-04-06 20:14:04 -04:00
Aaron Suen
68d996e1f3 Begin EOS for MT 0.4.
We actually haven't been testing in 0.4 at all for quite a while
now.  Since this is a standalone base game without complex
interdependency relationships, there isn't really any need to
maintain compat with old versions of the engine.  Players can
upgrade to play; keeping a separate copy just to play on old 0.4
servers is even still an option.

There is some internal cruft that has been building up to support
0.4, and this allows us to purge most of it.  The larger benefit
may come when we're able to remove line_of_sight in favor of the
more efficient raycast (still yet to be done).
2019-04-06 11:21:34 -04:00
Aaron Suen
507f5ae98e Sounds for tools wearing out and breaking. 2019-04-01 00:39:30 -04:00
Aaron Suen
ab5f6bcdbb Attempt to work around engine bug 8378.
Hopefully calling minetest.get_node_or_nil() again for all ABM's
will bypass the broken node cache.  We should see warning messages
in the logs if this is the case.
2019-03-31 23:55:05 -04:00
Aaron Suen
cd5dbc8268 Make collision boxes just a LITTLE bigger for realism. 2019-03-31 21:32:11 -04:00
Aaron Suen
2fe4875e6b Shrink now annoyingly-big collision box.
This is interfering with being able to toss items down chutes
that are purposefully made too small for players to fit.
2019-03-31 21:30:10 -04:00
Aaron Suen
ef1eb45ea5 And, of course, with the debug code I forgot to remove... 2019-03-30 23:05:07 -04:00
Aaron Suen
359c625df8 Larger, bolder, easier to see item and stack ents.
This restores an old visual scale from the extremely early days
of NodeCore.  That style was removed to syncrhonize the scale of
stack nodes with item ents.  The syncrhonization can work the
other way, too, though.

This was triggered by wanting to make loose item ents more
visually distinct at a glance from settled stack nodes, by making
loose item ent rotation faster.  Since we were going to change the
properties either way, given that, then we might as well use the
better visual.

Since making stack nodes have a full-size collision hull, it was
distracting having the items inside be so mismatched in scale.
Also, the "pointing around stacks" thing becomes less important
in long-run gameplay with shelves in play, which do not allow
pointing around/through anyway.
2019-03-30 22:07:23 -04:00
Aaron Suen
85f87d1c17 Simplify some selectionboxes significantly. 2019-03-30 21:23:02 -04:00
Aaron Suen
dca1e58a85 Yet more inventory/pickup changes.
- Intercept /give commands.
- Provide an API for giving the player an item and inserting it
  into the inventory in the right place(s).
- Change the fill order.  We try to fill the current slot first,
  the continue to the right to the end of the bar, and then
  finally work our way left to the beginning.  I think this fill
  order should be most comfortable, in terms of having items tend
  to fall close to the cursor.
2019-03-28 22:52:48 -04:00
Aaron Suen
47b4ae9bc6 Promote inventory pickup changes to a first-class feature mod.
Use interception where possible to modify destintion for items
directly instead of relying on post-hoc inventory rearrangement.

This should resolve the glitches where items appear in the wrong
place in inventory for a flash before being moved.
2019-03-27 22:10:45 -04:00
Aaron Suen
e8c698d571 Removed logtrace (moved to szutilpack). 2019-03-27 06:37:10 -04:00
Aaron Suen
9f53c5b43d Fix crash on punching lava.
minetest.[de]serialize apparently does attempt to serialize
functions (e.g. the on_punch) hook now, but all upvalues become
nil in the process.
2019-03-24 22:32:36 -04:00
Aaron Suen
45160f7270 Oops, fix regression in stack dig node sounds. 2019-03-24 18:42:32 -04:00
Aaron Suen
7c19e0aa07 Remove the old sneak-dig hack.
It was superseded effectively by the new inventory management
system.  To split stacks, count out the items to transfer onto the
ground using sneak-drop, select the destination slot and pick them
back up.
2019-03-24 18:34:17 -04:00
Aaron Suen
8a8533a8fc Convert lode to new cooking recipe system. 2019-03-22 22:55:30 -04:00
Aaron Suen
da54ec1815 Start to unify cooking/cooling into recipe system. 2019-03-22 21:55:02 -04:00
Aaron Suen
27770dfdb7 Try to fix stack node sounds.
Use same node_sound hook as punch hook, to limit sound rate.
2019-03-16 17:10:20 -04:00
Aaron Suen
38833a90a7 Limit punch sound interval. 2019-03-14 22:04:44 -04:00
Aaron Suen
2f3d2afff5 Sounds on tapping/pummeling nodes. 2019-03-14 21:48:29 -04:00
Aaron Suen
66e8352889 Fluid and ambient sounds. 2019-03-14 21:35:33 -04:00
Aaron Suen
293dd8c1fc Revert falling pileup tweaks due to issues with fluids. 2019-03-14 01:21:19 -04:00
Aaron Suen
5de0cc54ec Add stony sounds, and sounds for stacks/shelves. 2019-03-14 00:31:09 -04:00