Author Topic: Client-Sided getEyePoint() and getEyeVector()  (Read 1982 times)

Title is pretty self-explanatory, I need a way to getEyePoint() and getEyeVector() on the client side. Is this possible?

Code: [Select]
function red_getLookName()
{
%pl=red_getClient("Redoctober2009");
%ep=%pl.getEyePoint();
%ev=%pl.getEyeVector();
%obj=containerRayCast(%ep,vectorAdd(%ep,vectorScale(%ev,1024)),$TypeMasks::All,%pl);
%op=getword(%obj,0);
return %op;
}

red_getClient is not important, it just finds my Object ID.

P.S. This is NOT to make an aimbot. I don't see how it would be.
« Last Edit: February 10, 2013, 03:37:51 PM by redoctober2009 »

This has been tested, it works on the Serverside. I just need to use it client-side.

Code: (TorqueScript) [Select]
serverConnection.getControlObject().getEyePoint();
Code: (TorqueScript) [Select]
serverConnection.getControlObject().getEyeVector();

Btw you can't do raycasts client-sided.
Atleast for me they always returned 0.

Code: (TorqueScript) [Select]
serverConnection.getControlObject().getEyePoint();
Code: (TorqueScript) [Select]
serverConnection.getControlObject().getEyeVector();
Tried that, didnt work. Here's what it looked like.
Code: [Select]
function red_getLookName()
{
%ep=serverConnection.getControlObject().getEyePoint();
%ev=serverConnection.getControlObject().getEyeVector();
%obj=containerRayCast(%ep,vectorAdd(%ep,vectorScale(%ev,1024)),$TypeMasks::All,%pl);
%op=getword(%obj,0);
return %op;
}

As a test, I had it echo all of its values. %ep and %ev were undefined, %obj was 0.
Did I make a mistake?

Tried that, didnt work. Here's what it looked like.
Code: [Select]
function red_getLookName()
{
%ep=serverConnection.getControlObject().getEyePoint();
%ev=serverConnection.getControlObject().getEyeVector();
%obj=containerRayCast(%ep,vectorAdd(%ep,vectorScale(%ev,1024)),$TypeMasks::All,%pl);
%op=getword(%obj,0);
return %op;
}

As a test, I had it echo all of its values. %ep and %ev were undefined, %obj was 0.
Did I make a mistake?
Btw you can't do raycasts client-sided.
Atleast for me they always returned 0.



Ok. Do you know of another way? Or is the getEye...() stuff the problem? They both returned undefined.

You can't do raycasts client-sidedly. What you want to do is not possible without some sort of exploit.

You can't do raycasts client-sidedly. What you want to do is not possible without some sort of exploit.

Okay, so forget raycasts. Is there a way I can obtain an object's ID without using raycasts?

Okay, so forget raycasts. Is there a way I can obtain an object's ID without using raycasts?
Yes, by manually looping through all the objects in ServerConnection.

I already did that, that's what Red_GetClient does. I just need to know which is which.


You would have to get your eye point and vector, the worldboxes of all objects in serverconnection and then write some sort of raycast function yourself.

Tell us what you are trying to do, there might be a better way.

If you are trying to simulate a raycast, you would need to loop through all of the objects in the server and manipulate position and size of objects. If you want it for a certain mask you would also need to test that with getClassName(). In short, this is more difficult than you think. Raycasts shouldn't be client sided.

If you are trying to simulate a raycast, you would need to loop through all of the objects in the server and manipulate position and size of objects. If you want it for a certain mask you would also need to test that with getClassName(). In short, this is more difficult than you think. Raycasts shouldn't be client sided.

It'd be a waste of time to even attempt this.