Jump to content

Triggering A Sit Action


Malestorm1488303118
 Share

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

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

Recommended Posts

I am working on another application but have come run into a common scriping limitation that I konw there must be a way around.     In a script I need to tigger a SIT action from a prim that has already been touched,     I know this can be done because I have found a product in the marketplace that does this, though it is not the application I need.   Altenatively, it would also be OK if I could associate sit processing with a touch, becuase it is possible to pass a touch action (just not SIT, Pay, etc).

 

Many Thanks in advance for your assistance.

Link to comment
Share on other sites

Well you don't need a own state for a "sit".

Maybe you mean changing click action? llSetClickAction..

Or do you mean he person sits after touching it (with no sit action)? that would require RLV then though

Link to comment
Share on other sites

Is this the sort of mechanism you mean?

 

default{    state_entry(){        llSitTarget(<0.0,0.0,0.25>,ZERO_ROTATION);//need a sit target for the changed event in the next state to work        llSetClickAction(CLICK_ACTION_TOUCH);    }    touch_start(integer total_number)    {        llSay(0,"Touched");    }    touch_end(integer total_number)    {//nb -- if you want to change states in a touch action, DONT use touch_start --        //if you do, the first touch action in the new state won't fire        state next;    }}state next{    state_entry()    {        llSetClickAction(CLICK_ACTION_SIT);    }    changed(integer change){        if(change & CHANGED_LINK){            if(llAvatarOnSitTarget()==NULL_KEY){//when someone gets up                state default;//back to default            }        }    }}

 

ETA: If you do want to force sit people as part of a touch event, then you (and they) need RLV.    Assuming you want it to work on anyone wearing an active RLV Relay rather than just the owner of the object, the basic syntax is

 

integer rlvrc = -1812221819; //the channel, by convention, all rlv relays usestring arbitrary_indentifier = "sit"; //part of the rlv syntax -- doesn't do anything in this example but has to be theredefault{    state_entry(){        llSitTarget(<0.0,0.0,0.25>,ZERO_ROTATION);//need a sit target pr the RLV won't work    }    touch_start(integer total_number)    {       llSay(rlvrc,arbitrary_indentifier+","+(string)llDetectedKey(0)+",@sit:"+(string)llGetKey()+"=force");    }}

 The toucher's relay processes the rlv command and makes the toucher sit on the prim (which has to have a sit target).   You can have other stuff happen either in the touch event or the changed event when the avatar sits.   

 

Link to comment
Share on other sites

Sorry, I was trying to simplify my request to it's essence, but let me describe what I am trying to do.

I have two prims.   The main prim has transporter logic and a texture of a map of various locations in a sim.   The child prim is an invisible grid that sits over the map.   When touched, the child prim tells the main prim the area that has been touched. Now  I would like the main script to be able to trigger a sit action so that the user can be teleported to requested location (without have to click again to transport).

 

 

Link to comment
Share on other sites

what you'll need to do is is have a sit target defined for the invisible prim, and have the transport logic in there. the calculations should be fast enough that the time it takes to figure out where to move to (or move the av to depending on the logic) is unnoticeable.

this will limit you to methods that move the invisble prim, (set pos, warpPos, posJump, or physics like llMoveTotarget), or seting the avatars position as if they were a prim.

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...