Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

weird behaviour with link message

Mobius Hashimoto
Registered User
Join date: 18 Aug 2006
Posts: 146
10-09-2006 13:36
Hi guys, i'm trying to do door open/close with link message and for some reason it keeps on doing it twice, i don't know why this is happening, it never happened before

THis is what i have for the pressing prim
touch (integer num) {
llMessageLinked(LINK_SET, 0, "", "";);
}

in the opening prim

link_message(integer link, integer num, string str, key id) {
//open/close door
}

its doing both the open and close, but SOMETIMES it only does open or close, for some reason its doing the link_message twice but i've only pressed once

can anyone point out what i did wrong? much appreciated. thanks
Mobius
_____________________
Project Mobius - Web/Graphic Design and Tech Reviews

Please check out my items @

Blog about games, gadgets & technologies @
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
10-09-2006 13:49
I believe the issue is you're calling the open/close message with the touch event. it's my understand that this message will keep on being broadcast as long as someone is touching the object. what you want is the 'touch_start' event- this will be broadcast only when someone begins to touch an object.

CODE

touch_start (integer num)
{
llMessageLinked(LINK_SET, 0, "", "");
}

in the opening prim

link_message(integer link, integer num, string str, key id)
{
//open/close door
}



P.S, using PHP tags on the forums makes code much easier to read :)
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Mobius Hashimoto
Registered User
Join date: 18 Aug 2006
Posts: 146
10-09-2006 14:17
Thanks! it works, and i will use PHP next time. :)
_____________________
Project Mobius - Web/Graphic Design and Tech Reviews

Please check out my items @

Blog about games, gadgets & technologies @