Results 1 to 6 of 6

Thread: getting an AI to leave a building?

  1. #1
    Staff Sergeant
    Join Date
    Jun 27 2009
    Location
    Chapel Hill, NC, USA
    Posts
    273

    getting an AI to leave a building?

    I've placed an AI in a house (Chernarus map) with this
    Code:
    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?
    System Vitals : Q8200, 4GB 1333 DDR3, GTX560Ti, Win7 64bit Pro

  2. #2
    Quote Originally Posted by arthur666 View Post
    I've placed an AI in a house (Chernarus map) with this
    Code:
    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
    Last edited by katdogfizzow; Aug 8 2010 at 17:38.

  3. #3
    Staff Sergeant
    Join Date
    Jun 27 2009
    Location
    Chapel Hill, NC, USA
    Posts
    273
    Author of the Thread
    Quote Originally Posted by katdogfizzow View Post
    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.

  4. #4
    Master Sergeant Militantsausage's Avatar
    Join Date
    May 3 2010
    Location
    Gold Coast, Australia
    Posts
    713
    Quote Originally Posted by arthur666 View Post
    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.

  5. #5
    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...

  6. #6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •