Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Trouble Getting the Sitter's Key

Kristov Nikolaidis
Registered User
Join date: 16 Apr 2007
Posts: 16
05-07-2007 13:22
I have been racking my brain and the wiki trying to figure out what is wrong with this code. It all looks great to me, but everytime I get a NULL_KEY from llAvatarOnSitTarget().
Does anybody see what my silly mistake is?


<CODE>

debug(string s){
llOwnerSay(s);
}



default{
state_entry(){
state Vacant;
}
}


state Vacant{
state_entry(){
debug("Vacant";);
llSitTarget(<0,0,0>, llEuler2Rot(<0,PI/2,0>;));
}

changed(integer c){
if(c & CHANGED_LINK){
key k = llAvatarOnSitTarget();
debug("K:|" + (string) k + "|";);
}
}
}
</CODE>
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-07-2007 13:25
You can use [ php] and [/php] to make code format nice on the forums..

Try giving a non-zero vector for the sit position. Doesn't have to be far from zero, just non-zero.

CODE

debug(string s){
llOwnerSay(s);
}



default{
state_entry(){
state Vacant;
}
}


state Vacant{
state_entry(){
debug("Vacant");
llSitTarget(<0,0,0>, llEuler2Rot(<0,PI/2,0>));
}

changed(integer c){
if(c & CHANGED_LINK){
key k = llAvatarOnSitTarget();
debug("K:|" + (string) k + "|");
}
}
}
_____________________
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
Kristov Nikolaidis
Registered User
Join date: 16 Apr 2007
Posts: 16
It worked :)
05-07-2007 13:33
Well, that fixed it. Can you tell me why that fixed it?
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-07-2007 13:40
llSitTarget clears the target if the position vector is zero and llAvatarOnSitTarget will always return NULL_KEY if there's no sit target..

http://wiki.secondlife.com/wiki/LlSitTarget
_____________________
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
Kristov Nikolaidis
Registered User
Join date: 16 Apr 2007
Posts: 16
uggh
05-07-2007 13:42
I knew it had to be something stupid. Thanks alot.