Jump to content

Having an Object "llDie" when it is away from a Main Build that Rezed it


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

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

Recommended Posts

I have secondary objects (peripherals) that are rezed by a main build but unlinked to the main build. I am trying to write scripts to have the peripherals delete themselves when the main build is deleted or moved away. The scripts I have written here do talk with each other … however the one that lives in the peripherals always sees the “Die” option. Looks like this; [08:58] Peripheral whispers: initial check [08:58] Main Build whispers: stay_rezzed [08:58] Peripheral whispers: I will stay rezzed [08:58] Peripheral whispers: I'm going to die [08:58] Main Build whispers: stay_rezzed [08:58] Peripheral whispers: I will stay rezzed [08:58] Peripheral whispers: I'm going to die I can’t have the Main Build tell the Peripherals that it isn’t there anymore … I’m having difficulty with the logic. I have also read that “llSleep” is better than a Timer for LAg Purposes ... so that is why I am using that. Since the Peripherals are not linked or attached to the Avatar … I am having difficulty filtering so that only the owners objects will communicate in case there is another Main Build in the nearby area performing the same queries. I am testing by having my AV near 2 Boxes with the scripts so I can "hear" the functions. Here are the Scripts; // This Script Lives in the Main Object // Answers when queried integer CHNL26 = 216; integer CHNL27 = 217; default { state_entry() { // llListen(CHNL27, "", llGetOwner(), "" ); I need to look into this ... I think I have a solution llListen(CHNL27, "", NULL_KEY, "" ); } listen(integer channel, string name, key id, string message) { if(message == "checking?") { llWhisper(CHNL26, "stay_rezzed"); llWhisper(0,"stay_rezzed"); } } } // This Script Lives in the Peripheral Objects // Checks if the Main Build is still there // If not, then the periferals are deleted integer CHNL26 = 216; integer CHNL27 = 217; integer rezzed = FALSE; check_rez() { llWhisper(CHNL27, "checking?"); } default { state_entry() { // llListen(CHNL26, "", llGetOwner(), "" ); (was trying this) llListen(CHNL26, "", NULL_KEY, "" ); } on_rez(integer start_parameter) { check_rez(); // Will trigger the first Listen? llWhisper(0,"initial check"); } listen(integer channel, string name, key id, string message) { if(message == "stay_rezzed") { rezzed = TRUE; llWhisper(0,"I will stay rezzed"); llSleep(3.0); rezzed = FALSE; check_rez(); } if(rezzed == FALSE) // else if(rezzed == FALSE) tried this too { llWhisper(0,"I'm going to die"); // llDie(); } } }
Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 3404 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
×
×
  • Create New...