How to deal with Losing Leader of a Formation Group?

IEmperator

New member
Hi there to all!

I am in the process of writing a custom Task that makes a group of troops move in formation toward a set destination and shoots at enemy units if they are in the way. It is similar to the marching fire task of the Tactical Pack but it dose not concerns itself with hunting down the enemy targets but rather to get to the designated position.

I have been successful in grafting the attack aspects of the TatcicalGroup onto a copy of the FormationGroup and its relevant classes creating a set of classes that combines the moving aspects of the formation(Grid) and the basic attack aspect of the tactical packs with the added feature of slowing down when in combat.

I am now looking for help with how to implement the feature of leader swap in the case when the leader of the group gets killed, in a way that dose not involves the task to terminate unless no units left or the destination is reached.

Any help would be greatly appreciated.
 
When the leader dies the OrdersFinished event will be sent which will change the run status of all of the followers. At this point you could restart the task with a new leader. In the Formations Pack demo scene there is an example of splitting one group into three with three different leaders and this would be a good example to based your new code off of.
 
Thank you for the suggestion. I didn't liked that the leader is often gets killed at first and i remembered an old warhammer strategy game that i played on ps1 back in the days, where oddly enough the commander of a formation always died last, so i implemented that and it looks quite good, at least it beats having the troops keep re-forming in the middle of battle.
 
Top