Page MenuHomeFeedback Tracker

Cannot change formation of an AI group anymore
New, NormalPublic

Description

We used to be able to change the formation of an AI group via AIFormationComponent::SetFormation in earlier versions of Reforger, which no longer seem to work.

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce
  1. Create the following script, which spawns a group and assigns column formation and a patrol waypoint.
//------------------------------------------------------------------------------------------------
modded class ArmaReforgerScripted : ChimeraGame
{
	//------------------------------------------------------------------------------------------------
	override bool OnGameStart()
	{
		SCR_AIGroup group = Test_SpawnGroup();
		string formation = SCR_Enum.GetEnumName(SCR_EAIGroupFormation, SCR_EAIGroupFormation.Column);
		group.GetFormationComponent().SetFormation(formation);
		SCR_AIWaypoint waypoint = Test_SpawnWaypoint();
		group.AddWaypoint(waypoint);		
		return super.OnGameStart();
	}
	
	//------------------------------------------------------------------------------------------------
	protected SCR_AIGroup Test_SpawnGroup()
	{
		Resource res = Resource.Load("{FCF7F5DC4F83955C}Prefabs/Groups/BLUFOR/Group_US_LightFireTeam.et");
		EntitySpawnParams params = new EntitySpawnParams();
		params.TransformMode = ETransformMode.WORLD;
		params.Transform[3] = "77.727 3.723 22.795";
		return SCR_AIGroup.Cast(GetGame().SpawnEntityPrefab(res, GetWorld(), params));
	}
	
	//------------------------------------------------------------------------------------------------
	protected SCR_AIWaypoint Test_SpawnWaypoint()
	{
		Resource res = Resource.Load("{C0A9A9B589802A5B}PrefabsEditable/Auto/AI/Waypoints/E_AIWaypoint_Patrol.et");
		EntitySpawnParams params = new EntitySpawnParams();
		params.TransformMode = ETransformMode.WORLD;
		params.Transform[3] = "104.76 -1.301 174.775";
		return SCR_AIWaypoint.Cast(GetGame().SpawnEntityPrefab(res, GetWorld(), params));
	}
}
  1. Open SF-Tutorial-Navmesh.ent in world editor
  2. Switch to play mode
  3. Observer the formation of the spawned group while they move to the waypoint.

Event Timeline

ookexoo created this task.Thu, May 1, 12:12 AM
ookexoo edited Steps To Reproduce. (Show Details)