
Originally Posted by
ProfTournesol
Ok, what you've done is too complicated and provides the units from behaving normally when spotting enemies.
He's using code I posted a while ago, and I still use that code to great effect. He must be doing something wrong. Also, your alternative will not work. Yea it will get them to sit down, but at some point, the AI will stand up, and your code does not compensate for this so once they stand up they will not sit back down.
[45Cdo]Kotp, please make sure you have the underscore (_) in front of the first "this". Also, I did notice since OA that the bevaiour of AI is a little odd now when they are not group leader, so try this:
Code:
_grp = group _this;
[_this] joinSilent grpNull;
_this setBehaviour "SAFE";
_this disableAI "ANIM";
_this action ["SITDOWN",_this];
sleep 5;
waitUntil{
if(animationState _this != "amovpsitmstpsraswrfldnon")then{
sleep 8+random(3);
_this action ["SITDOWN",_this];
waitUntil{animationState _this == "amovpsitmstpsraswrfldnon"}
};
behaviour _this != "SAFE"
};
_this enableAI "ANIM";
[_this] joinSilent _grp;
_this doFollow (leader _grp);
I have used this modification recently and it works very well.