Supported Games
Features
- Allows any electrical entity to generate a configurable amount of power
- Allows making entities effectively powerless by generating exactly the power they require (e.g., 3 for Electric Heaters)
- Allows making entities function as test generators by generating more power than they need (e.g., 1000 for Splitters)
- Optionally only applies to entities deployed by players with permissions, configurable per entity type
- Designed to work with circuits, so inputs with a wire in them are ignored
Note: This plugin does not allow altering power consumption itself, nor does it allow altering power generation of vanilla generators such as solar panels.
Installation
- Add the plugin to the
oxide/pluginsdirectory of your Rust server installation - Update the plugin configuration to determine how much free power each entity type should get and whether permissions should be required
- Grant permissions if applicable from the previous step (see Permissions section)
- Reload the plugin
If you configured the plugin correctly, then:
- Existing entities that were not plugged in will automatically be provided with the power amount you configured
- Existing entities that were plugged in will be unaffected initially, but disconnecting the input wires will immediately cause those entities to generate the power amount you configured
- Entities deployed later will automatically be provided the power amount you configured
Troubleshooting
- After granting permissions or roles, you will need to reload the plugin to automatically power existing entities
- Make sure you grant permissions for each entity that you configured with
"Require permission": true(off by default) - Make sure that the amount of power you configured for each entity is at least the power requirement, or there will be no effect
- The configuration section below lists the power requirement for most entities to help you configure the plugin for your use case
Permissions
Note: Permissions are only necessary if the corresponding entity's configuration has specified "Require permission": true. The default is false for all entities.
powerlesselectronics.all-- All electrical entities deployed by players with this permission will have free power determined by the plugin configuration. You must also configure the power amount for each entity for this to have any effect.
As an alternative to the all permission, you can grant permissions by entity type. These are automatically generated from the plugin configuration.
powerlesselectronics.andswitchpowerlesselectronics.audioalarmpowerlesselectronics.autoturretpowerlesselectronics.blockerpowerlesselectronics.boomboxpowerlesselectronics.branchpowerlesselectronics.bulbstringlightspowerlesselectronics.buttonpowerlesselectronics.cctvpowerlesselectronics.ceilinglightpowerlesselectronics.chandelierpowerlesselectronics.combinerpowerlesselectronics.counterpowerlesselectronics.digitalclockpowerlesselectronics.discoballpowerlesselectronics.discofloor.largetilespowerlesselectronics.discofloorpowerlesselectronics.doorcontrollerpowerlesselectronics.electricfurnace.iopowerlesselectronics.elevatorioentitypowerlesselectronics.fairylightspowerlesselectronics.flasherlightpowerlesselectronics.fluidswitchpowerlesselectronics.fluorescentlight.ceilingpowerlesselectronics.fluorescentlightpowerlesselectronics.fridgepowerlesselectronics.hbhfsensorpowerlesselectronics.heaterpowerlesselectronics.hopperpowerlesselectronics.igniterpowerlesselectronics.industrial.wall.lamp.bluepowerlesselectronics.industrial.wall.lamp.greenpowerlesselectronics.industrial.wall.lamp.redpowerlesselectronics.industrial.wall.lamppowerlesselectronics.industrialconveyorpowerlesselectronics.industrialcrafterpowerlesselectronics.large.rechargable.batterypowerlesselectronics.laserdetectorpowerlesselectronics.laserlightpowerlesselectronics.lightupframe.ioent.largepowerlesselectronics.lightupframe.ioent.mediumpowerlesselectronics.lightupframe.ioent.smallpowerlesselectronics.lightupframe.ioent.standingpowerlesselectronics.lightupframe.ioent.xlpowerlesselectronics.lightupframe.ioent.xxlpowerlesselectronics.medium.rechargable.batterypowerlesselectronics.memorycellpowerlesselectronics.microphonestandiopowerlesselectronics.minifridgepowerlesselectronics.neonsigntrpowerlesselectronics.modularcarliftpowerlesselectronics.orswitchpowerlesselectronics.paintable_reactive_targetpowerlesselectronics.poweredwaterpurifierpowerlesselectronics.pressurepadpowerlesselectronics.ptz_cctvpowerlesselectronics.random.switchpowerlesselectronics.reactivetargetpowerlesselectronics.rfbroadcasterpowerlesselectronics.rfreceiverpowerlesselectronics.sam_site_turretpowerlesselectronics.sculpture.icepowerlesselectronics.searchlightpowerlesselectronics.seismicsensorpowerlesselectronics.sign.neon.125x125powerlesselectronics.sign.neon.125x215.animatedpowerlesselectronics.sign.neon.125x215powerlesselectronics.sign.neon.xl.animatedpowerlesselectronics.sign.neon.xlpowerlesselectronics.simplelightpowerlesselectronics.sirenlightpowerlesselectronics.smallrechargablebatterypowerlesselectronics.smartalarmpowerlesselectronics.smartswitchpowerlesselectronics.splitterpowerlesselectronics.spotlight.tripodpowerlesselectronics.spotlightpowerlesselectronics.storageadaptor.deployedpowerlesselectronics.storagemonitorpowerlesselectronics.switchpowerlesselectronics.tablelamppowerlesselectronics.telephonepowerlesselectronics.teslacoilpowerlesselectronics.timerpowerlesselectronics.vendingmachinepowerlesselectronics.wallcabinetpowerlesselectronics.water.pumppowerlesselectronics.weaponracklightpowerlesselectronics.weaponracklightdoublepowerlesselectronics.xmas.advanced.lightspowerlesselectronics.xorswitch
Configuration
Default configuration (no entities provide free power):
{
"Add switch to powerless auto turrets": false,
"Add switch to powerless SAM sites": false,
"Entities": {
"andswitch.entity": {
"Require permission": false,
"Input slots": [
0,
1
],
"Generate power amounts": [
0,
0
]
},
"audioalarm": {
"Require permission": false,
"Generate power amount": 0
},
"autoturret_deployed": {
"Require permission": false,
"Generate power amount": 0
},
"boombox.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"button": {
"Require permission": false,
"Generate power amount": 0
},
"cctv_deployed": {
"Require permission": false,
"Generate power amount": 0
},
"ceilinglight.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"counter": {
"Require permission": false,
"Generate power amount": 0
},
"discoball.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"discofloor.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"discofloor.largetiles.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"doorcontroller.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.bulbstringlights.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.chandelier.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.digitalclock.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.fairylights.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.flasherlight.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.fluorescentlight.ceiling.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.fluorescentlight.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.seismicsensor.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.sirenlight.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.spotlight.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.spotlight.tripod.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.tablelamp.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electric.wallcabinet.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electrical.blocker.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electrical.branch.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electrical.combiner.deployed": {
"Require permission": false,
"Input slots": [
0,
1
],
"Generate power amounts": [
0,
0
]
},
"electrical.heater": {
"Require permission": false,
"Generate power amount": 0
},
"electrical.memorycell.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electrical.modularcarlift.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electrical.random.switch.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"electricfurnace.io": {
"Require permission": false,
"Generate power amount": 0
},
"elevator": {
"Require permission": false,
"Input slots": [
2
],
"Generate power amount": 0
},
"fluidswitch": {
"Require permission": false,
"Input slots": [
2
],
"Generate power amount": 0
},
"fridge.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"hbhfsensor.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"hopper.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"igniter.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"industrial.wall.lamp.blue.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"industrial.wall.lamp.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"industrial.wall.lamp.green.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"industrial.wall.lamp.red.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"industrialconveyor.deployed": {
"Require permission": false,
"Input slots": [
1
],
"Generate power amount": 0
},
"industrialcrafter.deployed": {
"Require permission": false,
"Input slots": [
1
],
"Generate power amount": 0
},
"large.rechargable.battery.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"laserdetector": {
"Require permission": false,
"Generate power amount": 0
},
"laserlight.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"lightupframe.ioent.large": {
"Require permission": false,
"Generate power amount": 0
},
"lightupframe.ioent.medium": {
"Require permission": false,
"Generate power amount": 0
},
"lightupframe.ioent.small": {
"Require permission": false,
"Generate power amount": 0
},
"lightupframe.ioent.standing": {
"Require permission": false,
"Generate power amount": 0
},
"lightupframe.ioent.xl": {
"Require permission": false,
"Generate power amount": 0
},
"lightupframe.ioent.xxl": {
"Require permission": false,
"Generate power amount": 0
},
"medium.rechargable.battery.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"microphonestandio.entity": {
"Require permission": false,
"Generate power amount": 0
},
"minifridge.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"neonsigntr.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"orswitch.entity": {
"Require permission": false,
"Input slots": [
0,
1
],
"Generate power amounts": [
0,
0
]
},
"paintable_reactive_target.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"poweredwaterpurifier.deployed": {
"Require permission": false,
"Input slots": [
1
],
"Generate power amount": 0
},
"pressurepad.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"ptz_cctv_deployed": {
"Require permission": false,
"Generate power amount": 0
},
"reactivetarget_deployed": {
"Require permission": false,
"Generate power amount": 0
},
"rfbroadcaster": {
"Require permission": false,
"Generate power amount": 0
},
"rfreceiver": {
"Require permission": false,
"Generate power amount": 0
},
"sam_site_turret_deployed": {
"Require permission": false,
"Generate power amount": 0
},
"sculpture.ice.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"searchlight.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"sign.neon.125x125": {
"Require permission": false,
"Generate power amount": 0
},
"sign.neon.125x215": {
"Require permission": false,
"Generate power amount": 0
},
"sign.neon.125x215.animated": {
"Require permission": false,
"Generate power amount": 0
},
"sign.neon.xl": {
"Require permission": false,
"Generate power amount": 0
},
"sign.neon.xl.animated": {
"Require permission": false,
"Generate power amount": 0
},
"simplelight": {
"Require permission": false,
"Generate power amount": 0
},
"smallrechargablebattery.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"smartalarm": {
"Require permission": false,
"Generate power amount": 0
},
"smartswitch": {
"Require permission": false,
"Generate power amount": 0
},
"splitter": {
"Require permission": false,
"Generate power amount": 0
},
"storageadaptor.deployed": {
"Require permission": false,
"Input slots": [
1
],
"Generate power amount": 0
},
"storagemonitor.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"switch": {
"Require permission": false,
"Generate power amount": 0
},
"telephone.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"teslacoil.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"timer": {
"Require permission": false,
"Generate power amount": 0
},
"vendingmachine.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"water.pump.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"weaponracklight": {
"Require permission": false,
"Generate power amount": 0
},
"weaponracklightdouble": {
"Require permission": false,
"Generate power amount": 0
},
"xmas.advanced.lights.deployed": {
"Require permission": false,
"Generate power amount": 0
},
"xorswitch.entity": {
"Require permission": false,
"Input slots": [
0,
1
],
"Generate power amounts": [
0,
0
]
}
}
}
Add switch to powerless auto turrets(trueorfalse) -- Whiletrue, a switch will be added to auto turrets that are configured to generate their own power, allowing players to turn the turret on or off. Note that the switch will be temporarily hidden while the turret has a wire connected to its power input.Add switch to powerless SAM sites(trueorfalse) -- Whiletrue, a switch will be added to SAM sites that are configured to generate their own power, allowing players to turn the SAM site on or off. Note that the switch will be temporarily hidden while the SAM site has a wire connected to its power input.
Each entity type has the following configuration options, mapped in the config to the entity's prefab short name.
Require permission(trueorfalse) -- Whiletrue, only entities of this type that were deployed by players with the corresponding permission will receive the power configured here. Whilefalse, all entities of this type will have the power configured here.Generate power amount-- Amount of power to provide to each input where a wire is missing.Generate power amounts-- List of power amounts, applicable when the entity has multiple power inputs. You can also use theGenerate power amount(singular) option to apply the same amount to all inputs.Input slots(Advanced) -- You should only need to configure this option if you want to provide free power for an entity that is not yet in the plugin's default configuration, such as when new items are introduced to the game. This option controls which internal slot numbers to assign power to. Most entities only have one power input which is usually at slot0, but some have multiple or use different numbers due to also having water inputs.
Note: This plugin ignores any input slot which is configured with 0 power, so it will not interfere with other plugins that provide powerless functionality. The only gotcha is that if you provided free power to an entity via this plugin and then changed the configuration to provide 0 power, the entity will have free power until a wire is connected to that input, or until the next server restart.
Entity power requirements
To help you configure the plugin for your use case, the minimum amount of useful power for each entity is listed below. These may be a little higher than the power requirement since some entities are effectively useless without providing extra power for the outputs. I have added a for entities where adding more power provides a useful function besides simple passthrough.
andswitch.entity: 2 , 2audioalarm: 1autoturret_deployed: 10boombox.deployed: 1button: 2cctv_deployed: 3ceilinglight.deployed: 2counter: 1discoball.deployed: 1discofloor.deployed: 1discofloor.largetiles.deployed: 1doorcontroller.deployed: 1electric.bulbstringlights.deployed: 5electric.chandelier.deployed: 4electric.digitalclock.deployed: 1electric.fairylights.deployed: 5electric.flasherlight.deployed: 1electric.fluorescentlight.ceiling.deployed: 2electric.fluorescentlight.deployed: 1electric.seismicsensor.deployed: 1electric.sirenlight.deployed: 1electric.spotlight.deployed: 5electric.spotlight.tripod.deployed: 5electric.tablelamp.deployed: 1electric.wallcabinet.deployed: 1electrical.blocker.deployed: 2electrical.branch.deployed: 4electrical.combiner.deployed: 1 , 1electrical.heater: 3electrical.memorycell.deployed: 1electrical.modularcarlift.deployed: 5electrical.random.switch.deployed: 2electricfurnace.io: 3elevator: 5fluidswitch: 1fridge.deployed: 5hbhfsensor.deployed: 2hopper: 8igniter.deployed: 2industrial.wall.lamp.blue.deployed: 1industrial.wall.lamp.deployed: 1industrial.wall.lamp.green.deployed: 1industrial.wall.lamp.red.deployed: 1industrialconveyor.deployed: 1industrialcrafter.deployed: 1laserdetector: 2laserlight.deployed: 1lightupframe.ioent.large: 1lightupframe.ioent.medium: 1lightupframe.ioent.small: 1lightupframe.ioent.standing: 1lightupframe.ioent.xl: 1lightupframe.ioent.xxl: 1microphonestandio: 1minifridge.deployed: 2neonsigntr: 1orswitch.entity: 2 , 2paintable_reactive_target.deployed: 2poweredwaterpurifier.deployed: 5pressurepad.deployed: 2ptz_cctv_deployed: 3reactivetarget_deployed: 2rfbroadcaster: 1rfreceiver: 2sam_site_turret_deployed: 25sculpture.ice.deployed: 1searchlight.deployed: 10sign.neon.125x125: 4sign.neon.125x215.animated: 10sign.neon.125x215: 6sign.neon.xl.animated: 15sign.neon.xl: 8simplelight: 1smartalarm: 1smartswitch: 2splitter: 4storagemonitor.deployed: 1storageadaptor.deployed: 1switch: 2telephone.deployed: 1teslacoil.deployed: 1-35timer: 2vendingmachine.deployed: 5water.pump.deployed: 5weaponracklight: 1weaponracklightdouble: 1xmas.advanced.lights.deployed: 5xorswitch.entity: 1
FAQ
Q: Why would I provide free power to a branch or splitter?
A: To allow them to function as essentially a test generator with multiple outputs. Very useful.
Q: Why would I provide free power to an AND switch?
A: So it can be used to boost the low power output of a HBHF sensor since it only outputs 1 power per detected player.
For example, if you want to chain multiple HBHF sensors together using OR switches, the OR switches will consume all the power that the HBHF sensors are sending, rendering them effectively useless. To mitigate this, you can boost the power output of each HBHF sensor by sending its output through an AND switch that has additional power in the other input, which you can get for free with this plugin (no generator needed).
Q: Why would I provide free power to a smart alarm?
A: To simplify some valid circuit designs.
For example, in vanilla, you may design a circuit where the destruction of a wall or floor triggers the smart alarm, using the following wiring.
Power generator -> Electrical Branch (attached to a wall) -> Blocker ("Block Passthrough" input) -> Smart alarm
When the wall that the electrical branch is attached to is destroyed, power will resume flowing through the blocker to trigger the smart alarm. With free power to the smart alarm, you can simply place something like a switch or button on the wall, connect it to the smart alarm, and leave it always off. When that entity is destroyed with the wall, the wire will disconnect, allowing the smart alarm to start generating its own power and trigger a notification.
Developer Hooks
Parented entities are already ignored by this plugin, so plugin conflicts are unlikely. Plugins can also block this plugin's update via the OnInputUpdate hook, but the OnPowerlessInputUpdate hook below can also be used for more granular control if needed.
OnPowerlessInputUpdate
object OnPowerlessInputUpdate(IOEntity ioEntity, int inputSlot, int powerAmount)
- Called when this plugin is about to provide power for a particular entity's empty input slot
- Returning
falsewill prevent this plugin from affecting the entity - Returning
nullwill result in the default behavior
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

