Re: Making enemies ignore player
Posted by azelito on
Tue Jan 16th 2007 at 9:14pm
azelito
member
570 posts
127 snarkmarks
Registered:
Aug 8th 2002
Occupation: Wierdness
Location: Sweden
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
Re: Making enemies ignore player
Posted by amanderino on
Tue Jan 16th 2007 at 11:17pm
Posted
2007-01-16 11:17pm
205 posts
21 snarkmarks
Registered:
Nov 13th 2006
Location: United States
If you want the metrocop to guard an area and push everyone away, you'll need to set up the ai_goal_police 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 npc_metropolice. Again, name him whatever; here it's Thor.
4.Now you'll need a trigger_once. Set up the trigger:
Output: On trigger
Target: Thor
TargetInput: SetPoliceGoal
Parameter: PG
This trigger will tell the npc_metropolice to walk to the ai_goal_police 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 env_global. 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.
Re: Making enemies ignore player
Posted by azelito on
Tue Jan 16th 2007 at 11:39pm
Posted
2007-01-16 11:39pm
azelito
member
570 posts
127 snarkmarks
Registered:
Aug 8th 2002
Occupation: Wierdness
Location: Sweden
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