74 Commits

Author SHA1 Message Date
Aaron Suen
723d30897d Fix a couple more hints 2020-09-26 14:55:15 -04:00
Aaron Suen
b03b047f0a Buff door catapult, esp higher level doors 2020-09-16 19:46:10 -04:00
Aaron Suen
81df25633a Add stone brick doors 2020-09-12 21:20:46 -04:00
Aaron Suen
de87702497 Door crafting hints and witnessing 2020-09-11 01:08:20 -04:00
Aaron Suen
c47008bc44 Door presses can now place nodes and craft
Thanks to Kimapr for the basic approach, and proving
the concept.

Doors pressing a single-item stack now place that
item as a node, and trigger placement recipes.  Doors
pressing nodes that don't have a single item stack
node form (sticks, leaves) also trigger placement
craft recipes.

All craft pressing recipes require some form of
backstop to provide pressure.
2020-09-07 10:53:51 -04:00
Aaron Suen
18b01c1ae7 Redistribute hints into each mod
Hints themselves have not been tided up
much, but this makes the project of fixing the
hints for each mod a little more manageable
and breaks up the hard-to-navigate single
monolithic hints file in the old guide mod.

The old guide mod has now been completely
retired.  Hints are now a full-fledged API-layer
standard feature.
2020-09-04 19:07:45 -04:00
Aaron Suen
edea123a1e Start on new unified Hint API
- Move hint handling down to API layer
- Simplify stat data; old nc_stats counting can
  be moved out to a separate mod.  We only
  need whether the player has seen or not.
- Invert inventory tab responsibility.
- Merge witness system in from crafting.

TODO:
- Redistribute hint registration responsibility
  to individual mods.
- Test external mod compat.
- Retire old nc_stats and nc_guide systems.
- Add a way to reset hints.
2020-09-04 16:28:27 -04:00
Aaron Suen
f01be30a00 Tidy up registration reporting 2020-07-16 07:29:11 -04:00
Aaron Suen
7f620c462f Revert door logic position hashing
For some reason pos_to_string gives us correct
behavior, but hash_node_position does not, even
though we check to make sure that nodes are
properly rounded so non-integer issues should not
apply here.
2020-07-09 21:18:18 -04:00
Aaron Suen
94401942ee Protect doors, standardize protection 2020-07-01 00:30:40 -04:00
Aaron Suen
b2f78c0daa Indexing for craft checks
By restricting the recipes we check based
on the name of the central object being
checked, we can do many fewer craft
checks per item and avoid expensive
checks.
2020-06-27 12:20:35 -04:00
Aaron Suen
42f125c716 Make most recipes indexable
Register a "rootmatch" property for all
recipes that represents a broader, quicker
test for recipe eligibility.  False positives are
allowed but false negatives are not.

Since most recipes are eligible, we can
use this to build an index for fast lookups
of subsets of recipes to run and skip most
of the other ones.
2020-06-27 11:06:43 -04:00
Aaron Suen
b8bf2322fa More work on DNTs
- DNTs can have default time value
- Automatic loop option
- Optional node name filter
- Use DNT for scaling particles
- A few tail call optimizations
2020-06-19 09:38:03 -04:00
Aaron Suen
d3dc7f28e1 Trigger door ablation instantly on signal 2020-06-19 00:30:17 -04:00
Aaron Suen
db2d748104 DNT API and reliable door ablation
- New Delayed Node Trigger API that allows
  the use of multiple externally-defined node
  timer events, as long as on_timer of a node
  is not explicitly overridden.
- Use the new DNT system to make door
  ablation reliable.
2020-06-18 22:35:47 -04:00
Aaron Suen
984e87e155 Consistent ABM labeling
- Make sure every ABM has a label
- Use consistent case
- More concise names / consistent voice
2020-06-17 07:09:20 -04:00
Aaron Suen
e0156b4742 Add profiler instrumentation metadata everywhere
N.B. the MT built-in profiler doesn't yet actually support reading
labels from bare-function registrations, so a builtin hack is
needed.
2020-06-15 07:21:39 -04:00
Aaron Suen
0067c5d18d Remove delay/jitter from limited abm
Before, ABM firing was delayed by up to a full
interval, but the fulfillment timer could wander
around relative to the trigger, which could lead
to unreliable door ablation.

Instead, just always run the ABM fulfilment
triggers on the next tick, so limted_abm is
ONLY doing the limiting for events that arrive
within the same tick, as most ABMs do.
2020-06-01 21:44:22 -04:00
Aaron Suen
1d0f9aa81f Fix doors/concrete API registration
When 3rd-party mods try to register extensions, don't
crash on trying to register in wrong namespace.

Keep registrations to original mod namespace for now,
as I'm not certain whether I actually made assumptions
about mod name in some logic.
2020-05-18 18:09:44 -04:00
Aaron Suen
35292eb259 Switch to an internal sound API
Avoid mangling official Minetest API
functions that mods may want to
use directly.
2020-04-05 21:22:51 -04:00
Aaron Suen
5e4df4b1f0 No, wait, still need that dependency 2020-03-29 21:34:59 -04:00
Aaron Suen
e7d4d54b1c Genericize chisels, fix recipe digging
- Register groups for chiseling doors.
- Make recipe digging not use player inventory, but drop
  as an item unconditionally.  N.B. the old "replace with air
  then drop item" method only worked with explicit item
  names and not group detection.
2020-03-29 21:32:15 -04:00
Aaron Suen
7bc24b773f Drop rod chisel as an item instead
Instead of instantly digging the rod, which makes it look like
it disappeared, try just "loosening" it into an item so it can be
scooped up without the pick.

It was always also possible to place the rod as an item and
pound that in, making it easier to pick up, but this may not
have been obvious to most players.
2020-03-29 21:23:45 -04:00
Aaron Suen
98b7e21533 After chiseling a door, automatically dig rod
Also adds the ability to register recipes to automatically
attempt to dig a node upon completion.
2020-03-29 21:18:40 -04:00
Aaron Suen
e575cb9b26 Some more hint bugfixes. 2020-01-21 21:36:05 -05:00
Aaron Suen
e2a5581085 Hint updates! 2020-01-21 21:19:30 -05:00
Aaron Suen
7bc1a4ddad Standardize node placement sounds.
Add node placement sounds to processes
missing them, like tree growth.
2020-01-16 22:02:59 -05:00
Aaron Suen
25be3b07a8 Small pos key calc optimization. 2020-01-10 21:11:52 -05:00
Aaron Suen
4d47ab2e75 NC API dependency simplification.
Treat all API mods as a "layer", and use the new
nc_api_all registration to indicate that a mod depends
on the NC API (which ALL NC mods assume they do).
This means that each non-API mod does not need to
worry about which API mods it really needs and which
it does not, nor will they need to be updated for any
internal API restructures.

This is a game, not a modpack, so all mods will be
loaded anyway, and we only care about order.  That
means that we don't really need to worry about
having excess dependencies because any mod we
don't actually need will be needed by something that's
loaded anyway.  If somebody wants to reuse a
component elsewhere, they're likely to need to do
some work to untangle it anyway, because of the
amount that NodeCore mechanics interact and
interdepend.
2020-01-05 12:59:12 -05:00
Aaron Suen
dcfc80b367 Remove explicit names in mod.confs. 2020-01-05 12:38:45 -05:00
Aaron Suen
8c029817bb Remove laser ablation timing jitter. 2020-01-05 12:34:15 -05:00
Aaron Suen
89020e8340 Major rebuild of item_entity.
This created a ton of dependency inversions, which
necessitated moving a number of API functions up into
higher layers, and restructuring dependency lists for
a number of mods.

BOLO: non-deterministic load errors due to missed
dependencies.
2020-01-05 11:42:22 -05:00
Aaron Suen
f9bacc9d96 Door catapult preserves item metadata. 2020-01-01 00:17:43 -05:00
Aaron Suen
b66c636aa7 Doors can't push nodes into players directly. 2019-12-18 19:52:07 -05:00
Aaron Suen
b180912f0e Run AISMs inside totes. 2019-12-04 08:30:37 -05:00
Aaron Suen
d4dd7a00a4 Slow down optic door operation.
This prevents catapults from missing their empty signal.
2019-12-03 20:21:09 -05:00
Aaron Suen
6e1f3fee94 Standardize intra-line spacing in code. 2019-12-01 11:08:12 -05:00
Aaron Suen
a12d44c4f8 Tighten up interact checks. 2019-11-28 08:55:09 -05:00
Aaron Suen
829e8aed81 Fix some things affected by spectators. 2019-11-25 21:46:29 -05:00
Aaron Suen
496da99a03 Press backstop can be "supported" loose nodes.
The press will now search a small distance through falling
nodes to find a solid node, as long as there are no air gaps
in the pack of falling nodes.

This makes aggregate automation possible.
2019-11-23 09:10:57 -05:00
Aaron Suen
decbc96c67 Fix door behavior regressions.
- Packing recipes blocked by stack node visinv ents.
- Item duplication between sliding/falling nodes.

A little sloppy still, but at least it seems to fix the issues.
2019-11-06 19:10:03 -05:00
Aaron Suen
921dc9c1da Doors are now blocked by entities.
This should help mitigate issues that can cause falling_nodes to
clobber doors.  It may make some builds that were working
unreliably before now not work at all, but after a redesign, they
may work more safely now.
2019-11-03 12:40:19 -05:00
Aaron Suen
4996081351 Fix nodes not falling when doors open below. 2019-11-02 21:11:05 -04:00
Aaron Suen
8b9ef4e7ba Door press can be used to count/eject items. 2019-11-01 22:08:51 -04:00
Aaron Suen
98c04d8508 Press only does 1 node per door body.
Not enough pressure to do 2 at a time, and this
prevents it from being trivial to keep a press from
interfering with the item path.
2019-11-01 21:02:29 -04:00
Aaron Suen
42a68a7773 Press backstop cannot be a "loose" node. 2019-11-01 20:44:48 -04:00
Aaron Suen
20e4432598 Apply "press" recipes to nodes jamming doors.
Nodes need to have a "backstop" node of some kind
holding them in place.  Automatically convert all
thumpy pummel recipes to press recipes too.
2019-11-01 20:42:44 -04:00
Aaron Suen
82787786db Door recipe simplification.
- No graphite lubrication needed.
- Just insert pin instead of pounding it in.
- Pins must be inserted into end face.
- Node will not spin from using pin on wrong face.
2019-10-27 08:34:33 -04:00
Aaron Suen
f6102b9512 Revert "Allow placing nodes against ends of doors."
There are other situations where we right-click on things and
expect a non-placement action, and that action fails.  We should
probably be more consistent about not placing in these cases, as
players may be surprised by it, and be left in trouble due to
not having a tool to dig it back up.  Requiring sneak is safer.

Now technically shelves violate this principle, but their
violation is much narrower in scope, i.e. only placement of
containers.

This reverts commit 4795a63116782fe47e72847dd308468a345b9369.
2019-10-13 13:35:49 -04:00
Aaron Suen
70388c4ceb Item duplication bug. 2019-10-13 13:30:47 -04:00