some more elaboration on the above
all /getid does is shoot off a container raycast in front of the player
to do this, it requires some simple vector math
it basically comes down to two elements: the player's eye point (
.getEyePoint(), the position at which the player's 'eyes' are located) and the player's eye vector (
.getEyeVector(), a vector3f representing the direction in which the player is looking)
if you've never used containerRayCast before,
here's a thread where it's well-explained(in addition,
here's a reference for typemasks and a
list of v21 typemasks)
the poopy looks somethin like this:
%eye = %obj.getEyePoint();
%dir = %obj.getEyeVector() //i believe getEyeVector already returns a normalised vector (normalised vector means its length is one w/e)
%add = VectorScale(%dir, %range); //%range will determine how far the raycast goes obv
%ray = containerRayCast(%eye, VectorAdd(%eye, %add), $TypeMasks::sometypehere);
%obj = firstWord(%ray);