Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Feeling dumb... help? :D

Syndel Daviau
Registered User
Join date: 17 Apr 2007
Posts: 38
07-19-2009 15:59
Uh... I am using LockGuard V2 in something that I am building. It works great, rezzes the particle chains and all that... but when I hop off of the poseball, I continue attached to the chain and I really do not know how to make it stop the chain particles once no longer posed.
I know it is probably something super silly.... but I do not know how to script :D
If you could please IM me in-world I would be forever thankful!
Tali Rosca
Plywood Whisperer
Join date: 6 Feb 2007
Posts: 767
07-19-2009 16:02
llParticleSystem([]);
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
07-19-2009 16:47
It's more complicated than just llParticleSystem([]);, I am afraid.. when Syndel gets off the poseball it has to tell all the anchor points she's got off, and they then have to tell all the particle emitters in her cuffs and collar to set llParticleSystem([]); in response to the message.

The lockguard protocol is at http://lslwiki.net/lslwiki/wakka.php?wakka=ExchangeLockGuard

The way I do it with Lockguard is, in the poseball, have this fragment
CODE

changed(integer change)
{
if (change&CHANGED_LINK){
avatar = llAvatarOnSitTarget();
llMessageLinked(LINK_ALL_OTHERS, 0, password, avatar);//send message to lg scripts -- this example assumes we're a linkset
// the rest is nothing to go with chains -- feel free to do your own stuff to start and stop the anim
if (avatar !=NULL_KEY)//someone's sat on me
{
llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
}
else{//someone's got off
perm=llGetPermissions();
if ((perm & PERMISSION_TRIGGER_ANIMATION) && llStringLength(anim)>0)
llStopAnimation(anim);
llSetAlpha(1.0, ALL_SIDES);
}

}

and in the anchor points, the whole script is
CODE
string point = " collarfrontloop "; //remember spaces at both sides
string password = "chains"; //arbitrary password so i ignore any other link messages that may be flying round the linkset
////
key avatar;
string me;

default
{
state_entry()
{
me = llGetKey();
}

link_message(integer sender_num,integer num, string str, key id)
{
if(str == password)//arbitrary check so i ignore any messages not meant for me
{
if (id!=NULL_KEY)//the message is that someone's sat on me, so
{
avatar = id; // grab key for later use
//and say which lockguard attachment should send me a chain
llWhisper( -9119, "lockguard " + (string)avatar + point +" texture rope size 0.05 0.05 link "+ me );
}
else //id must be null key, so someone's got off
{ //so tell their lockguard attachment turn off the chains
llWhisper( -9119, "lockguard " + (string)avatar + point + " unlink " + me );
avatar = NULL_KEY;
}
}

}
on_rez(integer p)
{
llResetScript(); // so my key refreshes when i'm rezzed
}
}

Syndel Daviau
Registered User
Join date: 17 Apr 2007
Posts: 38
07-19-2009 19:35
MMm I got nothing on the poseball....

The only script I have is in the hook above the poseball... and it is this one:

----------------------------------

default
{

touch_start( integer num )
{

llWhisper( -9119, "lockguard " + (string)llDetectedKey(0) + " wrists life 1 size 0.05 0.05 link " + (string)llGetKey() );

}

}

----------------------------------

It rezzes the chains perfectly fine... but, like I said... doesn't stop rezzing them when I walk away :D


And I have in the same hook the Configuration Notecard saying
ID leftwrist
ID rightwrist
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
07-19-2009 19:47
You need to change link to unlink to make the particles stop, which means you also need a bit of switching code to manage the on/off. Here's the relevant code fragment:

.
.
integer lg_status = FALSE;
.
.
default
{
.
.
touch_start(integer num_detected)
{
if (lg_status == FALSE) {
lg_status = TRUE;
// put in your link statement here
}
else {
lg_status = FALSE;
// put in your unlink statement here
}
.
.
}
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
07-20-2009 00:10
Yeah, the unlink statement should be, in your example,
CODE
llWhisper( -9119, "lockguard " + (string)llDetectedKey(0) + " wrists unlink " + (string)llGetKey() );
In practice, particularly if there are several link points, I think you may find it's a lot more convenient to have the chains controlled by the poseball and start and stop automatically in response to link messages or whispers than for the end user to do it manually.
Tali Rosca
Plywood Whisperer
Join date: 6 Feb 2007
Posts: 767
07-20-2009 04:47
Ah, sorry, I half misread the question and assumed all the link checking and message passing was already in place, and it was just a matter of the actual particle command.