vector test1 = <1.0,1.0,1.0>;
vector test2 = <2.0,2.0,2.0>;
default
{
state_entry()
{
if(test1 < test2){
llSay(0,"works"
;}
}
}
i'm new ti this, whats wrong?
These forums are CLOSED. Please visit the new forums HERE
vector in an if statement? |
|
|
Mushroom Wobbit
Registered User
Join date: 13 Mar 2008
Posts: 20
|
04-16-2008 14:04
this code breaks...
vector test1 = <1.0,1.0,1.0>; vector test2 = <2.0,2.0,2.0>; default { state_entry() { if(test1 < test2){ llSay(0,"works" ;} } } i'm new ti this, whats wrong? |
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
04-16-2008 14:18
you could say something like...
if (test1.x < test2.x && test1.y < test2.y && test1.z < test2.z) ...if you wanted to. Not sure that that's the logic you're looking for, though. _____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224 - If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left |
|
Mushroom Wobbit
Registered User
Join date: 13 Mar 2008
Posts: 20
|
04-16-2008 14:20
you could say something like... if (test1.x < test2.x && test1.y < test2.y && test1.z < test2.z) ...if you wanted to. Not sure that that's the logic you're looking for, though. oh thank you! |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
04-16-2008 14:45
Or you could do
if(llVecMag(test1) < llVecMag(test2)) _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
04-16-2008 15:21
CODE vector test1 = <1.0,1.0,1.0>; _____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
04-16-2008 15:31
Heck! Beat me to the punch Strife! I had quite a few scripting tips threads open and never refreshed that one to see you had already answered it
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |