Add Components

Raphtalia 2024-07-26 10:08:30 +00:00
parent 5dfc9e18a8
commit 1d9b659f5c
1 changed files with 45 additions and 0 deletions

45
Components.md Normal file

@ -0,0 +1,45 @@
## Main Room Doorway Groups
Works in conjunction with `DunGenExtender's` Main Path feature. This allows for more control in which doorways are selected for the alternate main paths. If you wish to use this component, it must be attached the `MainRoomTilePrefab`.
`DoorwayLists` contains a list of grouped doorways. `Name` is for organizing purposes and has no effect on the dungeon generation. When a doorway is selected for a main path and IF the `MainRoomDoorwayGroups` exists anywhere in the `MainRoomTilePrefab`, the dungeon generation will find that doorway's corresponding group in the component's `DoorwayLists`. It will then mark every doorway in that group invalid for the other main paths. This is reverted once all main paths finish generating and it begins the branch path generation.
> **NOTE:** You may want to use this component to split the main paths between floors for example. Or perhaps one main path in the left side of the main room and the other main path in the right side. However you like it.
## Doorway Sisters
Works in conjunction with `DunGenExtender's` Doorway Sisters feature. The `UseDoorwaySisters` toggle in the Extender MUST be on for this component to do anything. This prevents an intersecting doorway from generating into an actual doorway IF it's sister doorway has already generated AND both of these doorways lead to the intersecting, neighbor tile. Read here for more information.
`Sisters` contains a list of the sister doorways. This should be self-explanatory.
> **NOTE:** This feature is probably not necessary for your interior. My interior was designed to pack my tiles very closely and for their doorways to have a high chance of intersecting. As such, my interior developed the issue of having too many unnecessary doorways and required this feature to fix it. Most interiors won't have this same issue.
## Doorway Cleanup
Allows for more control on the appearance of a doorway based on a set of preset factors. This script does not by itself. It instead acts as the script that starts the command chain and to store centralized data for the commands. Below are the commands.
`Doorway` is the reference to the doorway component. Mandatory.
`Connectors` and `Blockers` are the doorway component's `Connector Scene Objects` and `Blocker Scene Objects` list of GameObjects. `DoorwayCleanup` will perform the same actions that `Doorway` does for it's scene objects. As such, you must empty the doorway's scene object lists if you wish to use this component.
`DoorwayGameObject` is a target for some of the commands. It can be null.
The override commands are meant for more advanced coding purposes. You can pretty much ignore these unless you want to do some more logic.
> **NOTE:** These set of components is probably not necessary for your interior. I used these components so my doorways could have more diversity in their appearances.
#### DCS Connector Blocker Spawned Prefab
Switches to either the Connector or Blocker scene objects IF the doorway spawned any Connector or Blocker prefab that contains the `Target's` name.
#### DCS Remove Doorway Spawned Prefab
Deletes the `DoorwayGameObject` IF the doorway spawned any Connector or Blocker prefab that contains the `Target's` name.
#### DCS Remove Doorway Connected Doorway
Deletes the `DoorwayGameObject` IF the neighboring doorway's priority matches the operation comparison.
#### DCS Remove GameObjects Connected Doorway
Deletes the GameObjects from the list of `Targets` IF the neighboring doorway's priority matches the operation comparison.
## Spawn Synced Object Cycle
Works in conjunction with a `SpawnSyncedObject` component. This allows you create a single prefab that will automatically cycle through a set of networked GameObjects of similar functionality/purpose.
When the dungeon generation finishes but before the networked GameObjects of `SpawnSyncedObject` are spawned, a random cycle number is selected for each `Id`. Then each `SpawnSyncedObjectCycle` component will be called one-by-one. Each will grab an item from the `Props` list based on their cycle number, replace the `SpawnPrefab` in their referenced `SpawnSyncedObject` component, then advance the cycle number by 1.
> **NOTE:** This component is probably not necessary for your interior. I used this component to guarantee that each of my portraits would spawn at least once. Cause I thought it would be cool.