Screenshots:
Spoiler:If you look carefully at these you'll see a shotgun sergeant hiding in each screenshot. (I took this with chase cam on, since I couldn't see them otherwise.)
So far this is a demo that shows the behavior of seeking the ambush points only. But how it works is simple and similar to Flankers.
- In the WorldLoaded event AM_Point is spawned at each orthogonal (where two lines meet in 90 degrees) point.
- A thinker finds all monsters within a distance of the player, and if they are at the beginning of "See" they search for a nearby AM_Point that they can see but the player can't.
- The monster makes the AM_Point (if found) a target.
Code: Select all
// add sector orthogonal points
override void WorldLoaded(WorldEvent e)
{
for(int i = 0; i < Level.Sectors.Size(); i++)
{
SecPlane floorplane = Level.Sectors[i].FloorPlane;
int floorZ = int(floorplane.ZAtPoint((Level.Sectors[i].CenterSpot.x, Level.Sectors[i].CenterSpot.y)));
vector3 v3;
for (int ii = 0; ii < Level.Sectors[i].Lines.Size(); ii++)
{
let sideB = (Level.Sectors[i].Lines[ii].V1.P - Level.Sectors[i].Lines[ii].V2.P);
int AB = 0;
for (int j = 0; j < Level.Sectors[i].Lines.Size(); j++)
{
if (j != ii)
{
if (Level.Sectors[i].Lines[ii].V1.P == Level.Sectors[i].Lines[j].V2.P)
{
let sideA = (Level.Sectors[i].Lines[j].V1.P - Level.Sectors[i].Lines[j].V2.P);
if (sideA dot sideB == 0)
{
v3 = (Level.Sectors[i].Lines[ii].V1.P.x, Level.Sectors[i].Lines[ii].V1.P.y, floorZ);
spawnPoint(v3);
}
AB++;
}
if (Level.Sectors[i].Lines[ii].V2.P == Level.Sectors[i].Lines[j].V1.P)
{
let sideC = (Level.Sectors[i].Lines[j].V1.P - Level.Sectors[i].Lines[j].V2.P);
if (sideC dot sideB == 0)
{
v3 = (Level.Sectors[i].Lines[ii].V2.P.x, Level.Sectors[i].Lines[ii].V2.P.y, floorZ);
spawnPoint(v3);
}
AB++;
}
}
if (AB == 2)
{
break;
}
}
}
}
}
Update 12/24/21 - Close to a first release!
Spoiler: