Lethal Company

Details

Last Updated
4 weeks ago
First Uploaded
4 weeks ago
Downloads
15K
Likes
4
Size
78KB
Dependency string
Beaniebe-Beanie_Lib-1.0.2
Dependants

Beanie Libby Libnits

Beanie libnits is a very basic library with a small amount of useful scripts. If for any reason you ever wanted to use them in your own projects, they are listed below along with how to set them up. They can easily be connected to JLL scripts.

NOTE: SCRIPTS ARE NOT SYNCED! Please use a JLL client sync script for them!

My discord is Beaniebe if you have any questions or suggestions, always open to help!

Trigger Counter Explanation

Trigger Counter

The trigger counter script reads how many times it has been triggered, and upon reaching a certain threshold set by the user, invokes a unity event. Using the array, you can set up multiple thresholds per script, so you can count and invoke events based on multiple instances of reaching a number. This can be used in situations such as having 3 different buttons that need to be pressed to open a door. It also means you can have an interactive display that lights up depending on how many buttons have been pressed. Please note that if the button can be pressed multiple times, it would still count towards opening the door (even if the same one is pressed three times). You can add a whole array of integers in editor, allowing you to invoke different events when different counting numbers are reached.

Additionally, there is two events tied to the script that you can invoke. These are TurnOffCounter which disables the object from counting further, and ResetCounter which sets its counting back to zero. Additionally, there is a box for each of these if you want to trigger events when its turned off or reset.

EXAMPLES:

Having a configurable amount of buttons necessary to open a door, and having a light turn on to track the progress each time a button is hit.

Having to use something a configurable amount of times for the actual effect to trigger

Having something require several different criteria to activate

The below image is an example of how to set up the array. For integers 1 and 2, you would fill in what you want it to do (Play a sound, turn on a light, etc) meanwhile the third trigger could do something like activate a door animation. The final integer 3 trigger also activates the TurnOffCounter, which prevents it from counting up further.

image

Dynamic Tag-Based Texture Swapping Explanation

Dynamic Tag Texture Swapping

This script is relatively simple: Applying it on an object will bring up a list. In this list, for each entry you can set a material and then put in a corresponding LLL Moon tag. When a moon with this tag is present, the texture is automatically swapped to the corresponding material. This allows for interiors to easily swap visuals on a tag basis without having to copy entire rooms or models. Good for avoiding bloat in editor.

EXAMPLES:

Having a room change colors on a certain tag

Having rocks change color to match the biome the moon is in

Here is an example of how in deepcore mines, I use dynamic tags to swap textures. Each material is assigned a tag. The top material takes priority.

image

Signal Receiver and Signal Sender

Signal Receiver and Signal Sender

The signal sender and receiver are two very similar scripts that act as a whole. They are used to invoke unity events globally so long as the sender and receiver have a matching tag. To set up Signal Sender, give it a word in its Word ID text box. Then, when you want to send the message, activate it by using the Send Signal unity event. For the receiver, make sure its Word ID matches the Sender. When it receives the signal, it will preform whatever events are in its "OnSignalReceived" box. These scripts are sort of like a radio for invoking events. If you use a Signal Sender with the ID DoorOpen, and have three Signal Receivers tied to the ID Door Open, All three Receivers will invoke their OnSignalReceived events.

EXAMPLES:

Having a script tied to an interior communicate / activate something on a moon. (Like pulling a lever in the interior to unlock a door to a fire exit)

Having scripted objects in different interior tiles communicate with each other. (Like having a button in the main tile reveal a secret door in the apparatus tile)

Having two prefabs with scripts communicate with other things. (A randomly spawned prop that when pressed could set off a bunch of other randomly spawned props)

Custom Breaker Box

Custom Breaker

The custom breaker is a modified breaker box script that must be placed onto a breaker prefab, connected, and then the original breaker box script must be removed. This one is a little strange to set up, so I'd just recommend direct messaging me on discord about it. (My discord is Beaniebe)

If you would like to learn more, it is identical to a normal breaker except for the fact that the breaker invokes a unity event when it turns on or off, and the amount of levers initially turned off are set by the user via a variable, rather than being randomized on or off entirely. It also does not mess with the interiors power at all.

EXAMPLES:

Having a special breaker box that turns on/off power for only one room

Using a breaker box to activate things like any other interact trigger (buttons, levers, etc)

Credits

Thank you to Jacob and Xu Xiaolan for helping to review the scripts!

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