I'm trying to make a homing rocket script and so far failing, so:
Can someone explain how vectors work and all the commands that deal with them?
The only one I know about is vectorDist(); and not very much about that.
Also, is there an easier way to hunt for the closest player than comparing every player's position?
EDIT: Why isn't this working?
InitContainerRadiusSearch(%aobj.position, 1000, $Typemasks::projectileobjecttype);
while(%obj = containerSearchNext())
{
if(%obj.getdatablock().getName() $= "homingCountermeasureProjectile") {
%homepl = %obj;
%cmeasured = 1;
}
}
(If no object is found it goes on to find players - which always happens)
It works when self-protection is enabled.
Figured it out: i had a return; outside of a function so it never executed the whole file