It could be tied to spawning gunner on static M2 or just M3 tripod (since it's a Turret too):
'Turret','Assets/Weapons/Tripods/M3/Tripod_M3.xob'
{73530808E4B455BA}Prefabs/Weapons/Tripods/Tripod_M3_M2HB.et
{542201C0B4E62FEC}Prefabs/Weapons/Tripods/Tripod_M3.et
```
private void GetAllChildren(IEntity parent, notnull inout array<IEntity> allChildren, bool recursive = true)
{
if (!parent)
return;
IEntity child = parent.GetChildren();
while (child)
{
allChildren.Insert(child);
if (recursive)
{
GetAllChildren(child, allChildren, true);
}
child = child.GetSibling();
}
}
private void GetCompositionEntities(IEntity composition)
{
array<IEntity> children = {};
GetAllChildren(composition, children);
foreach (IEntity entity : children)
{
if (!entity)
continue;
if (entity.FindComponent(TurretControllerComponent))
{
m_aTurrets.Insert(entity);
}
}
}
private void PopulateTurrets()
{
foreach (IEntity turret : m_aTurrets)
'Turret','Assets/Weapons/Tripods/M3/Tripod_M3.xob'{
SCR_BaseCompartmentManagerComponent compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(m_Tturret.FindComponent(SCR_BaseCompartmentManagerComponent));
if (!compartmentManager)
continue;
PrintFormat("Turret: %1, prefab: %2", turret, turret.GetPrefabData().GetPrefabName());
compartmentManager.SpawnDefaultOccupants({ECompartmentType.TURRET});
}
}
```