Can anybody help me set this up? Any of the C++ documentation to help with it is at least 5 years old and never works. I need to be able to set GenericTeamID on my AI running around. If they not on same team return hostile. Been weeks
Hi, you could follow this here How do I use the AI Perception Teams?
Generally speaking, the system uses the IGenericTeamAgentInterface
to extract the team information from the actors you want to perceive and the AI controller that the AI perception component belongs to. It then uses a function that takes two FGenericTeamId
(which it extracts via the interface) as input and outputs the affiliation between the two.
That means what you would need to do, is implement the IGenericTeamAgentInterface
in any actor you want to perceive, optionally overwrite it also in the AI controller and then you need to create your own attitude solver function and tell the system to use that via the FGenericTeamId::SetAttitudeSolver
function.
AFAIK the default attitude solver function will return friendly if both have the same team, and hostile otherwise. But if the actor does not implement the IGenericTeamAgentInterface
, then it will return neutral.
Hello. Should I implement IGenericTeamAgentInterface
on player pawn, bot pawns and also call SetGenericTeamId() on ControllerAI? Also I need sync bot teamId with its controller teamID for work properly?