Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Chromotography thingamabover

Zeta Eizenstark
Registered User
Join date: 20 Aug 2008
Posts: 79
12-19-2008 12:25
Well, I don't how much chromotography people know here, but really, it's not necessary to know since i don't know much either. I'm trying to make a prym detect when its touched by another prym. When it does it rezes some kind of bar graph with the amount of detected pryms. The one that i have right now makes the prym thats detecting a phantom, is there anyway around this. I have an attraction script in it too and the prym keeps going back and forth on it and I have the collision script set to say "ouch";(for testing purposes) when things colide with it, so it keeps saying "ouch". Thanks in advance to any help.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
12-19-2008 12:40
From: Zeta Eizenstark
The one that i have right now makes the prym thats detecting a phantom, is there anyway around this.


llSetPrimitiveParams([PRIM_PHANTOM, FALSE]);
Zeta Eizenstark
Registered User
Join date: 20 Aug 2008
Posts: 79
12-22-2008 09:14
I've tried putting it in the collision_start() function and in a state_entry() function but things still go through it. And now it doesn't even give me the "ouch" when things touch it.
heres the sample code I have:

[/code]
default
{
state_entry()
{
llSetPrimitiveParams([PRIM_PHANTOM,FALSE]);
}

collision_start(integer totalNumber)
{
llSetPrimitiveParams([PRIM_PHANTOM,FALSE]);
integer i = 0;
if(llDetectedName(i) == "electron";)
{
llShout(0, "OUCH";);
}
}
}
[/code]

I also have a attraction script on the same prim, I don't know if it matters but, here it is

[/code]
float ATTRACTIVE_CONSTANT = 0.0;
float SENSOR_PERIOD = 0.1;

default
{
state_entry()
{
llSetPrimitiveParams([PRIM_PHANTOM,FALSE]);
string objName = "electron";
llSetStatus(STATUS_PHYSICS | STATUS_SANDBOX, TRUE);
llSensorRepeat(objName, NULL_KEY, SCRIPTED, 96.0, PI, SENSOR_PERIOD);
}

sensor(integer nDetected)
{
vector totalForce = ZERO_VECTOR;
integer i;
for (i = 0; i < nDetected; ++i)
{
vector r = llDetectedPos(0)-llGetPos();
float rLen = llVecMag(r);
vector f = ATTRACTIVE_CONSTANT*r/(rLen*rLen*rLen);
totalForce += f;
}
llSetForce(totalForce, FALSE);
}

no_sensor()
{
llSetForce(ZERO_VECTOR, FALSE);
}
}
[/code]
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-22-2008 09:47
Have you tried turning off volume dectect also? llVolumeDetect(FALSE) should turn it off if it was ever turned on for the object.
Zeta Eizenstark
Registered User
Join date: 20 Aug 2008
Posts: 79
12-22-2008 10:50
thanks, it isn't sinking anymore, but it still wont say ouch when the "electrons" touch it.

*edit* ok...well that was my fault. The script wasn't running. :P
everything is working right...for now.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-22-2008 14:17
llVolumeDetect sets phantom on the prim when used and the phantom is PERMANENT and can not be undone. Also llVolumeDetect remains in effect, even if that particular script changes or is deleted, as long as there is one script in the prim, ANY script.

Either delete the prim and start over again or you could try shift copying the prim. Not sure if shift copying will correct it.
_____________________
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
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-22-2008 14:59
From: Jesse Barnett
llVolumeDetect sets phantom on the prim when used and the phantom is PERMANENT and can not be undone. Also llVolumeDetect remains in effect, even if that particular script changes or is deleted, as long as there is one script in the prim, ANY script.

Either delete the prim and start over again or you could try shift copying the prim. Not sure if shift copying will correct it.

I don't believe that is true. You can't get the object to be physical again by turning off the "phantom" checkbox from the Edit Window (which I believe the UI keeps setting back to checked) or with STATUS_PHANTOM, but I believe once you turn off llVolumeDetect() it can be made solid again (WILL be solid again unless phantom was ALSO turned on).
Zeta Eizenstark
Registered User
Join date: 20 Aug 2008
Posts: 79
12-23-2008 09:48
Thats really good info, thanks.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-23-2008 10:19
From: Hewee Zetkin
I don't believe that is true. You can't get the object to be physical again by turning off the "phantom" checkbox from the Edit Window (which I believe the UI keeps setting back to checked) or with STATUS_PHANTOM, but I believe once you turn off llVolumeDetect() it can be made solid again (WILL be solid again unless phantom was ALSO turned on).

Test it.
_____________________
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
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-23-2008 16:43
From: Jesse Barnett
Test it.


Okay. Tested. Object becomes solid just fine. Just stick this in a box:

CODE

integer volumeDetectOn = FALSE;
string volumeDetectOnStr = "off";

default
{
touch_start(integer nDetected)
{
if (volumeDetectOn)
{
llVolumeDetect(FALSE);
llSetStatus(STATUS_PHANTOM, FALSE);

volumeDetectOn = FALSE;
volumeDetectOnStr = "off";
} else
{
llVolumeDetect(TRUE);
llSetStatus(STATUS_PHANTOM, FALSE);

volumeDetectOn = TRUE;
volumeDetectOnStr = "on";
}

llOwnerSay("Volume detect turned "+volumeDetectOnStr);
}

collision_start(integer nDetected)
{
llOwnerSay(
(string)nDetected+
" collision starts with volume detect "+
volumeDetectOnStr);
}

collision_end(integer nDetected)
{
llOwnerSay(
(string)nDetected+
" collision ends with volume detect "+
volumeDetectOnStr);
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-23-2008 16:55
Yep, I tested when I got home this afternoon but then was sidetracked with the from/select bug and jira. So it was just outdated info in my old wiki.
_____________________
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