Jump to content

Object Opens another Objects menu on rez?


xdirtylittlesecretx
 Share

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

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

Recommended Posts

Long time viewer of the community forums but first time poster.

Not so much needing help with writing a script, more so in need of confirmation if something is doable or not! :smileytongue: 

thank you in advance for any help!

 

So we have lets say "Object A" Rezzed out in world and I was wondering if it was at all possible to rez another Object (Object B) either to wear or in world. As soon as object B is rezzed it scans the area for the name of object A (or possibly even the scripts name inside A) and when object B finds object A in world it brings up its menu (as if Object A had been clicked as normal).

If that makes sense to anyone. Is it doable without actually writing or modifying the script inside of Object A? 

 

again thank you for any help given! :matte-motes-grin:

Link to comment
Share on other sites

string SCAN_NAME = "Object A"; // rezzer object's namekey SCAN_KEY = NULL_KEY;float SCAN_RANGE = 10; // Normally we can rez only in a 10m range float SCAN_INTERVAL = 1.0 ;string MESSAGE_DIALOG = "Are you Ok?";list MENU_DIALOG = [ "Yes", "No" , "So-So" ];integer CHANNEL_DIALOG ;float TIMEOUT_DIALOG = 30; // if the user doesn t answer before the tiemout , we close the listenerinteger LISTENER ;default{    state_entry()    {        CHANNEL_DIALOG = (integer)llFrand(1000000);        LISTENER = llListen(CHANNEL_DIALOG, "", llGetOwner(), "" );                llListenControl(LISTENER, FALSE);            }    on_rez(integer start)    {        llSensorRepeat( SCAN_NAME, SCAN_KEY, ACTIVE|PASSIVE|SCRIPTED , SCAN_RANGE, PI, SCAN_INTERVAL );    }    sensor(integer n )    {        // We have detected an object with the same name         // We ad a test to know if the owner of the rezzer is the same as the owner of the rezzee        if ( llDetectedOwner(0) == llGetOwner() )        {            // close the sensor            llSensorRemove( );            llListenControl(LISTENER, TRUE);            llSetTimerEvent(TIMEOUT_DIALOG);            llDialog( llGetOwner(), MESSAGE_DIALOG, MENU_DIALOG, CHANNEL_DIALOG);        }    }    timer()    {        llListenControl(LISTENER, FALSE);        llOwnerSay("Time out dialog");    }    listen(integer c, string s, key k, string m)    {        llListenControl(LISTENER, FALSE);        llSay(0, "You wave picked up : " + m);    }    changed(integer c)    {        if ( c & CHANGED_OWNER )        {            llResetScript();        }    }}

 

You have not specified who should receive the dialog box .

I have guessed the dialog box should be shown to the owner

 

 

Maybe it s not the menu of the Object B , but the menu of the Object A , you want to display . In this case , it s impossible.

The better you may hope is to know if Object A has :

  • its listener active and opened  for its menu  AND
  • you know its channel AND
  • its listener doesn t filter out your Object B AND
  • to emulate the same menu in the Object B AND
  • in the listen event f the emulated dialog box fom Object B , you script to talk from Object B to Object A with llRegionSayTo 
  • Like 1
Link to comment
Share on other sites

It s possible if you meet the conditions i have wroten .

Nevertheless , there are so much condition than the scripter of the object B knows the script of the Object A .

 

There is an another case where you may  use some features (RLV ) of the third part viewers  to force a touch event on the object A .But by default , theses features are off in the viewer , and a script can t turn on them if theay are off.

To add , even with these features ,  it forces a touch event , it  can t directly  display a menu .  If the touch event displays a menu , it will , but it the menu is displayed inside an another event , it won t

 

Probably , you have touched two different prims of the same object . In this case , the Prim B of the the Linked object can brings the menu of the script  inside the Prim B . 

But it s the same object

Link to comment
Share on other sites

It is indeed possible for an object to bring up a menu from another object. For that the objects must communicate with each other via Say/Listen mechanism. A menu is just a list: list menu = [button1, button2,... button12]. So on touch object B sends a query to object A via llRegionSayTo() and object A responds with converting this list to string and sending it to B via the same llRegionSayTo(). The B converts back to list and displays to user. Now depending on distance between objects A and B, a button pressed by user in the B-object menu could be directly responded by object A. This endevour however is not totally trivial because there must be an original handshake between objects A and B.

Link to comment
Share on other sites

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