fodev.net
FOnline Development => Questions and Answers => Topic started by: SEGA_RUS on August 21, 2013, 10:51:29 am
-
Default NPC can see throw the walls
How to disable this?
-
may-be set
bool MustInitWalkProcessing = false;
in main.fos?
-
I haven't tested it, but I think this is a good clue:
if (!cr.CritterIsNpc)
{
max_range = TraceWall(cx, cy, ox, oy, map, max_range); // in case wall is blocking
return dist <= max_range; // behind a wall
}
return true; // max pe range handled before
From check_look.cpp, which handles whether critters are visible or not. But I think it might depend on the AI usage as well - if you use CRITTER_EVENT_SHOW_CRITTER_# events, then that will "detect through walls" I think.
-
if (!cr.CritterIsNpc)
{
max_range = TraceWall(cx, cy, ox, oy, map, max_range); // in case wall is blocking
return dist <= max_range; // behind a wall
}
return true; // max pe range handled before
From check_look.cpp, which handles whether critters are visible or not.
That is correct, removing the check for non-npc and recompiling check_look.dll will make NPCs' LOS affected by walls. However, AI is known to behave badly when this is the case, which was the reason to make the walls invisible for them. The only exception are sneaking players, where raytracing for obstacles is done regardless, with walls blocking the vision completely. This can be seen later in the code.