Skip to content

[Modding] Adding a new Formation Group

LieutenantMaster edited this page Apr 4, 2023 · 3 revisions

Return to the summary


YourMod/Scripts/4_World

class eAIFormationL: eAIFormation
{
	override vector GetPosition(int member_no)
	{
		int offset = Math.Floor((member_no + 1) / 2);
		float scaled_offset = 2 * offset * GetScale();
		if (member_no % 2 == 0) return Vector(scaled_offset, 0, 0); // Horizontal Line
		return Vector(0, 0, scaled_offset); // Vertical Line
	}
};

In this example we are drawing a L shape formation.

Clone this wiki locally