I was trying to improve the Rift Spawn point generator for maps that have difficult navigation areas. But looks like Rifts are still hitting in unpathable areas. I tried adding a NavUtils.CanPathTo test as a secondary to make sure path was valid. While this script worked in testing with bots (Rift Nukes would launch at start of game), it appeared to not work with actual players online (Rift Nukes never launched). No errors in logs related to the script.
This was the code snippet:
-startPos = Random location chosen as spawn point for Rift
-endPos = Randomly chosen Player start position
-StartAmphibious = NavUtils.GetLabel('Amphibious', startPos) --Where units are coming from
-EndAmphibious = NavUtils.GetLabel('Amphibious', {randX, terrainAttitude, randZ}) --Where units are trying to reach
01 if StartAmphibious == EndAmphibious then
02 local AccurateTest = NavUtils.CanPathTo('Amphibious', startPos, endPos)
03 if AccurateTest == true then --If Path is true then Position is added as possible Rift spawn point.
04 newPos = { randX, terrainAttitude, randZ, type = "VECTOR3" }
05 table.insert(validRiftPositions.positions, newPos)
06 end
07 end
Sorry on the ugly code snippet, I don't know how to add in the nice looking snippets.
I've since reverted the code in the latest release, AI Wave Survival v260. The prior version, v259, has the script that only appeared to work with bots.