Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Having an issue with llDetectedVel

Ragar Desoto
The Insane Multitasker
Join date: 29 Apr 2006
Posts: 18
02-03-2008 13:30
Alrighty, I have been having this issue for quite awhile now, and I have searched around several places where I might be able to get help on it. But still, I have not found a solution, what is highly confusing me:
collision(integer collide)
{
integer i;
for(i=0;i<collide; i++)
if(llDetectedVel(i) >= vel)

this line of code here, if(llDetectedVel(i) >= vel), gives a type mismatch, either way I put it, I have tried the following ways of doing this script:

if(llGetVel() >= <1,1,1>;)
if(llDetectedVel(i) >= <1,1,1>;)
if(llDetectedVel(i) >= (vector)<1,1,1>;)
if(llDetectedVel(i) >= llGetVel())
Though it doesn't logically make sense to me that it should give this error, for I do not see how a function that returns a vector could not work with this if statement. and yes I have defined vel. Any help on this subject would be greatly appreciated.

Thanks!
Ragar Desoto
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-03-2008 13:41
You cannot compare vectors with inequality operators (<, >, <=, >=). It doesn't make any sense. You can get the MAGNITUDES (lengths) of the vectors and compare them though. For example, 'if (llVecMag(vector1) >= llVecMag(vector2)) {...}'.
Ragar Desoto
The Insane Multitasker
Join date: 29 Apr 2006
Posts: 18
02-03-2008 13:45
Aaah, I see my error there, ok ill try out that way. Thank you. : )