Jump to content

Desk Checking:Trap Door?


amarock Amat
 Share

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

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

Recommended Posts

The problem is that afetr you collide with the object, you collide with it again to test it and it goes phantom again. That's what you wrote the script to do.  Try this:

 

default
{
    state_entry()
    {
        llSetStatus (STATUS_PHANTOM, FALSE);
        llWhisper(0,"default...");
    }
    collision_start(integer total_number)
    {
         llWhisper(0,"collision...");
        state trap;
    }
}

state trap
{
    state_entry()
    {
        llSetStatus (STATUS_PHANTOM, TRUE);
        llWhisper(0,"sleeping...");
        llSleep (5);
        llWhisper(0,"awake...try to collide with me now.");
        llSetStatus (STATUS_PHANTOM, FALSE);

        llSleep(10);      //In 10 seconds it will go phantom if you try again
        state default;
    }
}

Link to comment
Share on other sites

You may run into another issue with making this work well as a trap door.

Until they move again, their avatar is going to ignore the fact that the floor just went phantom under them.

I tried once to make a moving trap door. I scripted a door in the floor, set to listen for a chat command so I could 'spring the trap' when someone was standing on it. The trap door opened right on cue, the door swung down into the pit to lie along one wall of the hole, and the avatar was centered right over the hole.

And the avatar stood there in mid air, like a character in a Road Runner cartoon, oblivious to the fact that there was no floor beneath them.

If they did move, there was a good chance that they could go far enough forward to end up on the floor at the rim of the pit, instead of falling into it.

If you stand on a prim in mid air, and then delete the prim, you get the same effect. Until you try to move, you remain standing there in mid air.

In my case, I 'solved' it by placing seat cushions on the trap door, and inviting the potential victims to kneel on them, in front of the throne. With them seated on a prim that was attached to the trap door, they moved with it, into the pit. The trap door unsat them as soon as it opened, and then it closed again, leaving them falling, since the unsit requires checking for a surface to stand on.

If you do run into that problem with the phantom trap door, you might want to consider raising a 100% alpha, non-phantom barrier around the pit opening when the floor prim goes phantom. Then, if they try to move forward, their movement will be blocked long enough to ensure that they do fall into the pit.

You could also get fancy and use a second collision detect prim inside the pit, to reset the trap only after something has fallen into the pit.

Link to comment
Share on other sites

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