# How to use worldCommunityRegistry and worldCompiledCommunity

{% hint style="warning" %}
This guide explains the theory on how to setup communties, and how they tie into quests

For actually creating communities, it is recommended to instead follow the [communities with Object Spawner guide](/cyberpunk-2077-modding/modding-guides/world-editing/ai-and-npcs/creating-communities.md)
{% endhint %}

## Summary

**Published:** Nov 10 by [Sergey](mailto:undefined)\
Last documented update: Dec 4 by [Sergey](mailto:undefined)

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

* If you want to learn about [Quests & Scenes](/cyberpunk-2077-modding/modding-guides/quest.md), please check the corresponding section.
* If you want to learn about [World Editing](/cyberpunk-2077-modding/modding-guides/world-editing.md), please check the corresponding section.
* [NodeRefs](/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/file-formats/the-whole-world-.streamingsector/noderefs.md) explained

## Requirements

* [ArchiveXL](/cyberpunk-2077-modding/for-mod-creators-theory/core-mods-explained/archivexl.md) 1.17.0+

## Basics

There are two types `worldCompiledCommunityAreaNode` and `worldCompiledCommunityAreaNode_Streamable`

The difference between them is only that `worldCompiledCommunityAreaNode` must be registered in `AlwaysLoaded` type of `.streamingsector`

`worldCompiledCommunityAreaNode_Streamable` can be registered in other types of `.streamingsector` (exterior/quest/etc)

## Theory

Working with `worldCompiledCommunityAreaNode` and `worldCommunityRegistryNode`

In general, we are specifying in `worldCompiledCommunityAreaNode` all our spots where we want to spawn NPCs/etc by its `entryName`/`phase`.

For example in the quest **Riders on the Storm** CDPR reactivates all needed NPCs by their reference, entry name, and phase name.

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

Setup your Wkit project.

Create `.questphase` `.streamingblock` and `.streamingsector` files

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

1. Create `archiveXL` file and specify your `.streamingblock` and `.questphase` files

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

   <figure><img src="/files/5M17EBIgXVw898CGGkV6" alt=""><figcaption><p>we will use .questphase file later</p></figcaption></figure>
2. Create NodeRefs for `worldAiSpotNode` and `worldCompiledCommunityAreaNode`

   <figure><img src="/files/qhDPIdHvbSQqPyoOdLKh" alt=""><figcaption></figcaption></figure>
3. Create `worldAiSpotNode` and its `worldNodeData` and assign created `NodeRef`before

   <figure><img src="/files/SolFqHIZEKLDuBBAq1Od" alt=""><figcaption><p>In the spot property u need to specify workspot that you want to use</p></figcaption></figure>
4. Create `worldCompiledCommunityAreaNode` and its `worldNodeData`

   <figure><img src="/files/2p0dtdqNS03SR9qotmg5" alt=""><figcaption></figcaption></figure>

   **Important**:\
   \- In the `Node/area/entriesData` we specify an `entryName/phaseName/spotId(AiSpoNodeHash)` so in the future, we can `Activate/Reactivate/Deactivate` its entities by these params\
   \- `sourceObjectId` - it should match `id`of registry item
5. Create `worldCommunityRegistryNode` and its `worldNodeData`

   <figure><img src="/files/1A0YnBymIQlDfKRdpUTB" alt=""><figcaption></figcaption></figure>

Details about the registry:

**Important:**

`communitiesData` - there are we specifying the type of NPC its template, entryName, and all possible phases

<figure><img src="/files/j6SeVW95mfhkIRMLCZq9" alt=""><figcaption><p>In this example, i set Panam with entryName panam and phase A to be able to activate on the spot we created earlier</p></figcaption></figure>

`workspotsPersistentData` - there we are adding a new spot into the engine's global registry by the hash of our `AiSpotNode`

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

Trying to spawn:

I set the point in front of H10 V's apartment so we should see Panam spawning once we send a command. To do so we need to create a few nodes in our `.questphase`

In our .xl file, we set that`.questphase` will trigger whenever we enter the apartment.

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

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

<figure><img src="/files/5qDpKlpLJWmdEX4CKa9x" alt=""><figcaption></figcaption></figure>

Then you can deactivate/reactive with SpawnManager


---

# Agent Instructions: 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:

```
GET https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/quest/how-to-use-worldcommunityregistry-and-worldcompiledcommunity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
