Let's say I make a scenario with one human player and three AI players.
At the beginning of the scenario, AI player heroes can exchange their troops normally.
The human player is offered a strategic objective. He may choose to accomplish it or not.
If the objective is not achevied, all heroes of one of the AI players receive additional troops, but they must not be able to exchange troops between them.
Here, "TogglePlayerAIArmySharing (player, toggle)" is used.
After a certain time, all the heroes of this same AI player again see their armies reorganized, and they can again exchange the troops between them normally.
Here, "TogglePlayerAIArmySharing (player, toggle)" is used again.
At the same time, one of the heroes of another AI player is given a fairly substantial army, and he alone must not be able to exchange the troops of his army.
In this case, "ToggleHeroAIArmySharing (hero, toggle)" is used.