llRequestSimulatorData
function
Function syntax
key llRequestSimulatorData(string region,// Case-sensitive region name.integer data// DATA_SIM_* flag of the requested simulator data. Values: SimulatorData
);- Returns
key- Delay
- 1 s
- Energy
- 10
Asynchronously requests data (using a DATA_SIM_* constant) about the region. Triggers a dataserver event and returns a key query handle.
Requests data about region. When data is available the dataserver event will be raised.
Returns a key for a dataserver event response.
key result = llRequestSimulatorData("", 0);Specification
Section titled “Specification”| data Constant | Type | Description | ||||
|---|---|---|---|---|---|---|
DATA_SIM_POS | 5 | (vector) | The regions global position. | |||
DATA_SIM_STATUS | 6 | string | Value | Description | ||
| ”up” | region currently up and running | |||||
| ”down” | region currently down | |||||
| ”starting” | region currently starting | |||||
| ”stopping” | region currently stopping | |||||
| ”crashed” | region has crashed | |||||
| ”unknown” | region status unknown or unknown region | |||||
DATA_SIM_RATING | 7 | string | Value | Maturity rating | ||
| ”PG" | ||||||
| "MATURE" | ||||||
| "ADULT" | ||||||
| "UNKNOWN” | rating or region unknown | |||||
Caveats
Section titled “Caveats”- There is no DATA_SIM_MAXPRIMS flag (but
llGetEnv("region_product_name")returns the region type). SVC-4921
Examples
Section titled “Examples”Hide objects in PG or unknown regions
19 collapsed lines
key gRateingQuery = NULL_KEY ;
show(){ llSetLinkAlpha( LINK_SET, 1.0, ALL_SIDES );}//show
hide(){ llSetLinkAlpha( LINK_SET, 0.0, ALL_SIDES );}//hide
default{ on_rez(integer Setting) { llResetScript(); }//on_rez
state_entry() { gRateingQuery = llRequestSimulatorData( llGetRegionName(), DATA_SIM_RATING ); }//state_entry
16 collapsed lines
changed(integer ItChanged) { if (ItChanged & CHANGED_OWNER) llResetScript(); if (ItChanged & CHANGED_REGION) llResetScript(); }//changed
dataserver(key query_id, string data) { if (query_id == gRateingQuery) { if (data == "MATURE" || data == "ADULT") show(); else if (data == "UNKNOWN" || data == "PG") hide(); }//gRateingQuery }//dataserver
}//defaultGlobal Position in meters
Known issues
Section titled “Known issues”From the issue templates included by the wiki article:
- SVC-2596 (bug): Script dataserver events become permanently blocked until sim restart
- SVC-4921 (nf): Please add a way to get the region type (“full”, “homestead”, “openspace”) to llRequestSimulatorData
- BUG-5031 (bug): llRequestSimulatorData for DATA_SIM_POS returns same position for multiple regions
See also
Section titled “See also”Functions
Section titled “Functions”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.