-
Notifications
You must be signed in to change notification settings - Fork 0
SectorGenerator.js
The top level Script for generating an entire Sector down to its smallest details.
!NewSector <grid size> (GM only)
Randomly generates a blob of stars on a grid, displays the result in the Damage Catcher character sheet, and stores the data for use later. The reason it is not used right away is that you may not like the shape of the sector that is generated, and it would take far too long to generate every detail of the sector for you to only reject it. Just keep using this command until you see blobs that you like.
This API Command is the point where randomly generated warp routes are made. In truth, the API Command created random connections between nearby stars, it then found the largest interconnected blob of stars and deleted any star that could not be reach. This means that players will eventually be able to travel to any star that is on the grid. Nothing that exists is fully disconnected from anything else that exists.
Note that editing the picture within Damage Catcher, will not modify the data within mySector.Grid;
!ShowSector <map name> (GM only)
Takes the data inside mySector.Grid to do the following the specified Roll20 page (if no page is specified, it will default to "Sector Map".
- Resize the map to fit the grid size
- Place a token of a star at each filled point in the grid. (The image of the star must come from your personal library, please pick an image for a star and paste the link to that image in this Script)
- The token is placed in the objects layer.
- Push the star in a random direction and rotate it randomly to give the overall sector a more natural look.
- Randomly generate the warp route length and stability for each connection within
mySector.Gridand store that information in the star's gmnotes. - Places images of the warp routes in the gmlayer (so that players do not know which stars connect to other stars until they have explored those warp routes).
Note that this API Command does not detail any information for the Systems placed on the map. It only creates stars along the grid and generates Warp Routes between them.
!NewSystem <sector type> (GM only)
Utilizes SystemGenerator.js to randomly generate a character sheet for each selected star.
It then uses the information generated to color, resize, and change the picture of the star, along with adding additional stars that may be in that system. However, the additional stars are placed on the map layer.
It names the token the same as the character sheet and sets the token to represent the charactersheet, this way players can shift double click the system to see the system details, without having to search for the name.
!UpdateConnections (GM only)
Updates the warp routes of the selected tokens into their respective character sheets. This update includes adds links to the character sheets of the star system that the selected token is connected to. This allows the GM to simply use the links to view the star systems that are connected instead of having to search for them.