The Docking Arm Generator System is inspired by the Gateway Generator system but instead of creating procedural dungeons, it spawns specific pre-made grid structures (docking arms) onto the current map when selected through a gateway interface.
Located at: Content.Server/Gateway/Components/DockingArmGeneratorComponent.cs
This component should be added to a station entity to enable docking arm generation.
Fields:
Proto(EntProtoId): The gateway entity to spawn (default: "Gateway")NextUnlock(TimeSpan): When the next docking arm option becomes availableUnlockCooldown(TimeSpan): Time between unlocks (default: 30 minutes)Generated(List): List of generated destination mapsDockingArmGrids(List): YAML file paths for docking arm structuresInitialCount(int): Number of docking arms to generate at start (default: 3)MaxSpawnDistance(int): Max distance from origin to spawn (default: 256)MinSpawnDistance(int): Min distance from origin to spawn (default: 64)
Located at: Content.Server/Gateway/Components/DockingArmDestinationComponent.cs
This component is automatically added to destination maps created by the generator.
Fields:
Generator(EntityUid): The generator that created this destinationLocked(bool): Whether this destination is locked/unavailableLoaded(bool): Whether the docking arm grid has been spawnedName(string): Display name of this docking armGridPath(string): Path to the YAML file for this docking armOrigin(Vector2i): Spawn coordinates for the gatewayDockingArmGrid(EntityUid?): The spawned docking arm grid entity
Located at: Content.Server/Gateway/Systems/DockingArmGeneratorSystem.cs
Key Methods:
GenerateDestination(): Creates a new docking arm destination with a gatewayOnDockingArmOpen(): Handles when a player selects a docking arm, spawning the gridSpawnDockingArmGrid(): Loads the docking arm grid from YAML onto the target map
-
Initialization: When a station with
DockingArmGeneratorComponentinitializes, it createsInitialCountdestination maps, each with:- A small landing pad (5x5 steel tiles)
- A gateway entity at the origin
- A randomly selected grid path from
DockingArmGrids
-
Selection: Players can interact with any gateway on the station to see available docking arm destinations
-
Spawning: When a player selects an unlocked docking arm destination:
- The gateway opens a portal to that destination map
- The system loads the docking arm grid from the YAML file
- The grid is spawned at a random distance (20-40 tiles) from the gateway origin
- The grid is placed on the same map as the source gateway (typically the station map)
- A new destination is generated to maintain available options
-
Cooldown: After selection, there's a cooldown before the next destination unlocks
- type: entity
id: MyStation
parent: BaseStation
components:
- type: DockingArmGenerator
unlockCooldown: 1800 # 30 minutes
initialCount: 3
dockingArmGrids:
- /Maps/Structures/docking_arm_alpha.yml
- /Maps/Structures/docking_arm_beta.yml
- /Maps/Structures/docking_arm_gamma.ymlDocking arm grids are standard grid YAML files. Create them using the map editor:
- Build your docking arm structure in the map editor
- Save as a grid (not a full map)
- Place the .yml file in
/Resources/Maps/ - Add the path to the
dockingArmGridslist
Recommended structure:
- Include airlocks for docking
- Add a small power supply or APCs
- Include basic facilities (cargo bay, medical, etc.)
- Keep it relatively small (suggested: 10x20 to 30x30 tiles)
| Feature | Gateway Generator | Docking Arm Generator |
|---|---|---|
| Content Type | Procedural dungeons on distant maps | Pre-made grids on station map |
| Biomes | Yes (planetary) | No |
| Grid Loading | Dungeon generation | YAML grid loading |
| Spawn Location | Separate map | Same map as station |
| Mobs/Loot | Biome marker layers | Whatever is in the YAML |
| Use Case | Exploration/adventure | Station expansion |
The system integrates with the existing Gateway UI and portal mechanics:
- UI Detection: The gateway UI checks for
DockingArmDestinationComponentand displays "Spawn Docking Arm" instead of "Open Portal" - Message Handling: Uses
GatewaySpawnDockingArmMessagefor client-server communication - Event System:
AttemptGatewayOpenEvent: Validates access and unlock statusGatewayOpenEvent: Triggers grid spawning viaDockingArmGeneratorSystem
- UI Updates:
GatewaySystem.UpdateAllGateways()refreshes available destinations
- Regular destinations: Show "Open Portal" button (toggle mode, creates temporary portals)
- Docking arm destinations: Show "Spawn Docking Arm" button (one-time spawn, permanent)
- Locked destinations: Docking arm destinations still show the spawn button even when locked (regular destinations hide the portal button when locked)
- Already spawned: Button is disabled if
Loadedis true to prevent duplicates
gateway-window-spawn-docking-arm = Spawn Docking Arm
gateway-docking-arm-already-spawned = Docking arm already spawned!
gateway-docking-arm-spawn-failed = Failed to spawn docking arm!
gateway-docking-arm-spawned = Docking arm spawned successfully!- The system uses
MapLoaderSystem.TryLoadGrid()to spawn grids - Grids are spawned with a position offset from the gateway origin
- The destination map is separate from the spawned grid's final location
- Names can be customized via the
names_borerdataset prototype - The system respects the
GatewayGeneratorEnabledCVar
Potential improvements:
- Cost/resource requirements for spawning
- Per-grid unlock requirements
- Custom spawn positioning logic
- Integration with construction/engineering
- Admin tools for manual spawning
- Grid rotation options