# idMusicEntity

<p class="callout info">Music Entities are used to play music in the level.</p>

### Usage

```
entity {
	entityDef sound_sound_musicentity_1 {
	inherit = "sound/musicentity";
	class = "idMusicEntity";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false;
	disableAIPooling = false;
	edit = {
		spawnPosition = {
			x = 1;
			y = 1;
			z = 1;
		}
		initialState = "music_ghost_states/main_ambient"; // music state when level first loads
		initialSwitchGroup = "music_ghost_switch";
		initialSwitchState = "intro_music"; // level music
	}
}
}
```

&gt; This Music Entity will play ambient music from Hell on Earth.

---

Not all Music Entities are structured the exact same way.  
<span style="text-decoration: underline;">The music for **Super Gore Nest**, **Mars Core**, and the **Hub** have their usage shown below:</span>

```
entity {
	entityDef sound_sound_musicentity_2 {
	inherit = "sound/musicentity";
	class = "idMusicEntity";
	expandInheritance = false;
	poolCount = 0;
	poolGranularity = 2;
	networkReplicated = false;
	disableAIPooling = false;
	edit = {
		spawnPosition = {
			x = 1;
			y = 1;
			z = 1;
		}
		initialState = "music_ghost_states/main_ambient"; // music state when level first loads
		initialSwitchGroup = "music_ghost_switch";
		initialSwitchState = "supergorenest_music"; // level music
		secondarySwitchGroup = "supergorenest_music"; // should be the same as above
		initialSecondarySwitchState = "sgn_combat_suite_1"; // music variant
	}
}
}
```

&gt; This Music Entity will play ambient music from Super Gore Nest's first music variation.

### Notes:

The .entities file will play the bottom-most Music Entity when loading the level.  
Use the [setMusicState](https://wiki.eternalmods.com/books/entities-custom-encounters/page/setmusicstate) Event Call to shift the music to its ghost states (ambient, light, heavy, etc).  
You can activate different music in the same level through [activateTarget](https://wiki.eternalmods.com/books/entities-custom-encounters/page/activatetarget).

### Music States Per Level:

<span style="text-decoration: underline;">**Hell on Earth:**</span>  
Switch State: `intro_music`  
Ghost States: `main_ambient, main_light, main_heavy, additional_reveal, cine_1, cine_2, cine_3`

<span style="text-decoration: underline;">**Exultia/Taras Nabad:**  
</span>Switch State: <code>slayer&#95;city&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; cine&#95;3&#44; cine&#95;4</code>

<span style="text-decoration: underline;">**Cultist Base:**  
</span>Switch State: <code>cultist&#95;base&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2</code>

<span style="text-decoration: underline;">**Doom Hunter Base:**  
</span>Switch State: <code>doom&#95;hunter&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; boss&#95;phase1&#44; boss&#95;phase2&#44; boss&#95;vulnerable&#44; cine&#95;boss&#95;intro&#44; cine&#95;boss&#95;end</code>

<span style="text-decoration: underline;">**Super Gore Nest 1:**  
</span>Switch State: <code>supergorenest&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2</code>  
Secondary Switch: <code>sgn&#95;combat&#95;suite&#95;1</code>

<span style="text-decoration: underline;">**Super Gore Nest 2:**  
</span>Switch State: <code>supergorenest&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2</code>  
Secondary Switch: <code>sgn&#95;combat&#95;suite&#95;2</code>

<span style="text-decoration: underline;">**ARC Complex:**  
</span>Switch State: <code>samuelsbase&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy</code>

<span style="text-decoration: underline;">**Phobos:**  
</span>Switch State: <code>mars&#95;core&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; alt&#95;ambient&#44; alt&#95;light&#44; alt&#95;heavy&#44; cine&#95;1&#44; level&#95;marscore&#95;baron&#44; escape&#95;pod</code>  
Secondary Switch: <code>phobos</code>

<span style="text-decoration: underline;">**Mars Core:**  
</span>Switch State: <code>mars&#95;core&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; level&#95;marscore&#95;painelemental&#44; stinger</code>  
Secondary Switch: <code>space</code>

<span style="text-decoration: underline;">**Sentinel Prime:**  
</span>Switch State: <code>gladiator&#95;music</code>  
Ghost States: <code>cine&#95;1&#44; cine&#95;2&#44; cine&#95;3&#44; cine&#95;4&#44; boss&#95;phase1&#44; boss&#95;phase2&#44; boss&#95;vulnerable&#44; boss&#95;end&#44; additional&#95;reveal&#44; additional&#95;levelstart</code>

<span style="text-decoration: underline;">**Nekravol:**  
</span>Switch State: <code>metal&#95;hell&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy</code>

<span style="text-decoration: underline;">**Urdak:**  
</span>Switch State: <code>maykr&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; cine&#95;3&#44; cine&#95;4&#44; boss&#95;phase1&#44; boss&#95;phase2&#44; boss&#95;vulnerable&#44; additional&#95;reveal&#44; additional&#95;levelstart</code>

<span style="text-decoration: underline;">**Final Sin:**  
</span>Switch State: <code>icon&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; boss&#95;phase1&#44; boss&#95;phase2&#44; boss&#95;vulnerable&#44; boss&#95;end&#44; credits&#95;start&#44; credits&#95;end</code>

**<span style="text-decoration: underline;">UAC Atlantica Facility:  
</span>**Switch State: <code>dlc1&#95;oil&#95;rig</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; cine&#95;3&#44; cine&#95;6&#44; stinger</code>

<span style="text-decoration: underline;">**The Blood Swamps:**  
</span>Switch State: <code>dlc1&#95;hell&#95;swamp&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; boss&#95;phase1&#44; boss&#95;phase2</code>

<span style="text-decoration: underline;">**The Holt:**  
</span>Switch State: <code>dlc1&#95;maykr&#95;city&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;3&#44; cine&#95;boss&#95;intro&#44; boss&#95;phase1&#44; boss&#95;phase2&#44; boss&#95;phase3&#44; boss&#95;vulnerable&#44; boss&#95;end&#44; credits&#95;end</code>

<span style="text-decoration: underline;">**The World Spear:**  
</span>Switch State: <code>dlc&#95;2&#95;spear</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; cine&#95;3&#44; additional&#95;levelstart&#44; stinger</code>

<span style="text-decoration: underline;">**Reclaimed Earth:**  
</span>Switch State: <code>dlc2&#95;overgrown&#95;earth&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy</code>

<span style="text-decoration: underline;">**Immora/The Dark Lord:**  
</span>Switch State: <code>dlc2&#95;tech&#95;hell&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2&#44; cine&#95;3&#44; boss&#95;phase1&#44; boss&#95;phase2&#44; boss&#95;phase3&#44; boss&#95;end&#44; credits&#95;start</code>

<span style="text-decoration: underline;">**Hub/BFG Division:**  
</span>Switch State: <code>hub&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light&#44; main&#95;heavy&#44; cine&#95;1&#44; cine&#95;2</code>  
Secondary Switch: <code>hub</code>

<span style="text-decoration: underline;">**Blood Harvester: (unused track)**  
</span>Switch State: <code>bloodharvester&#95;music</code>  
Ghost States: <code>main&#95;ambient&#44; main&#95;light</code>

<span style="text-decoration: underline;">**BATTLEMODE Music: (pvp)** </span>Switch State: <code>pvp</code>  
Ghost States: <code>main&#95;ambient&#44; pvp&#95;lobby&#44; pvp&#95;lobby&#95;end&#44; pvp&#95;lobby&#95;player&#95;ready&#44; pvp&#95;lose&#44; pvp&#95;win&#44; pvp&#95;sudden&#95;death</code>

<span style="text-decoration: underline;">**Classic Music: (in Slayer Tutorial)** </span>Switch State: <code>tutorial&#95;switch</code>  
Ghost States: <code>main&#95;ambient</code>