in my OnTargetPerceptionUpdate, within my AI controller, I want to tell what type of stimulus has triggered the update.
The function is triggered with an “FAIStimulus” in its argument; and FAIStimulus includes the “Type” variable that seems exactly what I need (check FAIStimulus | Unreal Engine Documentation).
My issue is that this variable is of type “FAISenseID”, that in turn is a type-defined as:
typedef FAINamedID<FAISenseCounter> FAISenseID;
Trying to track that variable down as if it was an int (looks like FAINamedId is a structure to give a unique numerical identifier to… things), and getting 0 and 1s as results:
FString stimulustype = FString::FromInt(Stimulus.Type);
UE_LOG(LogTemp, Warning, TEXT("Stimuli type is : %s"), *stimulustype);
Does anybody know how to actually parse these?? I’d expect something like an enum with correspondences to the various possible stimuli types, but couldn’t find anything.
Issue solve. You can get “ID” for each sense asking your sense config class. So to know whether your character has seen or heard something, you have to store your sense IDs and then match against those IDs:
I was confused how to get the SightConfig itself from an ID. I dug through the source and found there is a static template member function where you can pass in the sense class and get the id: