Switching between sector states
How to use streamingSectorPrefabVariant
This page contains the theory of sector variants, for creating sectors with variants, head over to the Creating Sector Variants guide
Summary
Published: Jan 07 2025 by Sergey Last documented edit: Jan 08 2025 by mana vortex
This page will show you how to switch sector states.
Wait, this is not what I want!
To learn more about
.streamingsectorfiles, check https://github.com/CDPR-Modding-Documentation/Cyberpunk-Modding-Docs/blob/main/for-mod-creators-theory/files-and-what-they-do/file-formats/the-whole-world-.streamingsectorTo learn about
.streamingblocks, check .streamingBlock: Sector definitions and -variantsFor a list of node types, check Reference: .streamingsector node types
check World Editing -> Archived: Merging World Additions via ArchiveXL if that's what you'd rather do
World state variants
Here is an overview of file relations between .streamingsector and -block:

Streamingblock
The game contains only 3 streamingblocks that gather more than 26300 sectors.
We will focus on the main one and take a look at the first sector inside (exterior_-18_3_-12_0).
When creating a mod with sectors, you will need to create your own block that will list your new sectors.

This sector has 10 variants, in this case, each one is related to a quest state.
numNodeRanges indicate the number of node ranges the sector contains; it always corresponds to the number of variant + sector's default range (so here 10 variants + 1 default).
When opening a variant definition, we can find the range index (to find the right range inside the sector file). rangeIndex cannot be 0, 0 is used as sector's default range.
Variant's name is only used to identify the variant within the streamingblock.

The link between quests and sectors' variants is not well-researched as of Jan 2024 - if you know anything more about this, please get in touch via Discord or update the wiki!
Defining a new variant
In the .streamingsector file, add a new entry in each of these lists:
How to trigger a switch
To trigger a switch between sector states, you can use
.questphase files
Codeware via redscript/CET
Last updated