Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

no message on detach, only on wrong point

Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
11-05-2008 22:49
i'm trying to script an attachment to adjust it's position and rotation, depending on the attachment point. i got that working just fine, however i want to do an owner say message if it's on a point other than the ones desired. great, except it also says the message on detach. how do i keep it from saying it on detach?
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
11-05-2008 23:00
nevermind, i figured it out. i created a list of integers from the correct points and also detaching being 0, and compared the current point to that list. stopped the message upon detach. IE:

list points = [0,2,17];

and then in the attach function i put this

else if (llListFindList(points,[point]) == -1)
{
llOwnerSay("I need to be worn on either your nose or skull to fit properly";);
}
}
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
11-06-2008 16:05
Hi there Ruthven,

Wouldn't the following do it? (i haven't tried it)

CODE

attach(key id) {
if(id) {
llOwnerSay("something");
}
}


regs,
/esc
_____________________
http://slurl.com/secondlife/Together
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
11-06-2008 16:28
not sure what you mean. i had it like this:

if (attachpoint == 2)
;//do something
else if (attachpoint == 17)
;//do something else
else
llOwnerSay("I need to be worn on either your nose or skull to fit properly";);


but, it was saying it upon detach even if it was on one of the correct attachment points, so listing 0 in the list of attachpoints keeps it from saying it upon detach. i already have it set to detach if it's on an incorrect point, but it was giving me a double message. (once on detecting the wrong point, and then again when it detaches because it was on the wrong point)
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Cappy Frantisek
Open Source is the Devil!
Join date: 27 Oct 2006
Posts: 400
11-06-2008 17:50
From: Ruthven Willenov
not sure what you mean. i had it like this:

if (attachpoint == 2)
;//do something
else if (attachpoint == 17)
;//do something else
else
llOwnerSay("I need to be worn on either your nose or skull to fit properly";);


but, it was saying it upon detach even if it was on one of the correct attachment points, so listing 0 in the list of attachpoints keeps it from saying it upon detach. i already have it set to detach if it's on an incorrect point, but it was giving me a double message. (once on detecting the wrong point, and then again when it detaches because it was on the wrong point)


The attach function happens on detach also.

Event: attach( key id )Triggered when an object attaches or detaches from agent.

• key id – the avatar if attached, if not attached NULL_KEY.

You may need to reread the wiki:

http://wiki.secondlife.com/wiki/Attach