About PhantomChild
|
|
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
|
04-06-2009 05:35
I'm using PhantomChild ( http://wiki.secondlife.com/wiki/Phantom_Child ) to make parts of an object (houses) phantom and it really works great but..... The script needs sometimes a reset e.g. after a SIM-reset. So I started with a timer checking each 5 minutes..... Somehow that wasn't the best solution. Then I realised that a phantom prim doesn't raise a collision but a non-phantom does..... //Phantom Child Script by Aeron Kohime //WARNING: When used on the root prim it makes the entire object phantom, it // also does not function correctly on tortured prims. (Sorry.) //Reset on Sim restart added by Void Singer //Strife Onizuka was here doing simplification default { state_entry(){ if (llGetLinkNumber()==1) { //This script should not be in the rootprim llOwnerSay("The phantom prim would be the root. Script PhantomChild removed."); llRemoveInventory(llGetScriptName()); } else { llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, 0, <0,1,0>, 0, <0,0,0>, <1,1,0>, <0,0,0>, PRIM_FLEXIBLE, TRUE, 0, 0, 0, 0, 0, <0,0,0>, PRIM_TYPE] + llGetPrimitiveParams([PRIM_TYPE])); } } on_rez(integer s){ llResetScript();} changed(integer change){ if (change & CHANGED_LINK) { llResetScript(); } } collision(integer num_detected){ llResetScript(); } }
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-06-2009 10:17
why not just use the changed event I had in there? CHANGED_SIM_START works for any time the sim (re)starts, not just the initial start of the sim (which would be silly since a newly started sim shouldn't have content)... also not sure what are you doing with the CHANGED_LINK, does modifying the link set make the child prim solid again? if so you could use... if ((CHANGED_LINK | CHANGED_REGION_START) & vBitChanges){ llResetScript(); }
.. and save youself an extra event (which may not get triggered if it's not touching or colliding with something)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
04-06-2009 13:21
From: Void Singer if ((CHANGED_LINK | CHANGED SIM_START) & vBitChanges){ llResetScript(); }
CHANGED_REGION_START???
_____________________
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
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-06-2009 13:37
lol, er yeah.... that ::facepalm::
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
04-06-2009 14:05
From: Jesse Barnett CHANGED_REGION_START??? http://wiki.secondlife.com/wiki/CHANGED_REGION_STARTIf it's not live yet, someone who knows how wiki's work, should probably note that somehow,. Without actually trying it, this page makes it look like a genuine, active lsl constant to me.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-06-2009 16:34
no, I mistyped it as CHANGED_SIM_START in the original post... she was correcting me (see my edit comment)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
|
04-07-2009 10:12
I still get a compiler error using CHANGED_SIM_START and CHANGED_REGION_START (Second Life Server 1.25.6.113484). I'm not sure a sim restart is the only thing that needs the script to restart, so now I only restart it when the chilldprim is not phantom. Why the restart if if (change & CHANGED_LINK)? If someone links an extra prim to the object or unlinks a prim I want to be sure this still isn't the root prim.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-07-2009 22:26
hmm the constant certainly isn't in the compiler, but I wonder if the actual value works (0x400).. it wouldn't surprise me if it's live on the server, but not on the client, but I can't even be positive if it's live or not.. thought it was... now I'm not so sure... and I have no way to test.
if it isn't live, I'm relieved not to be the only one to miss it (although the other person has a better excuse) suppose I should backtrack the edit and just leave the note on the discussion page for now.
ETA: I'm guessing it'd also be undesirable in a single prim application for you, in which case you might change if (llGetLinkNumber() == 1){ to if (llGetLinkNumber() < 2){
I'm not sure it'd behave if the root was unlinked an this child became the new root (would the whole object go phantom? does only this prim remain phantom? does the link change undo it's phantomness? if so does it happen even if this prim isn't the new root? heck can you even unlink the root!?! gah I hate my ISP right now)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|