NPC use of Portals
Anywho, I wanted to point out that I have been able to make NPC's walk through portals by using a few simple entities. I searched for this on the forums and google and haven't found any news of this yet, and it seems like it could be a pretty cool thing.
***Note: This isn't using AI, its scripted. However, it really is using portals, and not duplicating NPC's or anything silly like that.
***Edit: Here is a link to the tutorial with some pics for how to set it up.
***Edit 2: Here is a link to a video of this in action: http://www.youtube.com/watch?v=k6JUUOH9O78
Atomicramen wrote:
Hey everyone, first off let me say that it was really hard to register! I had to try that confirmation code thing a few times before I got it right.
Welcome to the forum.
Atomicramen wrote:
I will post a tutorial for doing this on the Wiki tutorial page on this site, with a test map, if this is something new.
VERY big news if you are right. I hope you are!
I await the tutorial, could give ust the jist of it now?
First off, let me note that this isn't using AI, its scripted. However, it really is using portals, and not duplicating NPC's or anything silly like that.
The way I have it set up is using path_corners. I place whatever path I want in front of a portal, then one directly behind it. (Note: so far the path_corner going behind the portal must be in walkable space, or the NPC won't go to it. A workaround might be to make a brush that is walkable only to nonplayers somehow, or to place the portal a few feet from the wall like I did).
Then place a path_corner in front of the other portal, followed by whatever path you want the NPC to walk afterwards. Then place a trigger_multiple in front of the second portal, filtered to only the NPC you want. This trigger will tell the NPC to stop walking to the old path_corner that is behind the first portal, and tell him to start on a new path in front of the second. The trigger outputs to a aiscripted_schedule with the schedule "Walk Goal Path" and the goal entity being the path_corner in front of the second portal.
Make sure you have a filter_activator_name set for the trigger, so it knows to only do this if the NPC walks through. Set this up like you would for using the box to trigger a button.
I am posting a youtube video of this right now, and will post the URL when its up.
I'll see if i can try it out later on.