Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simple question. Activating an event upon collision.

Hanumi Takakura
Registered User
Join date: 24 May 2006
Posts: 57
09-07-2007 17:29
Hello. I'm trying to get an object that has llVolumeDetect enabled to generate an event. The object should only activate it's collision event upon touching certain object. I tried the code below.

collision_start(integer total_number)
{
string name = llDetectedName(0);
if(name == "Target Object";);
{
event();
}
}


Of course, "Target Object" is an in-world object and the name is the exact same as the one in the code. Caps and all. But. problem is. Using llVolumeDetect, the object that should generate collision events doesnt do anything. Also, if I turn off llVolumeDetect and put phantom off, the object activates it's event no matter what it touches. What I'm missing here?
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
09-07-2007 17:37
was the object phantom before you enabled llVolumeDetect?

"The object can NOT be set to phantom by any other means, or else llVolumeDetect will not work. llVolumeDetect will set phantom automatically."
Hanumi Takakura
Registered User
Join date: 24 May 2006
Posts: 57
09-08-2007 08:27
From: someone
was the object phantom before you enabled llVolumeDetect?


Hmmm. Good question. I'll see if it was, or wasn't. I'm not really sure. At least this guides me somewhere. Thanks. Now, to see why the event is still triggered by anything and not what I tell it to do.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
09-08-2007 09:03
the ; after your "if" - its ends the if, and everything in what eould be your "run if true" brackets is run.
Hanumi Takakura
Registered User
Join date: 24 May 2006
Posts: 57
09-08-2007 09:14
ugh. yea. Your right. I added an extra ";"
Your eyes are blessed Jillian. ^^
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
09-08-2007 09:15
From: Hanumi Takakura
ugh. yea. Your right. I added an extra ";"
Your eyes are blessed Jillian. ^^
Not blessed, just that I make that mistake so often it's one of the first things I look for =^.^=
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-08-2007 10:02
Hanumi,

Always great to see people getting into scripting. I would suggest you make use of one of the outside editors. LSLEditor didn't pick up the mistake but Scite-EZ picks it up immediately with the comment:

From: someone

>"C:\Program Files\SciTE-ez\lsl\lslint.exe" "temp.lsl"
WARN:: (101, 13): Empty if statement.
TOTAL:: Errors: 0 Warnings: 1
>Exit code: 0 Time: 0.214


Plus of course it makes scripting easier when you can have multiple tabs of reference scripts open at the same time.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Hanumi Takakura
Registered User
Join date: 24 May 2006
Posts: 57
09-08-2007 10:25
Nice little apps. Been scripting for a while now. But I always use the in-word editor. I'll give it a try at one of these programs. Will make my life lots easier. :)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-08-2007 10:44
Since I have lslint.exe integrated into Scite-EZ I always forget that you can also just go here and paste in your script and have it analyze it:

http://w-hat.com/lslint/
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Hanumi Takakura
Registered User
Join date: 24 May 2006
Posts: 57
09-08-2007 11:27
Great to know. Thanks all for the help.