FOnline Development > Questions and Answers

[2238] How to change NPC look throw the walls?

(1/1)

SEGA_RUS:
Default NPC can see throw the walls
How to disable this?

SEGA_RUS:
may-be set
--- Code: ---bool MustInitWalkProcessing = false;
--- End code ---
in main.fos?

Lidae:
I haven't tested it, but I think this is a good clue:


--- Code: ---   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
--- End code ---

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.

Atom:

--- Quote from: Lidae on September 09, 2013, 05:26:03 pm ---
--- Code: ---   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
--- End code ---

From check_look.cpp, which handles whether critters are visible or not.

--- End quote ---

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.

Navigation

[0] Message Index

Go to full version