So let me check and see if I understand how BasicTurretry finds its turrets. It gets a GameEntity BuildingEntity
object passed in, then it looks at all the available Build Menus, and foreach build menu all of the objects in it to find things that look like turrets.
I'm assuming the various BuildMenus are things like FleetShips_I_Thru_IV, ConstUnits and Turrets, as defined in KDL_BuildMenus.xml.
So if I wanted to copy this approach, I might define a new Badger_BuildMenu.xml, with a "MaliciousMonsters" build menu. It looks like BuildMenu has a Name, so I would iterate over the BuildMenus till I found one whose Name was "MaliciousMonsters". Then I would iterate over that list and either pick one by name (if GameEntityTypeData.Name == "FirstMonster") or pick one at random and then call GameEntity.CreateNew, passing in my GameEntityTypeData for the chosen monster (along with the other required fields).
That leaves open the question of where I get the BuildingEntity object into my PerSimStepLogic function; it looks like its passed in as an argument. Is there a global I can talk to?
Alternatively, I notice in MapGeneration.cs you call
GameEntityTypeData warpGateData = GameEntityTypeDataTable.Instance.GetRandomRowWithTag( Context, "WarpGate" );
and then pass that GameEntityTypeData to CreateNew
Could I use an approach like that to find a Monster to spawn?