Getting Started

Acquire the Script

After purchasing the script through the sonoran store you may download the script through the keymaster account that purchased the script. Upon downloading extract the file to a safe place.

Install the Script

  1. Inside the script package you just extracted will be two folders. Copy both to a folder in your server's resources folder called [sonoranscripts] note the [] in the name, without them it will not work.

    Sonoran Software - Power Grid - Folders
  2. In the sonoran-powergrid folder are three files you must change and configure:

    1. config.CHANGEME.lua needs to be renamed to config.lua

    2. discord.CHANGEME.lua renamed to discord.lua

    3. And finally systems.CHANGEME.json renamed to systems.json.

Sonoran Software - Power Grid - Remove .CHANGEMEs
  1. You can open and edit the config.lua file to change the settings for the power grid script. You can also edit the discord.lua file to add discord webhook updates for when the state of the power grid changes. For more advanced users, you can add custom power grid stations in the systems.json file by following the template

  2. Finally, in your server.cfg add the following:

Configuring the Script

Default config.lua
Default discord.lua

Setting Up Permissions (Ace Permissions Only)

To use this script you must assign the permissions object to the groups which you would like to have permissions. You can find the objects needed in the config under Config.ace_perms section in the config. To assign these perms you must add the lines to your server.cfg or where ever you setup permissions on your server. You can learn more about Ace Permissions here.

Example:

System Location Config

You have two options for placing new systems:

  1. You can use the command /spawnnewsystem [prop] [name] to initiate spawning a new system and generate the relevant config data

    • After running this command you must pull out, aim, and shoot with a gun to confirm placement.

    • You may need to modify some of the rotation values manually to get that perfect placement you are looking for.

  2. You can manually copy and paste an existing config and then modify the values to meet your needs for the new system

systems.json Property Explanation

Property Name
Example
Notes

ID

2

ID must be unique. No other power system can share this ID

Prop

prop_powerbox

Valid values are prop_powerbox and prop_street_light_solar_panel

Position

This is a table that contains the x, y, and z coords of the power system

Rotation

This is a table that contains the x, y, and z rotation of the power system

Label

Test 1

This is a human readable label for the power system, can have spaces

Devices

This is an table of devices attached to the power grid

Commands

These are the default names of commands, they may have been modified by the server owner.

Command Name
Command Description
Required Permission

/spawnnewsystem [prop] [name]

This command will allow an admin to spawn a new power system using a gun placement system where the name argument is the label for the new power system and the prop argument is the text name of the model to use

Admin or as configured

/cancelsystemplacement

This command will cancel the current power system placement if one is currently in progress.

N/A

/showsystemids

This command will draw the ID of power systems which you are close to with 3D text near the base of the power system

N/A

/getpositiondata [system id]

This command will print the current positional data of the power system to the chat

Admin or as configured

/changesystemdata [system data] [position data type] [value]

This command will change the value which you specify of the power system you specify, run this command without arguments for example usage. All changes made with this command will be immediately saved

Admin or as configured

/reloadpowersystems

This command will completely reload the systems.json from the server's storage

Admin or as configured

/pslink [system id]

This command will allow the admin to link a power system to a different system using a system similar to the gun placement system

Admin or as configured

/cancelpslink

This command will cancel the current link in progress

N/A

Last updated

Was this helpful?