Getting Started
Last updated
Last updated
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.
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.
In the sonoran-powergrid
folder are three files you must change and configure:
config.CHANGEME.lua
needs to be renamed to config.lua
discord.CHANGEME.lua
renamed to discord.lua
And finally systems.CHANGEME.json
renamed to systems.json
.
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
Finally, in your server.cfg
add the following:
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.
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:
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 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.
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 ExplanationThese are the default names of commands, they may have been modified by the server owner.
Property Name | Example | Notes |
---|---|---|
Command Name | Command Description | Required Permission |
---|---|---|
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
/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