Jump to content

1 Screenshot

About Lights On

Automate devices and light sources to turn on and off depending on the time of day and toggle them from anywhere using the provided chat and console commands. You can also configure lights to consume no fuel when on, and each type is easily configurable in the config file.


Permissions

lightson.allowed

Granting that to a group or player allows them to toggle the lights for the entire server (Admin level). Example:

o.grant group admin lightson.allowed



Console Commands

lights on - Turn on specified lights (either all for all entities or a specific name)

lights off - Turn off specified lights (either all for all entities or a specific name)

lights check - Check the lights after reloading the config to allow changes without reload

There is a second parameter where you can specify a portion of the light source short name to force all of them to the on or off state, ignoring the config. Example:

lights on fireplace -- Turn on all fireplaces regardless of the config settings



Chat Commands

/lights on - Turn on specified lights (either all for all entities or a specific name)

/lights off - Turn off specified lights (either all for all entities or a specific name)

/lights check - check the lights after reloading the config to allow changes without reload

There is a second parameter where you can specify a portion of the light source short name to force all of them to the on or off state, ignoring the config. Example:

/lights check candle -- Turn on all candles if the the flag is appropriate for the time of day



Configuration

The settings and options for this plugin can be configured in the LightsOn.json file under the oxide/config directory. The use of a JSON editor or validation site such as jsonlint.com is recommended to avoid formatting issues and syntax errors. Console Output set to false will stop messages (other than errors and night toggles) from logging in to the console.

These can be set in the JSON, which lets you determine what is turned off and on automatically:

  • BBQs
  • BoomBoxes (deployed and portable)
  • Campfires
  • Candles
  • Cauldrons
  • Ceiling Lights
  • CCTVs
  • Deluxe Christmas Lights
  • Electric Furnace (not for processing, just lights, can instantly cook [to be consistent with other furnaces])
  • Fire Pits
  • Fireplaces
  • Flasher Lights
  • Fluid Splitters
  • Fog Machines
  • Furnaces
  • Hobo Barrels
  • Heaters
  • Igniters
  • Industrial Combiners (processing, not just lights on)
  • Industrial Conveyors (processing, not just lights on)
  • Industrial Crafters (processing, not just lights on)
  • Industrial Splitters (processing, not just lights on)
  • Industrial Lights (Lamps)
  • Lanterns (which include Chinese Lanterns, Tuna Can Lamps, Lanterns, and Jack'O Lanterns, and Torch Holders)
  • Laser Detectors
  • Laser Lights
  • Mining Quarries
  • Mixing Tables
  • Neon Signs
  • Pump Jacks
  • Reactive Targets
  • Refineries
  • RF Broadcasters
  • RF Receivers
  • Searchlights
  • Simple Lights
  • Siren Lights
  • Smart Alarm
  • Smart Switch
  • Snow Machine
  • Spooky Speakers
  • Storage Alarms
  • Strobe Lights
  • Telephones
  • Vehicle Lifts
  • Water Pumps
  • Water Purifiers
  • Weapon Racks
  • Electric Water Purifiers

Valid values are a - always on, d - on during the day only, n - on during the night only, i - do not process this entity.

To avoid automatically turning off active processing, there is protection you can set to true for the following:

  • BBQs
  • Campfires
  • Cauldrons
  • Fire Pits
  • Fireplaces
  • Furnaces (including electric ones)
  • Hobo Barrels
  • Mixing Tables
  • Refineries


If there is anything inside these (including fuel), they will not have their state changed.  You can still force them off by the name. For example:

/lights off furnace


Additional control parameters:

  • Console Output
  • Check Frequency (10-600)
  • Dusk Time (0-24)
  • Dawn Time (0-24)
  • Use Zone Manager Plugin
  • Boom boxes On (to toggle them to play)


Notes

Exciting New Feature: Now, with optional instant cooking, fuel can be optional.  New configuration for instant cooking, optional fuel. Simple toggle on, and it will instantly cook the contents. The most over-powered cooking in Rust. If you use this feature, you do not need to set Protection to true, as it will not be needed. Note: Instant cooking does not work with Industrial equipment.  Please cook (instantly) and put the materials in a box as the source of ingredients.

New Feature: Players can toggle on/off any light that is not electric based if it is empty. Useful for cave bases and emergency lighting. Note: if the item is set to ignore, you can't do this.  Note: the timed process will turn it back on/off the next time it runs. Quick Hack for players to note: placing any items in an "oven" with protections set to true will prevent the light source from being toggled by the plugin.  So you could turn on/off an oven and then place a single stone (for example), and it will stay in that state. Note Ovens include all furnaces, cauldrons, BBQ, campfire, fireplace, fire pits, oil refineries, and hobo barrels. Operators, please note the protection flag now has two uses. Hopefully, this is acceptable.

A big thank you to Wulf and k1lly0u for their awesome lights plugins. If you need fine-grained control of lights, they are both superior options. If you want fuel use for lighting, then AutoFuel is an awesome choice. My understanding of lights came directly from reading these plugins, and they inspired me to make this low load and slightly more inclusive of entities plugin. If it generates lights or effects, I tried to include it. I include a lot of non-light devices (Water Pumps, Fog Machine, Snow Machine, Spooky Speakers, Strobe Lights) to allow operators to have fun with players.

I am open to suggestions to improve this plugin as long as it does not hurt performance.  I use it on my PVE server, and it has a lot of lights.  By using "always on" the load of the lights is light on the server.  It can still be brutal on the client due to the graphics load.  Night Toggle (turning the lights on and off is reasonably efficient, but can spike server load).  It is nice for role-playing, but use "always on" if you want the best server-side performance.

This plugin is not designed to support user-level permissions.  The only permission is for admin access.  This is to minimize the overhead for efficient processing.  There are alternative plugins with permissions if you want it as a VIP perk. Please do not ask for player permissions. It will not be added.

If the server lights are on (either via "always on" or the night toggle is on) and you place a light source you have selected to be on, it is turned on when placed. This avoids having to periodically turn the lights on to catch newly placed lights.

This alters fuel requirements to zero through the methods it is using to toggle the lights, since you are removing player agency around fuel usage. Note: Furnaces etc., turned on will not process their contents. Just look active and produce light. You are giving free light, but not free processing (unless you activate InstaCook). Simply turn them off and back on for normal processing. It is important to let players know this, as they may initially be confused or frustrated.

Since this plugin is toggling animation flag states (where ever possible), it allows things like hobo barrels to light up with no fuel in them. It does some "hacky" flag settings to avoid needing fuel in other light sources. It is not elegant, but efficient.

If you want free fuel, NoFuelRequirements or AutoFuel are good solutions, this plugin tries to avoid altering the fuel level in entities other than hats and jack o lanterns. I only add fuel where the toggle of animation state trick is not working in that use case.  It is best to set any item being processed by another plugin to ignore to avoid conflicts. Hats and Jack O Lanterns usually require at least one fuel in them to allow players to toggle them. Toggling Lanterns (which includes Jack O Lanterns) with the commands do not need fuel.

If you are using the commands to turn a light source on, and it is already on, it is not altered. If you are turning a light source off with the commands, and it is already off, it is not altered. Toggling lights on should not mess up processing content, as their state is not changed. It will mess up processing if you toggle off and then back on for an entity that processes things (grills, furnaces, refineries, campfires, fire pits, and fireplaces). Since I added the Night Toggle feature, I also added Protection for light sources that also process contents. I would recommend you leave these to true. Doing so will not turn these off when dawn happens. That is, to avoid annoying players by interrupting their processing. The side effect is they will always appear if they are set to automatically turn on in the configuration.

Choose carefully what you will configure to be controlled if you plan to use the off command or Night Toggle. If you are going to use the off command, I recommend you do not include Furnaces, Grills, or Refineries, as it will stop processing if they are in legitimate use. If folks tend to cook in campfires, fire pits, and fireplaces, you may want to skip them as well if you plan to use the off command. Honest, I normally just turn items not normally used to do processing on and leave them on, as it has the smallest server load and will not annoy players. It is important to consider the consequences of turning things off or toggling them on and off.

Check Frequency controls how often the plugin checks for the night or to toggle the lights in seconds. It has a relatively small load unless there are lights to process. If you want the lights on at a very precise time, then a lower number (more frequent check) will help increase the accuracy.

I like to light up all the hobo barrels on the map to give a nice effect. That is why I originally wrote this. It should cover all light sources, please let me know if any are missing. I will do my best to ensure this keeps functioning as entities keep changing.

The light source name tries to match, so "a" would match all light sources with "a" in their name. Use "all" to force all lights server-wide regardless of the configuration setting.

Support for Zone manager via adding zones to \oxide\data\LightsOn-Zones.json Example:  

["supermarket_1","supermarket_2","gas_station_1","miningoutpost_1","miningoutpost_2","supermarket_3","gas_station_2","gas_station_3","miningoutpost_3","sphere_tank","launch_site"]

 

LightsOn.json

  • Like 7
  • Love 4

Mals's Collection

User Feedback

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.5k

Files Sold

Total number of files sold.

2.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.