Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
johnnyboy

Instruct AI to NOT enter a building when moving to position near building?

Recommended Posts

This is not solved.  See 3rd post below.  Giving a destination with Z value of 1000 seemed to reduce likelihood AI enters a building, but does not totally prevent it.

Is there a way to instruct AI to NOT enter a building. I'm building a feature where player squad leader looks at point on the side of an object (building, wall, fence, log, etc.), and positions are calculated in a line parallel to the exterior object surface for AI to move to (see pic below).

 

The problem is if those move positions are near a building that has navmesh positions, the AI will often choose to enter the building foolishly, instead of moving to calculated position outside of building.   Is there a way to prevent the unit's pathfinding from going in the building, when his doMove tells him to move to a position just outside the building?

 

20230921064613-1.jpg

 

 

  • Like 1

Share this post


Link to post
Share on other sites

SOLVED!!!...Edit: Not Solved.  Sigh... This change helped, but dumb AI pathfinding may still send a unit into the building...

A dude name AMPERSAND gave me the solution in the Arma scripting discord.  Set the z value of destination to 1000, and AI will not attempt to enter building.  Woohoo!  Like this:

{_x set [2,1000];} forEach _movePositions;

 

  • Like 9

Share this post


Link to post
Share on other sites

Actually, this is not a 100% solution.  It helped, but when the position is near building, the AI path finding may still lure the dummies into the building. Dang!!

  • Sad 1

Share this post


Link to post
Share on other sites
2 minutes ago, panther42 said:

@johnnyboy perhaps a look inside C2 may provide help.

Your image made me immediately think of C2 HUD MODE image on the WS...

Thanks for the tip.  I remember the C2 video showing similar feature.  I don't know if it has same occasional "AI enter building" or not.

Share this post


Link to post
Share on other sites

×