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
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 In the
sonoran-powergridfolder are three files you must change and configure:config.CHANGEME.luaneeds to be renamed toconfig.luadiscord.CHANGEME.luarenamed todiscord.luaAnd finally
systems.CHANGEME.jsonrenamed tosystems.json.

You can open and edit the
config.luafile to change the settings for the power grid script. You can also edit thediscord.luafile 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 thesystems.jsonfile by following the templateFinally, in your
server.cfgadd the following:
ensure sonoran-powergrid
add_ace resource.sonoran-powergrid command allow
add_ace resource.sonoran-powergrid_helper command allowConfiguring the Script
This script utilizes two separate Lua configs. This is for security reasons. Having a separate config for your Discord Configuration keeps them server side only and safer from malicious clients.
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:
add_ace group.admin sonoran.powersystems allow
add_ace group.leo sonoran.police allow
add_ace group.hacker sonoran.hacker allow
add_ace group.moderator sonoran.repairman allowSystem Location Config
You have two options for placing new systems:
You can use the command
/spawnnewsystem [prop] [name]to initiate spawning a new system and generate the relevant config dataAfter 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.
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
systems.json Property ExplanationID
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.
/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?