

Wondrous gizmos and gadgets for the restless mind.
A collection of wacky scripts I've written for projects I'm involved in, most prominently Bozoros and PlayZone.
Everything's kept fairly abstract so it can be generally applied for many use cases. Feel free to add this to your project to play around with, if anything catches your eye!
NOTE: Expect a few breaking changes here and there (at least while everything is being polished), should you choose to add this as a dependency.
NOTE 2: This is not intended to be a JLL replacement and follows a pretty different design philosophy, though there are several overlapping features. It should be fine to use both libraries in the same project without issues, however.
A proper write-up and documentation for all components and their intended usage is planned, but here's a quick rundown of them all:
Jump), or they are detached through some other means. Used for Bozoros' balloon rides and PlayZone's slides.Collider underneath it has an appropriate tag), with a few customizable traits. Players can also be inflicted with the TZP 'drunk' effect, at a configurable rate. Used for PlayZone's ball pit.InteractTrigger. Used for PlayZone's slides.Transform 'pivots' to rotate to look towards the target, also at configurable speeds.Jump, Move, Crouch), and invokes an event callback if so. A cooldown can be applied so as to not trigger continuously, which can even be used for things like fake custom footstep sound effects. Used for PlayZone's ball pit movement effects.
Collider instances belonging to objects of a certain type.
MapHazards layer inside the region, with an additional function to despawn found hazards.MeshRenderer and/or Collider instances.Landmine.SpawnExplosion using DetectRegion, which performs non-allocating searches inside a Collider (instead of a radius), contains some additional customizability for explosion properties, and has an adjustable collision mask to define which layers should count as 'cover' from the explosion.GrabbableObject but with a bunch of event callbacks that can mimic an inheriting class (e.g. SoccerBallProp) without actually inheriting it, sacrificing polymorphism for modularity. All these components can be mixed and matched to create items with multiple properties (e.g. ItemKickable + ItemThrowable to make a throwable soccer ball).
NoisemakerProp, with pretty much the same properties save for a few additional ones.SoccerBallProp, with some added customizability for kick trajectory parameters, event callbacks, and an adjustable collision mask for objects it can land on top of.StunGrenadeItem, with some added customizability for throw trajectory parameters, event callbacks, and an adjustable collision mask for objects it can land on top of.BeltBagItem's wearable properties, specifically 'attaching' to either the player's head, belt, or a custom bone when pocketed.Shovel, with added customizability for its properties (e.g. hit cooldown or hit speed), event callbacks for every stage of the 'whacking' process, and adjustable collision masks for hittable objects, with the added bonus of not allocating GC on every swing.LungProp but with all the event callbacks from ItemGrabbable, plus a few Apparatus-related ones. Allows selectively customizing which parts of the Apparatus sequence are actually triggered (e.g. showing the alert without shutting off power).
EventfulApparatus already includes this functionality, this is just for when a standard LungProp is preferred.InteractTrigger-related components.
InteractTrigger for a ladder with adjustable climbing speed.DoorLock implementation that allows custom tooltips that don't get overwritten when using a key. Doesn't inherit from InteractTrigger but is used alongside them for locked doors.InteractTrigger that can invoke an event, but for a fee.InteractTrigger that acts like a Cruiser seat, but requiring a specific button press to get back up.
PlayerSeater for functionally the same effect, without the vanilla bug where two players get softlocked if they sit down at the same time.InteractTrigger that can transmit a player's voice over the Walkie while held; though only for one-way communication.Renderer becomes visible or invisible to any Camera displayed on the local client.
OnBecameVisible() and OnBecameInvisible() calls so it might not fully work as expected, particularly with a LODGroup.ScriptableObject that can define an arbitrary 'global' event that can be invoked from any event callback, as long as their parameters match.
ScriptableEvent to create an arbitrary 'global' event. This event can be raised from within any other event callback, to trigger something to happen on another, completely detached object.NetworkObject types, with a lot of varying customizability for the spawns.
EnemySpawner or EnemySensor to create 'temporary' enemies that will eventually die (e.g. after a certain amount of time passes, or after a player interacts with something). Also has some functions for dealing damage to enemies.ScriptableObject that includes a list of objects to register as network prefabs at the start of the game, in order for them to be spawned by PrefabSpawner without registering through other means. Needs to be manually added to a bundle that loads at the start of the game (e.g. an ExtendedMod bundle).Shovel buried in the ground), as long as fallToGround is disabled. Has the option of using the current moon's scrap weights (in addition to the weighted list) for item selection.
GiftBoxItem, with their contents being randomly picked using a weighted list, instead of being dependant on spawn position. Has options for overriding minimum and maximum scrap values for the item inside, sound and particle effects played when opening the gift, scan node text and parameters for the gift, and the material used for the gift.IHittable, and can thus be hit.
0 health). Also doubles as a generic counter script, if abstracting what 'getting hit' means.Rigidbody upon being hit, with force depending on the damage dealt and direction depending on where it was hit from.AudioSource components, for performing audio operations (e.g. pausing and unpausing) to each of them all.Rigidbody components, for applying a force of a certain type (e.g. ForceMode.Impulse) to each of them all.
Vector3 within a specified range to an event callback, where it can be used by other scripts (e.g. RigidbodyGroup). Has functions for modifying the minimum and maximum values for each axis, if so desired.Renderer components, for performing render operations (e.g. enabling/disabling shadow casting) to each of them all.PlayerAttachable components, for performing attach operations (e.g. attaching and detaching) to each of them all.Animator parameter (that can be switched) to allow setting its value from an event call, while also syncing said value across clients.Animator to use as a speed multiplier for an AnimationClip, allowing smoothly changing between speed values and syncing it across clients.SetLineRendererPoints script (used when the Cruiser is being delivered), except allowing more than just two points, and also able to handle the LineRenderer having useWorldSpace disabled.PlayAudioAnimationEvent script, except only its event callback (everything else it offers can be handled through other scripts instead), of which there can be multiple defined within the same component.GameObject with object pooling capabilities, instances of which can be assigned to specific objects to play effects simultaneously.DeadBodyInfo (triggers fear effect when looked at), but has various customizable parameters (e.g. cooldown, max distance, angle, and amount of fear relative to distance).Renderer.AudioSource but with networking capabilities, so all clients can hear it being played. Has a few additional configurable parameters, including whether sounds made by it should alert enemies or not.v67, if enabled for the current round.StoryLog but with a few added event callbacks (e.g. when a player collects it, or when it tries spawning while having already been collected).TVScript that works when inside the facility, instead of immediately shutting itself off. Works even if most fields (e.g. all VideoClip and Material ones) are left blank to reduce bundle size, since they get replaced with the values present in the vanilla prefab. Also compatible with TVLoader, as long as there's no TV playing in the ship.SpawnableMapObject by copying its AnimationCurve for the current moon over to another added through ExtendedDungeonFlow at the start of the round. Relies on the vanilla SpawnableMapObject not being present in any of the RandomMapObject spawners for the interior, so it's a bit wonky in its implementation.OutOfBoundsTrigger to the lowest point in the current dungeon generation, allowing for extremely vertical interiors without having to worry about intersecting it.
ExtendedDungeonFlow since LethalLevelLoader v1.6.0, with the EnableDynamicOutOfBoundsTrigger field. This script is only kept here for backwards compatibility.AudioReverbTrigger present in the ship scene (SampleSceneRelay), which would otherwise be inaccessible from the moon side of things.
AudioReverbTrigger but with a customizable delay per activation, instead of running every frame. Also has an option to trigger only upon entering it.Doorway with the option of specifying whether it can be picked as an entrance, exit, or neither while generating the dungeon, in order to have more than just one to choose from. Also has options for modifying their weights, which can increase or lower their chances of being picked to generate a path.
SpecificDoorway for them to apply everywhere else.A lot of these scripts can be quite niche, and may require further explanation to employ properly. If you're curious about any of them and/or have any questions regarding usage of a particular script, I've kept my commit messages fairly lengthy when adding new scripts, but also feel free to ping me in the Lethal Company Modding Discord server. Feedback, suggestions, and bug reports are also welcome!
