Jump to content
Sign in to follow this  
quincy

ai move to building position play ( what ever position im at)

Recommended Posts

i want to make a ai move into the building im in (nearest-building player) but on my position in that building

Share this post


Link to post
Share on other sites

You can try...

_ai [url="http://community.bistudio.com/wiki/doMove"][u]doMove[/u][/url] getpos player;

Share this post


Link to post
Share on other sites
You can try...

_ai [url="http://community.bistudio.com/wiki/doMove"][u]doMove[/u][/url] getpos player;

that works slightly but not effectively as it works great as long as the position is on the first floor of the building. i need to be able to get them accuartely to any building position im at

Share this post


Link to post
Share on other sites

Did some testing and it seems the AI won't go to just any position in the buildings.....only the fixed buildingpos's. It will take quite a bit of scripting to find the nearest viable building position for the AI to go to. This will still not be ideal....as the nearest position might be on the floor above or below.

Share this post


Link to post
Share on other sites

Would getPosATL be better?

I'm interested in doing something like this in a mission I'm designing - I want to be able to call an AAT to me. As long as the player unit isn't right next to a wall, could you use getpos ATL to get the coordinates then add to each of the x & y co-ordinates a number that would translate to a distance of one metre or so - positioning the support trooper within easy reach?

Share this post


Link to post
Share on other sites
Would getPosATL be better?

I'm interested in doing something like this in a mission I'm designing - I want to be able to call an AAT to me. As long as the player unit isn't right next to a wall, could you use getpos ATL to get the coordinates then add to each of the x & y co-ordinates a number that would translate to a distance of one metre or so - positioning the support trooper within easy reach?

idk what would work. i am using the undead mod and zombies cant go in buildings i would like to barricade my self in any open building with set positions. and have the zombies rush up the steps to what ever building position im at

Share this post


Link to post
Share on other sites

Depending on the unit's configuration and state, doMove or moveTo together with getPosATL work best. So long as the unit is able to pathfind effectively to that position. Some buildings are difficult for the unit to work out an effective path (taller it is the harder it can be), but many are fine. Using getPosATL/getPosASL is preferred anyway over getPos or position as they offer a performance benefit, so you should always try to use these where possible by default.

Share this post


Link to post
Share on other sites
. Using getPosATL/getPosASL is preferred anyway over getPos or position as they offer a performance benefit, so you should always try to use these where possible by default.

That's interesting as well as helpful - thanks.

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  

×