Making enemies ignore player
Post Reply
Quote
Re: Making enemies ignore player
Posted by azelito on Tue Jan 16th at 9:14pm 2007


Yeah, so I'm doing this scripted sequence where a CP is standing by a beat-down civilian and when the player gets near, he looks at the player and charges his stunstick. What I wanted to do then is to stop the scripted sequence so that the CP can act on his own, but when he does he immediately kills the citizen and comes running for the player.
Simply put, I want the CP to friendly. I want him to neither attack the player or any other NPC. How do I do this?
And while I'm on it, can I make him stay put and just push the player away if I put him to guarding that zone?

Thanks.



"Azelito, stop being a f**king bitch. All I see you do is complain and insult people in your recent posts. We don't care, go find a razor you emo pansy..." -Windows98



Quote
Re: Making enemies ignore player
Posted by Dark_Kilauea on Tue Jan 16th at 10:46pm 2007


Set up an ai_relationship and set it up so that:

subject: The combine
target: the citizen
disposition: netural or like



Dark_Kilauea
DVS Administration
http://www.dvstudio-production.com/



Quote
Re: Making enemies ignore player
Posted by amanderino on Tue Jan 16th at 11:17pm 2007


If you want the metrocop to guard an area and push everyone away, you'll need to set up the [e]ai_goal_police[/e] point entity.

Create the entity, and go into its properties.
1.Name it whatever you want; it's called PG here.

2.Set the radius to whatever you'd like. If the player steps inside this radius, the metrocop will run over and push him (explained below) or beat him or whatever. You can changed this in the flags, if you'd like. On default, the cop will chase the player out of the radius.

3.Obviously, you'll need an [e]npc_metropolice[/e]. Again, name him whatever; here it's Thor.

4.Now you'll need a [e:s]trigger_once[/e]. Set up the trigger:
Output: On trigger
Target: Thor
TargetInput: SetPoliceGoal
Parameter: PG

This trigger will tell the [e]npc_metropolice[/e] to walk to the [e]ai_goal_police[/e] and police it. If you set the goal's target to citizen then the cop will push the player a few times then begin to beat him with the stun stick. You can change that if you don't equip him though.

5.Place an [e]env_global[/e]. Set it to: Gordon is Pre-criminal and have the Initial State on. I'm not sure if this step is necessary, but it's here just in case. You may need to use Dark_Kilauea's post, too. If the civilian is too close, the metrocop might beat him but I don't think they would if you set everything up like I posted. I hope all this helped.




Quote
Re: Making enemies ignore player
Posted by azelito on Tue Jan 16th at 11:39pm 2007


Thanks a bunch, didn't know the ai_relationship. Setting that to neutral didn't do much good though, he wouldn't push me away and act all policey when I had him in his ai_goal_police.
Setting an env_global to "Gordon is Pre-Criminal" works great with what I'm doing. When this is set, the CPs will act normal around the player but not harass and try to kill him.
The two in combination is probably the solution I'm going for though, setting to "Pre-Criminal" for the player and setting the ai_relationship between CPs and citizens to neutral. That way it won't make the CP all upset when the citizen is close.

Thanks a lot guys.




"Azelito, stop being a f**king bitch. All I see you do is complain and insult people in your recent posts. We don't care, go find a razor you emo pansy..." -Windows98




Post Reply