Ambushes and bosses¶
Ambush enemies and bosses must have Start Inactive on (EnemyEntity, Activation). Inactive enemies don't act or take damage until an EnemyActivateTrigger, ambush wave, BossEncounterManager or EnemyEntity.ActivateEnemy() activates them.
Set up an ambush¶
Prefabs/Level/TriggerAmbush (EnemyAmbushTrigger) runs waves: when the player enters, music switches to ambushMusic (default volume 0.6; no clip = level music continues), each wave activates after waveDelayTurns and the portal animation, the next starts when all die, and at the end the level music returns and ambushEndClip plays.
Recipe from E1M2_Underground (room locks when you grab the key):
- Place the key in the room and an entrance door with
startOpenon andtriggerMode = None. - Place the enemies with Start Inactive.
- Cover the 3×3 cells around the key with a
TriggerAmbushand add the enemies to a wave (EnemyWave). - Wire
OnAmbushActivated→Door.CloseDoorandOnAllWavesCompleted→Door.OpenDoor.
Checkpoints
Only "ambush fired" is saved. On load, music, portals and events don't repeat; survivors of all waves activate in place. The current wave index is not saved.
Set up a boss fight¶
BossEncounterManager handles presentation (health bar, door, events), not AI.
- Place the boss (e.g.
Prefabs/Enemy/MageBoss) with Start Inactive and classificationBoss. - Add
BossEncounterManagerto an object with aBoxCollidercovering the whole arena. - Assign
bossEntity; optionallyexitDoor,bossDisplayName(empty = enemy name),onBossEncounterStartandonBossEncounterEnd.
On entry, the boss activates (it takes no damage before, even from outside the arena), exitDoor closes and the boss bar appears. Only the boss's death ends the encounter, opening the door; leaving the arena doesn't, and it never restarts.
Add minions and phases¶
Both components work on any enemy:
EnemyMinionSummonAbilitysummons minions in free nearby cells (prefab, count, radius, cooldown in turns, max player distance). Needs a behavior withAction_Summon, likeBehaviour_Boss.EnemyPhaseControllerdefines phases by health percentage, each with damage multipliers, regeneration, a replacement attack kit, entry animation and event. Phases only advance (e.g. 100 → 60 → 30).
See Enemy AI.