22 Commits

Author SHA1 Message Date
Aaron Suen
ce99412270 Item entities properly fall thru forms 2021-11-27 15:08:40 -05:00
Aaron Suen
3233b7e32e Rework stack settling API 2021-11-27 11:27:56 -05:00
Aaron Suen
69889ee292 Start reforming stacks falling in/thru boxes
- Retire items_fall_thru group
- Add on_settle_item callback
- Open-topped storeboxes automatically capture
  items settling on top of them
- Start converting form into storebox
2021-11-27 09:59:27 -05:00
Aaron Suen
d1b09d0343 items_fall_thru stabilization
Do not allow items to settle onto something
they will immediately fall through if they are
already in a falling-through state.
2021-11-26 09:39:25 -05:00
Aaron Suen
3b0a0452f8 Add items_fall_thru group
Only applies to item stacks, not to falling_nodes.
2021-11-26 09:23:54 -05:00
Aaron Suen
87e8cf4291 Revert item->visinv entity reuse
Apparently an object having had automatic
rotate set in properties in the past will cause its
rotation to retain some unknowable offset,
presumably calculated client-side and not
matching the ent's yaw.  Entity replacement
(i.e. backing out reuse) is the simplest fix and
the transient one-time flicker is better than
losing the stack fullness indicator from yaw.
2021-07-11 22:33:32 -04:00
Aaron Suen
2ce0a3b246 Fix wrong item display on drop-all items
If an item was settling too far away from where the item ent
landed, e.g. if pushed out by other settling items at the same
place, then it was using entity position to get visinv data
instead of node position.

Inform visinv ents of their actual node position instead of relying
on the object being reasonably close and rounding.  This fixes
multiple potential issues with visinv entity display and allows
these entities to be displaced arbitrarily far from their home
node and still function.
2021-07-06 07:25:03 -04:00
Aaron Suen
90dbadb5bd Fix thrown item stack settling flicker
When a thrown item settles into a node space and
becomes a visinv node, reuse the existing entity instead
of deleting the old one and creating a new one, if
possible.
2021-07-06 07:14:14 -04:00
Aaron Suen
99254bf726 Simple visinv tweening
- On door convey
- On item ent settling

Only able to support limited cases, and still can't
usefully animate nodes, but at least this makes
some item placement behavior look smoother.
2021-07-05 13:42:46 -04:00
Aaron Suen
cfeae44a72 Fix items settling into shelves too eagerly
Items now try to settle into air and open stacks
first, and only squeeze into shelves/storeboxes if
there is no other available space.
2020-09-14 08:33:32 -04:00
Aaron Suen
b1c1ffb86a Fix item ents settling on map lower bound. 2020-03-22 11:10:47 -04:00
Aaron Suen
5d7f033c81 Rudimentary (inefficient) item merge. 2020-01-05 14:21:54 -05:00
Aaron Suen
c2e014a776 Attenuate scans for dropped items. 2020-01-05 13:48:53 -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
b1fab67491 Start work on unifying/simplifying builtins.
falling_node rebuilt from scratch so far.
2020-01-04 10:51:10 -05:00
Aaron Suen
511455fff9 Player/ent freefall physics cleanup.
- Thrown objects inherit initial velocity.
- Player and objects have matched terminal
  velocity and can free-fall in tandem.
- Thrown objects experience horizontal air
  friction too.
2020-01-02 23:03:23 -05:00
Aaron Suen
fa24151782 Fix the jumping eggcorn bug. 2019-12-15 08:43:33 -05:00
Aaron Suen
d514f8f56d More dynamic item settling random management.
Instead of shuffling all the shells once for each tick used,
shuffle only those shells actually used once per tick.  This
should save us more time in common cases where we need
to only check a few shells to find a place to settle.
2019-12-07 11:26:10 -05:00
Aaron Suen
e0f2cb5b6d Item settling overhaul.
- Always prefer closest place first, then lowest height.
- Simplify search order; use a pre-built order instead of scan.
- Randomize search order only once per tick, if used.
2019-12-07 11:12:55 -05:00
Aaron Suen
d016885364 Attempt to settle items stuck inside nodes. 2019-11-28 08:40:28 -05:00
Aaron Suen
8a0f073592 Simplify item settling, make instant.
The old method was designed for 0.4 compatibility.  Since 5.0
there appears to be a flag we can just check to see if the item
is still moving according to physics or settled.
2019-09-12 21:56:06 -04:00
Aaron Suen
247bebe417 Finally break up the nc_items monstrosity. 2019-09-07 09:44:30 -04:00