Jump to content

NPC spawning and routing


Recommended Posts

I know you guys must be sick of all my questions by now, but I'm getting close to the end of my project, so just bear with me a bit longer, please  :lol:

 

I've run into a couple of issues with regards to NPC's in my SP map. The first one is that I can't seem to use targetnames to spawn NPC's, without the associated scripts with them ceasing to work - meaning I basically have to spawn all my NPC's at the start of the map (and perhaps make them invisible), or have them spawn at the right time (like when entering a room), but just stand completely still. Is there a workaround to this problem, or am I just doing something fundamentally wrong?

 

The second problem, and the much larger one at this point, is one I'm having with routing! Now, I have no problems getting NPC's to follow a set of waypoints to a navgoal, and I've also figured out how to make them stop doing this when spotting the player, using SET_ANGERSCRIPT, but I can't get them to go to any combat_points after that - they either keep going to the previously set navpoint (albeit with the new parameters of the angerscript, such as running instead of walking), or, if I use the term "SET_NAVGOAL" "null", they stand completely still! I've tried adding in SET_USE_CP_NEAREST, but it doesn't seem to have any effect! What am doing wrong here?

 

Thanks again!  :)

Link to comment

Small update: I've noticed that when I break line of sight with the enemies, they will occasionally (but not always) start running down their line of waypoints again, and even end up at a combat_point if I step back out in front of them. However, this doesn't happen all the time, and it never happens when they're initially attacked. I've tried everything I can think of; different behavior states, different ways of setting up the waypoints, and so on, but nothing seems to work. And since my map is a first person shooter, it would really lessen the overall experience quite a lot if every enemy you meet just stands completely still.  :mellow:

 

Any takers on this one? I'll send cake to whoever helps me out!  :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...