Ritualistic Forums

Ritualistic Forums (http://www.ritualistic.com/forums/index.php)
-   SiN Episodes Editing (http://www.ritualistic.com/forums/forumdisplay.php?f=23)
-   -   Map AI Question (http://www.ritualistic.com/forums/showthread.php?t=18696)

Maxsilver 10-29-2006 09:06 AM

Map AI Question
 
Hi,

I've been playing around with Hammer and the Sin SDK and stumbled upon a few questions that I couldn't find answers for in the Sin SDK Wiki.

I'm trying to get npc_jessica to do the following...
1. Shoot grunts
2. If there are no grunts, follow player
3. If player gets into car, jessica gets into car (passanger) and shoots grunts if there are grunts and Get out of the car if the player gets out.

Right now, the only thing she does is shoot grunts. And only if I see her (in the level, the player starts out right above the action, but the grunts wont shoot at her, and she wont shoot back until the player is looking at the grunts)


I've been trying to following the guide for making Jessica drive the car ( http://www.ritualediting.com/wiki/?t...rive_a_vehicle ) and expanding it to fit the list above, but I have not been successful in making her do it. The guide says I need a "trigger_once" and I don't see that on my entity list (would an "action" suffice?)


this is the map i've been playing with and any help would be greatly appreciated,

Thanks.

Xenogenetic 10-29-2006 10:04 AM

Re: Map AI Question
 
You can't drive cars in Emergence(I think). You might also want to fix up your brushes so they are a bit cleaner (don't intersect when they don't have to) and apply the nodraw texture to the outside of walls that players can't see. You also don't have to name each grunt unless you want to have another entity interact with them, but you can name them if you want to. Enough of that though...

I am not great with AI, I don't know all the entites by heart, but I guess you could make a trigger to check if all the grunts are dead and then, if they are, run a script on Jessica. If you need more detailed help I might have some time later today to make you an example map.

Maxsilver 10-29-2006 11:40 AM

Re: Map AI Question
 
Quote:

You can't drive cars in Emergence(I think).
The car was written as drivable by someone at Ritual, all you need to do is place the car on the map, walk to it and press use (on driver door) and you can drive it (WASD controls, space is brake).


Quote:

I am not great with AI, I don't know all the entites by heart, but I guess you could make a trigger to check if all the grunts are dead and then, if they are, run a script on Jessica.
I'd rather make some kind of script that only checks grunts around her. The levels will eventually have lots of grunts all over the place. I'd rather Jessica only stop to kill grunts if they are within viewing distance of her -- otherwise she'd never stop killing them long enough to follow the player around / hop in the car.

Quote:

If you need more detailed help I might have some time later today to make you an example map.
I'd greatly appreciate that

Xenogenetic 10-29-2006 04:31 PM

Re: Map AI Question
 
OK after looking at the stuff I have concluded
1) The car is drivable (really fun to run grunts over)
2) If you are driving the car Jessica can't get in.
3) I don't know what I would put in the example map :( I don't know how to get Jessica to follow the player :S

Maybe when I have some more time I can figure everything out and show you, or you can figure it out and show me :)

MeatPuppet 10-29-2006 08:41 PM

Re: Map AI Question
 
Jessica can ride in the passenger seat. Give the prop_vehicle_sin a name. In Jessica's properties there is a field called "target vehicle". Enter the name of the vehicle there. Now you need to give her a command of "enter vehicle force" with a parameter override of "1" which designates the passenger seat and she will pop in there. If you use "enter vehicle" she might path her way to the car then get in. I don't recall off the top of my head.

It's convenient to fire off the "enter vehicle force" command when the player enters the car. It is the "player on" flag in the vehicle properties.

Hope this helps.

Maxsilver 10-30-2006 07:41 AM

Re: Map AI Question
 
Thanks so much!

Giving Jessica the "enter vehicle force" command works, and the plain "enter vehicle" works (she will path her way over to the car, but only if it is really close to her)


But for some reason, "exit vehicle" doesn't work. For some reason, giving the car an (If PlayerOn then Jessica EnterVehicle 1) works, but an (If PlayerOff then Jessica ExitVehicle) won't kick her out of it, and won't throw a dev error message.

I also still can't figure out how to get Jessica to follow the player. I'm messing around with "squads" and "teams" to see if somehow that will allow it.

Thanks for the assistance so far, I appreciate it a lot.

MeatPuppet 10-30-2006 10:35 PM

Re: Map AI Question
 
"enter vehicle" works (she will path her way over to the car, but only if it is really close to her)... Make sure there are enough path nodes in the area of the car.



"But for some reason, "exit vehicle" doesn't work." ..... The command should target the car with a parameter of "1". Think of it as an ejection seat.

"I also still can't figure out how to get Jessica to follow the player. I'm messing around with "squads" and "teams" to see if somehow that will allow it." ... What you are looking for is "ai_goal_follow". It can be turned on and off.

The biggest problem you are likely to have is when you kick Jessica out of the car. She probably won't know where to go and might stay in the air in her sitting positon. :)

Maxsilver 10-31-2006 10:45 PM

Re: Map AI Question
 
Quote:

What you are looking for is "ai_goal_follow". It can be turned on and off.
Worked perfectly. Thanks so much!

Quote:

The biggest problem you are likely to have is when you kick Jessica out of the car. She probably won't know where to go and might stay in the air in her sitting positon
Your absolutely right, the car "ejection seat" command sends her sitting in mid air (being ejected from either driver or passanger seat)

What can I do about this? (I was hoping that sending jessica the "exitvehicle" commmand would fix it, but that doesn't seem to have much use)


Also, I noticed when she is in the passanger seat, her animation gets lost sometimes (it looks for something like ACT_PASSANGER_IDLE and cant find it) Is this an animation I need to add to her character in something like faceposer?

And is there any way to get her to fire while sitting. (If the car approaches grunts, I'd like her to auto lean out the window and fire just like she normally does if tailing the player.

MeatPuppet 11-01-2006 07:44 PM

Re: Map AI Question
 
Jessica wasn't designed to be a passenger but she might fire at enemy grunts if she hates them enough. You can use an ai_relationship to tell her to hate them. She won't lean out the windows on her own. You will have to write some code to make that happen.

As for her idle animation while riding as a passenger, I think it should work. It was definitely working at some point.

I'm not sure what the best way to deal with the exit vehicle command on Jessica is. At some point she would play an exit animation. But I just checked the model viewer and didn't see the passenger exit animation. So, I have a feeling that a fix that might work is to kill her after the exit vehicle command and then spawn a new instance of her. Getting her to spawn wherever the player stops the car is going to be another problem you will have to figure out. I'm not sure how to do it off the top of my head but that doesn't mean a solution doesn't exist. You might try parenting an info_spawn_destination to the car and have her spawn there? I have no idea if it will work but it might be worth trying.


All times are GMT -5. The time now is 12:58 PM.

Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.