> For the complete documentation index, see [llms.txt](https://wiki.redmodding.org/cyberpunk-2077-modding/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/archived-guides/switching-between-sector-states.md).

# Switching between sector states

{% hint style="info" %}
This page contains the theory of sector variants, for creating sectors with variants, head over to the [Creating Sector Variants](/cyberpunk-2077-modding/modding-guides/world-editing/object-spawner/features-and-guides/creating-sector-variants.md) guide
{% endhint %}

## Summary

**Published:** Jan 07 2025 by [Sergey](mailto:undefined)\
**Last documented edit:** Jan 08 2025 by [mana vortex](mailto:undefined)

This page will show you how to switch sector states.

### Wait, this is not what I want!

* To learn more about `.streamingsector` files, 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-.streamingsector](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-.streamingsector "mention")
* To learn about `.streamingblocks`, check [.streamingBlock: Sector definitions and -variants](/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/file-formats/the-whole-world-.streamingsector/.streamingblock-sector-definitions-and-variants.md)
* For a list of node types, check [Reference: .streamingsector node types](/cyberpunk-2077-modding/for-mod-creators-theory/references-lists-and-overviews/reference-world-sectors/reference-.streamingsector-node-types.md)
* check [World Editing](/cyberpunk-2077-modding/modding-guides/world-editing.md) -> [Archived: Merging World Additions via ArchiveXL](/cyberpunk-2077-modding/modding-guides/world-editing/archived-guides/adding-locations-and-structures-with-archivexl.md) if that's what you'd rather do

### World state variants

Here is an overview of file relations between `.streamingsector` and -`block`:

<figure><img src="/files/skKY1rXsPtlUyyPtrE8W" alt=""><figcaption></figcaption></figure>

### 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`).

{% hint style="info" %}
When creating a mod with sectors, you will need to create your own block that will list your new sectors.
{% endhint %}

<figure><img src="/files/MRhQgJSH89u2KCgfANeQ" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="/files/atzQ1IVhw0w7jOCdzJr8" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
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](http://discord.gg/redmodding) or update the wiki!
{% endhint %}

### Defining a new variant

In the [.streamingsector file](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-.streamingsector), add a new entry in each of these lists:

* [variantIndices](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-.streamingsector#variantindices)
* [variantNodes](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-.streamingsector#variantnodes)

## How to trigger a switch

To trigger a switch between sector states, you can use

* .questphase files
* [Codeware](https://github.com/psiberx/cp2077-codeware/wiki#controlling-prefabs-and-variants) via redscript/CET


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/archived-guides/switching-between-sector-states.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
