Jump to content

Grand permission of a object in a object


Anton Hammerthall
 Share

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

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

Recommended Posts

I have a problem with Requesting Permissions. Let me explain my self.

I have a plane that is carrying a ejection seat. When you press a button the ejection seat will be placed in the world and attach to the player. The problem is that is requests permission to attach when the seat is rezzed. Is it possible to request permission when the player get in the plane?

My skills with LSL are not very good but i can program in C so i understand the basics. I can post some scrips if needed :P

Anton Hammerthall

Link to comment
Share on other sites

Certainly, if you rez the seat as soon as the person gets into the plane.  It's the script in the ejection seat that is asking permission to attach, and it can't ask until it exists.  So, sit down >> rez seat >> get permission >> attach seat >> wait for eject command >> get eject command >> eject. 

Link to comment
Share on other sites


Anton Hammerthall wrote:

The problem with this solution is that you wil get a lot of seats in your inventory. If there is a solution to fix that this might be the best solution.

Don't you have that same problem with your current method? Unless I'm missing something, you'll get extra seats in inventory that way too.   Why not make the seat temp_on_rez?  It won't vanish if you attach it before the garbage collector gets it (about a minute).  When you finally detach it, it won't go to inventory. It will simply poof out of existence.

Just out of curiosity, didn't we have this same conversation about a year and a half ago? You were working on an ejection seat with a parachute, and I think we talked through the inventory question in this forum then.  Unless I'm having deja vu .........

Link to comment
Share on other sites


Rolig Loon wrote:


Anton Hammerthall wrote:

 

Setting the temporary variable doenst work, it still gets in you inventory.

It does?   It doesn't do that for me.  When my temp rez objects die, they stay dead.   They don't get resurrected in my inventory.

Even when you detach them, as opposed to drop them on the ground?   I can't get that to work.

 

 

Link to comment
Share on other sites


PeterCanessa Oh wrote:

Is RLV an option here, so it can attach from inventory and then just detach again as required?

I suggested RLV to the OP in world, and also suggested just dropping the temp_on_rez  seat manually instead of trying to find a way to detach and kill it by script.  Either of those sounds like a decent option to me.

Link to comment
Share on other sites

the other workaround that i've used before is to have the vehicle wait for a period after rezzing, and if it doesn't receive a message from an attachment, offer the attachment to the av. the attachment rezzes invisible, and sends a message to the vehicle when attached, and only becomes visible when the vehicle sends it a message ( like when it ejects you)... and then it can go invisible again after some event (like ground collision) occurs.

with this method the attachment is never duplicated unless the avatar doesn't attach it, or accept the attachment, and the vehicle can use the lack of a message to tell if the ejection function will work as expected and decide whether or not to allow it's use.

Link to comment
Share on other sites

This is the script i made:

default{    state_entry()    {         llSitTarget(<0.0,0.0,-0.6>, <0,-0.2,0,1>);    }        touch(integer num_detected)    {            if(llGetPermissions() & PERMISSION_CHANGE_LINKS)            {                llBreakLink(LINK_THIS);                //llOwnerSay("Delinked from prim");            }            //llOwnerSay("Touched");            if(llGetPermissions() & PERMISSION_ATTACH)            {                llAttachToAvatar(ATTACH_PELVIS); //if permission is set then attach                //llOwnerSay("Attach to avatar");            }    }        changed(integer change)    {        if(change &  CHANGED_LINK)        {            key av = llAvatarOnSitTarget();            if (av)             {                llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_CHANGE_LINKS  | PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION);                   }        }    }        run_time_permissions(integer perm)    {        if(perm & PERMISSION_ATTACH)        {             llOwnerSay("Attach set"); //for testing purposes        }        if(perm & PERMISSION_CHANGE_LINKS)        {             llOwnerSay("Link set"); //for testing purposes        }    }        attach(key Av)    {        integer perm = llGetPermissions();        if(Av)        {            llSetStatus(STATUS_PHYSICS , TRUE);             llStopAnimation("stand");            llStartAnimation("sit");            llOwnerSay("Attached"); //for testing purposes            llPushObject(Av, <0,0,50>, ZERO_VECTOR, FALSE);        }        else        {            llStopAnimation("sit"); //on drop/detach stop animation and die()            llStartAnimation("stand");            llDie();         }    }}

 It delinks the seat and attach to the pilot. The permissions wil be ask when the pilot gets in the seat 

 

Link to comment
Share on other sites

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