// ======================================== // Stop Announcer Template // Companion script for the cross-region keymotion tour vehicle script. // Drop this into a prim placed at a stop/pause point along your route // (underneath or beside where the vehicle will sit during a pause). // It senses for your vehicle by NAME and fires a one-time shout when // it arrives. // // PAIRING NOTE: the tour vehicle script never renames the object it's // running in -- whatever name you set on the vehicle in-world (Edit -> // General -> Object Name) is what stays constant for the whole route. // Just make sure VEHICLE_NAME below matches that name exactly. // // Place one of these prims per stop/announcement point along your // route. Each one only needs to know the vehicle's name and its own // message -- nothing route-specific beyond that. // // CREDIT: adapted from a stop-detector pattern used on the MS // Neverworld Bountiful tour ship, itself built to pair with the OSW // cross-region tour script. // ======================================== // EDIT THESE TWO: string VEHICLE_NAME = "My Tour Vehicle"; // must exactly match the vehicle's in-world Object Name string ANNOUNCE_MESSAGE = "Welcome aboard! Enjoy the view during our brief stop here."; float SENSOR_RANGE = 6.0; float SENSOR_INTERVAL = 5.0; integer arrived = FALSE; default { state_entry() { arrived = FALSE; llSensorRepeat(VEHICLE_NAME, "", SCRIPTED|ACTIVE, SENSOR_RANGE, PI, SENSOR_INTERVAL); llOwnerSay("Stop announcer ready, watching for '" + VEHICLE_NAME + "'."); } sensor(integer num) { if (!arrived) { arrived = TRUE; llShout(0, ANNOUNCE_MESSAGE); } } no_sensor() { // Vehicle moved out of range -- reset so the next arrival // (e.g. a future tour, or Resume looping back through) fires // the announcement again. arrived = FALSE; } on_rez(integer param) { llResetScript(); } }