How to Fish
Install

Details

Last Updated
First Uploaded
Downloads
2.7K
Likes
1
Size
31KB
Dependency string
lagarbure-DeathItemRack-1.1.0
Dependants

Changelog

1.1.0

Long gear stays where it is put.

  • Snipers, assault rifles and fishing rods standing in the flanks are now held in place rather than balanced there. Through 1.0.0 they were stood in a prong fork and left to physics, and physics kept finding a way out of it — the rifle rocked itself loose, the rod used its reel for leverage. They now stay standing until somebody takes them.
  • Held gear is released the moment it is picked up, when the rack poofs, when the island unloads and when the mod shuts down. Nothing is ever locked to a rack, and nothing is destroyed.
  • Gear that overflows onto the top of a cabinet is held there too, so a wide sniper rifle no longer slides off it.
  • Held gear sits flush on the plinth or shelf instead of being dropped the last few centimetres, because it has nothing to be pushed out of.
  • Rifles now stand in the flanks instead of lying across a shelf. Anything at least StandingLength (0.7 m) long is offered a flank first even where a shelf would take it. Fish and other creatures are excluded whatever their length - a gar measures as long as a rifle, and a fish standing on its tail in a gun rack is not what anybody wants to come back to.
  • Scoped rifles fit the flanks. Whether a standing item fits across a flank was judged on its overall width against the gap between the cabinet and the pocket wall, which sent every sniper rifle to the top of the cabinet over an obstacle that was never in its way — the wall is ankle high and a rifle is widest at its scope. Only the item's width below the wall's height is tested against it now, and items are placed by their inboard edge so they clear the cabinet at every height by construction.
  • Gear that cannot be stood up now falls back to a shelf when one will take it, and only then to the cabinet top. Short gear that will not lie on a shelf goes on top rather than being stood on end: a flank is for long gear, and an uzi balanced upright took a slot the rifle behind it wanted.
  • Held gear is now held for as long as the rack stands, not just while it settles. The game takes items back off us at times of its choosing - TickUpdate while the synced simulator is still unset, and OnCollision whenever something moving touches the item, which on a rack whose shelved gear is still settling is a normal thing to happen. Asking once was enough most of the time, which is the worst way for it not to be enough.
  • New Physics config section: PinItems (None, LongGearOnly, Everything — default LongGearOnly) and PinSettleSeconds. None restores the 1.0.0 behaviour exactly.

How it is held

Two stages, for two different reasons, both using mechanisms the game already has.

The hold makes the rigidbody kinematic at placement and re-asserts its pose every physics step. The re-assertion is load bearing: RigidbodySync.TickUpdate calls StartSimulateLocal on any item whose synced simulator is not set yet, and that turns kinematic back off. The simulator is set by a server RPC, so for the first few ticks the game is undoing us every tick.

The latch sets RigidbodySync._isFloating, the SyncVar the game uses to hold a fish still on the surface of the sea. Its OnChange calls SetKinematic on every machine, so one flag holds the item for everybody — unmodded clients included — with no networking of this mod's own. It is delayed by PinSettleSeconds because a floating item stops receiving position updates: latching before the racked pose had arrived would freeze a client's copy of the rifle wherever it was standing. Releasing is vanilla's job for the same reason; PickUpPatch only makes sure of it.

1.0.0

First release.

  • When the whole squad is wiped, every player gets their own wooden rack, stood in a row at the island's spawn point and labelled with their Steam name. Playing solo, your own death is the wipe.
  • Each rack is a shelved cabinet on a plinth with an open flank down each side. Handguns, melee weapons, shotguns and uzis go on the shelves; snipers, assault rifles and fishing rods are too long to lie down and stand upright in the flanks, leaning against the cabinet.
  • A rack also holds the item its owner was carrying in their hand when they died, which the game otherwise drops where they fell and forgets about.
  • Racks disappear once the last item has been taken off them, or after three minutes, with the game's own smoke-puff vanish. Items left behind drop to the ground; nothing is ever destroyed.
  • The geometry is generated at runtime and painted from the game's own colour palette, so there are no art files to install and nothing to break when the game updates.
  • Multiplayer: the host arranges the gear, and every player draws the racks locally. Install it on every machine, on the same version.

Notes from bringing it up

Recorded because each one was invisible until it wasn't, and the reasoning is in the README.

  • $"..." interpolation compiled against MonoMod.Backports, which BepInEx does not load, so the rack failed to build with a FileNotFoundException far from the apparent cause. LangVersion is pinned to 9.0.
  • The rack's material was cloned from InstanceManager, whose entries are all scenery decoration — it picked up WindyDecoration, a foliage shader that vertex-animates its mesh, so the rack swayed in the wind and rendered near-black.
  • Shader Graphs/DefaultShader has no colour property at all; it samples a _Colors palette texture through the mesh UVs. Every tint call was a silently guarded no-op and the rack rendered white.
  • Four of the cube's six faces were wound inside-out. Unity culls by winding, not by the normal vector, and the normals were correct — so shading looked right while the rack was a hollow shell you could see through.
  • Coplanar faces between the frame, shelves and lips caused z-fighting.
  • Items wider than the shelf were placed overhanging it, which meant spawning them inside a static collider; the solver flung them across the island. This is what the flanks fix.

tools/check_geometry.py now catches the last two classes offline, across every shelf count and cabinet width, without launching the game.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.