Jump to content
Sign in to follow this  
nullsystems

moveTo/doMove doesnt work 100%

Recommended Posts

Hi, really simple im sure.

I want a unit to move to me as a player.

This works in open fields ( within distance )..but in a town or obstacles the AI just stand there!

Their intelligence is at 1 and CARELESS, why else wouldnt they move to me?

Sometimes, they move..and then stop or jiggle about on the spot. This happens when ive tried civs, east or west, unarmed or else.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_guy doMove getPos player

I have also tried moveTo and they just walk, and have the same problems.

Share this post


Link to post
Share on other sites

try aware and .2 brain and low rank

try using a named game logic as destination point

near placed objects from a editoraddon or arma objects can stop ai from moving aswell

dont spam them with moveorders

Share this post


Link to post
Share on other sites

ty it appears as tho I was overloading them on a timer with ~.2

They follow the commands well on ~3

Share this post


Link to post
Share on other sites

I didnt want to waste anyones time with a new topic since its along the same lines:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_num = 1

#loop

~1

_array = nearestObjects [player, ["SoldierEB"], 50]

? count _array < 1 : goto "loop"

_selection = _array select _num

hint format["%1",_selection]

goto "loop"

I know its a fiddly thing, its only here for example.

However, if a SoldierEB is dead, it still picks them up.

I need to find an array of people within a certain area who are ALIVE. How do I do this?

Share this post


Link to post
Share on other sites

_num = 1

#loop

~1

_array = nearestObjects [player, ["SoldierEB"], 50]

_i=0

{if (alive _x) then {_array set[_i, _x]; _i=_i+1}} foreach _array

_array resize _i

? count _array < 1 : goto "loop"

_selection = _array select _num

hint format["%1",_selection]

goto "loop"

Share this post


Link to post
Share on other sites

We've had similar weird and bad results. I was near Rahmadi "town", and doMove worked great. A friend was located on or near the end of the airfield, and doMove would fail. And that's even less congested space than I was in.

Pathfinding could need a tuneup.

Share this post


Link to post
Share on other sites

It´s Arma´s movement precision and object avoidance routines that mostly screw the direct pathfinding for AI. This has been objected by a lot of mission editors as it sometimes ruins cutscenes and kills missions where you need to have AI go to a certain spot to either trigger something or interact with special objects or units. Still, it most likely will not be fixed with Arma but only Arma2 sad_o.gif

Share this post


Link to post
Share on other sites
_num = 1

#loop

~1

_array = nearestObjects [player, ["SoldierEB"], 50]

_i=0

{if (alive _x) then {_array set[_i, _x]; _i=_i+1}} foreach _array

_array resize _i

? count _array < 1 : goto "loop"

_selection = _array select _num

hint format["%1",_selection]

goto "loop"

Sorry man but that code causes my machine to crash lol

Share this post


Link to post
Share on other sites

Try this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_num = 1;

_selection = objnull;

_i = 0;

while {true} do

{

sleep 1;

_array = nearestObjects [player, ["SoldierEB"], 50];

for[{_i = 0},{_i < (count _array)},{_i = _i + 1}] do

{

_selection = _array select _num;

if ((typename _selection) == "SoldierEB") then

{

if (alive _selection) then

{

hint format["%1",_selection];

};

};

};

};

--Ben

Share this post


Link to post
Share on other sites

First issue:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_follower = _this select 0;

while {alive _follower} do

{

_follower doMove getPos player;

Sleep 4;

};

Second issue:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_trigger = createTrigger ["EmptyDetector", [0,0,0]];

_trigger setTriggerActivation ["EAST", "PRESENT", false];

_trigger setTriggerArea [50, 50, 0, false];

_trigger setTriggerType "NONE";

_trigger setTriggerStatements ["this", "", ""];

_trigger setTriggerTimeout [0, 0, 0, false ];

while {true} do

{

_trigger setPos getPos player;

Sleep 2;

hint format["EAST alive units near me: %1", list _trigger];

};

deleteVehicle _trigger;

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  

×