Good job! The reason it fails with any of the factions over the first three is probably that there's likely something in vanilla invasion that assumes three factions to exist for the system. It would need a closer look to get an idea what it is exactly.
At least all stage settings are configured for the first three factions only, but that as such shouldn't cause such a fail to happen. (friendly faction always gets rotated to index 0)
A modded faction, such as DesertStorm, appears to work fine at least if you do e.g. this:
Code:
...
// --------------------------------------------
class MyMapRotator extends MapRotatorAdventure {
// --------------------------------------------
protected function get_available_faction_configs() {
$available_faction_configs = array();
// these need to match with whatever lobby campaign menu finds from all_factions
$available_faction_configs[] = new FactionConfig(-1, "brown.xml", "Brownpants", "0.5 0.25 0");
$available_faction_configs[] = new FactionConfig(-1, "DesertStorm.xml", "DesertStorm", "0.8 0.8 0.0");
$available_faction_configs[] = new FactionConfig(-1, "OpFor.xml", "OpFor", "0.8 0.0 0.0");
return $available_faction_configs;
}
}
// --------------------------------------------
class MyGameMode extends GameModeInvasion {
// --------------------------------------------
protected function setup_map_rotator() {
$this->map_rotator = new MyMapRotator($this);
}
}
// --------------------------------------------
$metagame = new MyGameMode();
...
all_factions.xml:
Code:
<factions>
<faction file="brown.xml" />
<faction file="DesertStorm.xml" />
<faction file="OpFor.xml" />
</factions>