Jump to content

Setting an object as physical


Jade Tachikawa
 Share

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

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

Recommended Posts

Hi there,

 

I have a project at the moment to script a boat that is over 100 prims. I am trying to use the trick where you make everything apart from the base, physical shape none.

 

I'm trying to use this code but get an error saying it can't set the object as physical because its greater than 32 prims. If I do it manualy, it works.

 

llSetLinkPrimitiveParams(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]);
llSetLinkPrimitiveParams(LINK_ROOT, [PRIM_PHYSICS, TRUE]);

Is there a way to script this as leaving the shape set to none means you can walk through the boat.

 

J

Link to comment
Share on other sites

The only thing that springs to mind is that in the past I have found that using LINK_ALL_CHILDREN seemed to hit a 'throttle' so that the prim paras were not applied to the whole set.

Not sure if thats the case here but to work around that I used a counter to iterate through the linked prims to set individually (using the *Fast version of set paras to avoid the delay ).

 

Link to comment
Share on other sites

Hi there,

 

Thanks I'll check to see if thats happening. I've tried using the fast version but got the same results and was thinking that maybe the code was being returned before the object flag had been changed (like it says on the Wiki).

 

What about putting a listening script in each prim? Would that create a lot of lag?

 

J

Link to comment
Share on other sites

I am not completely sure whether you want to set the root prim to PRIM_PHYSICS, TRUE because you want to sail the boat, or if you simply want to set the child prims to PRIM_PHYSICS_SHAPE_NONE so you can walk around your boat, and you've found you can't set the root to PRIM_PHYSICS_SHAPE_NONE.

Either way, this certainly works for 100 prims (I've just tested it):

 

default{    state_entry()    {       integer max = llGetNumberOfPrims()+1;       do {           llSetLinkPrimitiveParamsFast(max,[PRIM_PHYSICS_SHAPE_TYPE,PRIM_PHYSICS_SHAPE_NONE]);        }        while(--max>1);        llSetLinkPrimitiveParamsFast(1,[PRIM_PHYSICS_SHAPE_TYPE,PRIM_PHYSICS_SHAPE_CONVEX]);        llSetLinkPrimitiveParamsFast(1,[PRIM_PHYSICS,TRUE]); //comment out if not needed            }}

 

 ETA  I see there's a caveat buried deep in the notes to llSetLinkPrimitiveParamsFast to the effect that you can't use LINK_ALL_CHILDREN to change PRIM_TYPE for more than 10 prims at once, so it looks like the same applies to PRIM_PHYSICS_SHAPE_TYPE, too.

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3351 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...