MY GOAL:
Now(gzDoom) if a monster is patroling through patrolpoints look for player without considering the field of view, it can see me even if i'm behind it.
I would love to change this behaviour making it searching for player in its field of view.
I think there are some solutions, but i don't know which will work and which is the best:
SOLUTION 1:
Create a feature of gzdoom modifing the p_enemy.cpp, in the patroling handler from P_LookForPlayers to P_CheckSight , could be the simpliest(i don't know how to compile, but not really a problem) but i would have to bound the wad with my custom gzdoom feature.
SOLUTION 2:
I saw that in the p_enemy.cpp the p_LookForPlayers are called with parameters flags4 & MF4_LOOKALLAROUND (P_LookForPlayers (self, self->flags4 & MF4_LOOKALLAROUND, NULL)) i tried to set those parameters(MF4_LOOKALLAROUND to false) without luck, but maybe i'm missing something, i tried modifying the revenant class like this:
SOLUTION 3:Default
{
-LOOKALLAROUND;
}
override void BeginPlay()
{
bLOOKALLAROUND = false;
}
Add a flag(boolean) that tell me that is patroling(because in the super.tick) and a variable Actor "nextPatrolPoint" that store the next patrolPoint, Override the Tick class implementing the behaviour i want; i did almost all, but it doesn't work, i think that set the target it's not enough and looks like that i can't call Thing_setGoal from zscript(even if would be redundant, but at leat just to understand if works)
SOLUTION 4:
Make a custom patroling handler(opening the Pandora's box cause it needs a lot of regression tests)
In all solutions something missing me, can an expert tell me what is the best way to go and give me some hints.
Really really thanks and sorry for the long question!