The frequency controls how often it checks to see if it can spawn another monster. If Max live children is set, then if there are fewer than that number alive it will spawn another monster. Otherwise, it will check again in frequency seconds. If Max live children is not set, it will spawn another monster every frequency seconds.
Note that frequency only applies if toggle use behavior is enabled (meaning cyclic mode is disabled).
You could add a flag that tells it to only start spawning monsters again if all monsters have died.
To do that i'd keep track of how many monsters have been spawned since the last time all of them have died. Once that number equals Max live children and m_cLiveChildren is 0, you'll know that all children have died. You can then reset the spawned monsters counter and start over.
Something like this in CMonsterMaker::MakeMonster:
[code]
if( m_iMaxLiveChildren > 0 )
{
if( FBitSet( pev->spawnflags, SF_MONSTERMAKER_GROUPED ) )
{
if( m_cSpawnedChildren >= m_iMaxLiveChildren )
{
if( m_cLiveChildren > 0 )
{
//Not all children have been spawned or died yet, so don't allow spawning.
return;
}
//All children have been spawned and have died.
m_cSpawnedChildren = 0;
}
}
if ( m_cLiveChildren >= m_iMaxLiveChildren )
{// not allowed to make a new one yet. Too many live ones out right now.
return;
}
}
[/code]
SF_MONSTERMAKER_GROUPED is the flag that controls this behavior. I'm using the term grouped to mean spawning monsters in groups of m_cMaxLiveChildren.
m_cSpawnedChildren should be incremented later in the method to track monster spawns.