waitUntil {not isNull (position _this nearestObject "BulletBase")};
1) Make the above a one line script
2) execVM the script from a unit's init
3) Approach unit and shoot firearm
4) Watch ArmA hiccup terribly
I can replace the above with two scripts. One is:
while {TRUE} do
{
smb_bullet = (position _this nearestObject "BulletBase");
sleep 0.001;
};
The other is:
waitUntil {not isNull smb_bullet};
However, when sleep is set long enough to not cause a hiccup, the bullet is not always detected.
Yes I am trying to catch bullets from the target, not the creation point. A recent thread about the dammaged event handler got me curious.
Now, for the first example, I know that waitUntil is trying check its condition each engine timeslice, and that the condition is a bit nasty. Is there any way to improve this situation?