# 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: `slayer_city_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, cine_3, cine_4`

<span style="text-decoration: underline;">**Cultist Base:**  
</span>Switch State: `cultist_base_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2`

<span style="text-decoration: underline;">**Doom Hunter Base:**  
</span>Switch State: `doom_hunter_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, boss_phase1, boss_phase2, boss_vulnerable, cine_boss_intro, cine_boss_end`

<span style="text-decoration: underline;">**Super Gore Nest 1:**  
</span>Switch State: `supergorenest_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2`  
Secondary Switch: `sgn_combat_suite_1`

<span style="text-decoration: underline;">**Super Gore Nest 2:**  
</span>Switch State: `supergorenest_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2`  
Secondary Switch: `sgn_combat_suite_2`

<span style="text-decoration: underline;">**ARC Complex:**  
</span>Switch State: `samuelsbase_music`  
Ghost States: `main_ambient, main_light, main_heavy`

<span style="text-decoration: underline;">**Phobos:**  
</span>Switch State: `mars_core_music`  
Ghost States: `main_ambient, main_light, main_heavy, alt_ambient, alt_light, alt_heavy, cine_1, level_marscore_baron, escape_pod`  
Secondary Switch: `phobos`

<span style="text-decoration: underline;">**Mars Core:**  
</span>Switch State: `mars_core_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, level_marscore_painelemental, stinger`  
Secondary Switch: `space`

<span style="text-decoration: underline;">**Sentinel Prime:**  
</span>Switch State: `gladiator_music`  
Ghost States: `cine_1, cine_2, cine_3, cine_4, boss_phase1, boss_phase2, boss_vulnerable, boss_end, additional_reveal, additional_levelstart`

<span style="text-decoration: underline;">**Nekravol:**  
</span>Switch State: `metal_hell_music`  
Ghost States: `main_ambient, main_light, main_heavy`

<span style="text-decoration: underline;">**Urdak:**  
</span>Switch State: `maykr_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, cine_3, cine_4, boss_phase1, boss_phase2, boss_vulnerable, additional_reveal, additional_levelstart`

<span style="text-decoration: underline;">**Final Sin:**  
</span>Switch State: `icon_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, boss_phase1, boss_phase2, boss_vulnerable, boss_end, credits_start, credits_end`

**<span style="text-decoration: underline;">UAC Atlantica Facility:  
</span>**Switch State: `dlc1_oil_rig`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, cine_3, cine_6, stinger`

<span style="text-decoration: underline;">**The Blood Swamps:**  
</span>Switch State: `dlc1_hell_swamp_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, boss_phase1, boss_phase2`

<span style="text-decoration: underline;">**The Holt:**  
</span>Switch State: `dlc1_maykr_city_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_3, cine_boss_intro, boss_phase1, boss_phase2, boss_phase3, boss_vulnerable, boss_end, credits_end`

<span style="text-decoration: underline;">**The World Spear:**  
</span>Switch State: `dlc_2_spear`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, cine_3, additional_levelstart, stinger`

<span style="text-decoration: underline;">**Reclaimed Earth:**  
</span>Switch State: `dlc2_overgrown_earth_music`  
Ghost States: `main_ambient, main_light, main_heavy`

<span style="text-decoration: underline;">**Immora/The Dark Lord:**  
</span>Switch State: `dlc2_tech_hell_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2, cine_3, boss_phase1, boss_phase2, boss_phase3, boss_end, credits_start`

<span style="text-decoration: underline;">**Hub/BFG Division:**  
</span>Switch State: `hub_music`  
Ghost States: `main_ambient, main_light, main_heavy, cine_1, cine_2`  
Secondary Switch: `hub`

<span style="text-decoration: underline;">**Blood Harvester: (unused track)**  
</span>Switch State: `bloodharvester_music`  
Ghost States: `main_ambient, main_light`

<span style="text-decoration: underline;">**BATTLEMODE Music: (pvp)** </span>Switch State: `pvp`  
Ghost States: `main_ambient, pvp_lobby, pvp_lobby_end, pvp_lobby_player_ready, pvp_lose, pvp_win, pvp_sudden_death`

<span style="text-decoration: underline;">**Classic Music: (in Slayer Tutorial)** </span>Switch State: `tutorial_switch`  
Ghost States: `main_ambient`