Blockland Forums > Modification Help
Vectors
ThinkInvisible:
So:
--- Code: --- InitContainerRadiusSearch(%aobj, %radius, $Typemasks::PlayerObjectType);
if(%obj = containerSearchNext())
{
echo(%obj);
%homepl = %obj;
}
--- End code ---
%aobj is the homing projectile
%radius... i don't know what goes here :c
%obj... what's that?
%homepl is the player to lock on to if all goes well
will that work?
Amade:
--- Quote from: ThinkInvisible on August 20, 2011, 01:44:01 PM ---...
--- End quote ---
%center needs to be a position - just use %aobj.position
%radius is the size of the radius search - for reference a 32x baseplate is 16 units long
%obj is the first object found by the search
your reasoning with %homepl is correct.
ThinkInvisible:
One last thing.
How do i keep it from targeting the player who fired it?
EDIT: Oh, and give it more than one typemask. Countermeasures much?
ThinkInvisible:
Got countermeasures figured out. Since they have priority over players, i don't need to use more than one typemask at once.
EDIT: And i think i got selfprotection running. I just had some messed-up variables.
ThinkInvisible:
Why isn't this working?
--- Code: --- InitContainerRadiusSearch(%aobj.position, 1000, $Typemasks::projectileobjecttype);
while(%obj = containerSearchNext())
{
if(%obj.getdatablock().getName() $= "homingCountermeasureProjectile") {
%homepl = %obj;
%cmeasured = 1;
}
}
--- End code ---
(If no object is found it goes on to find players - which always happens)
It works when selfprotection is on, though.
Figured it out: i had a return; outside of a function so it never executed the whole file