I'm trying to make %pos rotate based on %col's rotation. I took the angle code from I think greek2me's forum post.
%curAim = %col.getEyeVector();
%curX = getWord(%curAim,0);
%curY = getWord(%curAim,1);
%curZ = getWord(%curAim,2);
%theta = mRadToDeg(mATan(%curY,%curX));
if(%curX > 0 && %curY > 0)
%angle = %theta;
else if(%curX < 0 && %curY > 0)
%angle = 180 - %theta;
else if(%curX < 0 && %curY < 0)
%angle = %theta + 180;
else if(%curX > 0 && %curY < 0)
%angle = 360 - %theta;
talk(%angle);
%lastAngle = %col.lastAngle;
if(%lastAngle !$= "") {
%col.lastAngle = %angle;
%diff = %lastangle - %angle;
%s = mSin(%diff);
%c = mCos(%diff);
%px = getWord(%pos, 0);
%py = getWord(%pos, 1);
%ox = getWord(%col.getHackPosition(),0);
%oy = getWord(%col.getHackPosition(),1);
%nx = %c * (%px - %ox) - %s * (%py - %oy) + %ox;
%ny = %s * (%px - %ox) + %c * (%py - %oy) + %oy;
%pos = %nx SPC %ny SPC getWord(%pos,2);
%obj.GrappleRopePos = %pos;
}
else {
%col.lastAngle = %angle;
}
right now it just spazzes out.