Jump to content

Transparent & Phantom On Click (Vehicle Door)


Black Vortex
 Share

You are about to reply to a thread that has been inactive for 3868 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts


xRiViTx wrote:

How would I go about scripting a door that turns phantom and transparent on click? I don't want it on a timer, though. The way it should revert back is upon click again. This is for a horse-drawn carriage. Thanks.

Use the touch_end or touch_begin event to trigger the action with a boolean variable toggled each time to keep track of the action. llSetLinkPrimitiveParamsFast (https://wiki.secondlife.com/wiki/LlSetPrimitiveParams) would probably be your best bet for setting the parameters of your prim.

Link to comment
Share on other sites

You can't set individual prims to phantom -- it's the whole linkset or nothing.

What you can do, though, is set PRIM_PHYSICS_SHAPE_TYPE to PRIM_PHYSICS_SHAPE_NONE using llSetLinkPrimitiveParamsFast, so long as it's a child prim in a linkset.  A root prim or an unlinked prim can't be NONE.

This, of course, is going to take you into the mesh accounting system, if you're not already using it.   That's no bad thing, but be aware that you can end up with silly LI figures if you're not careful.

I would very strongly suggest doing your experiments on a sandbox, and starting by setting the whole object to Convex Hull (the big problems come if you leave prims -- particularly cut and tortured toruses and spheres -- as Prims).   Then, if the LI is unacceptable, see about setting individual prims, at least cut and twisted ones, to None too, if you can (obviously you can't with the wheels, but with decorations you probably can).

Link to comment
Share on other sites

I think scaling the prim  and offseting it would be a  lot  easier and direct it to specific prims in the linkset. I know it has a timer in it, it's just an example an and be for specific prims in the linkset. 

//A basic door that opens and closes when an avatar collides with it.//Not very effective, as it would be better to use llSetStatus(STATUS_PHANTOM, 1)...//But, it works.vector startingSize;default {     state_entry() {          startingSize = llGetScale();     }     collision_start(integer i) {          llSetScale(<0.1, 0.1, 0.1>); //Shrink          llSetPos(llGetPos() + <0.0,0.0,10.0>); //Hide us ADDED Could only get this to work on other prims was llGetLocalPos()          llSetTimerEvent(3.0);     }     timer() {          llSetTimerEvent(0.0);          llSetScale(startingSize); //Go back to normal size          llSetPos(llGetPos() - <0.0,0.0,10.0>); //And where we started     }} //Code by Xaviar Czervik.

 ADDED: 

  • This function only changes the size of the prim that the script is in. Not the entire object.
  • If the prim is part of a link set, rescaling will fail if the new size is too large or small to satisfy the linkability rules.
  • Does not work on physical prims.
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3868 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...