Jump to content
Sign in to follow this  
arthur666

getting an AI to leave a building?

Recommended Posts

I've placed an AI in a house (Chernarus map) with this

setPos ((nearestBuilding this) buildingPos 4) 

I have him join a group on a triggered event. He joins but will not walk out of the door to follow them. Is there an easy way to get him to leave and go with his newly joined group?

Share this post


Link to post
Share on other sites
I've placed an AI in a house (Chernarus map) with this
setPos ((nearestBuilding this) buildingPos 4) 

I have him join a group on a triggered event. He joins but will not walk out of the door to follow them. Is there an easy way to get him to leave and go with his newly joined group?

I wonder if you need to set a "careless" wp parameter? Ive noticed it gets tricky when enemy are in the area firing.

I used the move to waypoint and set it to careless, blg pos 4...seemed to do the trick for what I needed; not sure how a script would work. im interested to see more answers

Edited by katdogfizzow

Share this post


Link to post
Share on other sites
I wonder if you need to set a "careless" wp parameter? Ive noticed it gets tricky when enemy are in the area firing.

That didn't make a difference. I guess he'll just have to stay outside the building.

He is the target for one of my SpecOp missions, and I want him to flee the house, join his group of bodyguards, and try to escape in a vehicle when BLUFOR is detected nearby. A minor detail, but it would've been nice.

Share this post


Link to post
Share on other sites
That didn't make a difference. I guess he'll just have to stay outside the building.

He is the target for one of my SpecOp missions, and I want him to flee the house, join his group of bodyguards, and try to escape in a vehicle when BLUFOR is detected nearby. A minor detail, but it would've been nice.

I dont know if it will help but maybe you need to get him in the building maually, using the setPosATL command, it might let hime run otu of the house because using setPos only matters for where the object starts, it doesn't keep it in one place, it will take a bit of trial and error though, you need to find the right height and spot in the house.

All you have to do then is use the "JOIN" waypoint or whatever you are using, but if you are using a "JOIN" or "JOIN AND LEAD" waypoint it might help to put a move waypoint to get the VIP outside first then use the join waypoint.

Share this post


Link to post
Share on other sites

Somewhat OT, but also somewhat along the same lines...

What is the easiest way to KEEP a guy inside a building without going on the roof? I usually use the UPSON patrol building script....But this has them up on the roof from time to time...

Share this post


Link to post
Share on other sites
What is the easiest way to KEEP a guy inside a building without going on the roof? I usually use the UP SON patrol building script....But this has them up on the roof from time to time...

You can use a waypoints to move to a particular non-roof position. Hightlight the unit, and create a waypoint on the map over a building object. When over the building object, the building position can be specified (in your case you would have to enter the # of a non-roof waypoint). You can then have another waypoint outside the building if you want him to leave later.

This could also answer Arthur's question

Is there an easy way to get him to leave and go with his newly joined group?

In the waypoint that specifies the building position, in the code snippet say:

this lockwp true;

That will keep him from going to next waypoint. Create another waypoint outside the building. In that waypoint you can add a code snippet for the unit to join whatever group you want.

Finally, create a trigger that detects the condition for when you want the unit to leave the building. In the code field for the trigger say:

dude lockwp false;

This will unlock the unit's waypoints, so he does the next move waypoint (leaves the building), and joins the group you want.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×