Difference between revisions of "LlGetEnv"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(40 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-1
|func_id=362|func_sleep=0.0|func_energy=0.0
|func_id=362|func_sleep=0.0|func_energy=0.0
|func= llGetEnv |sort= llGetEnv
|func= llGetEnv |sort=GetEnv
|return_type=string
|return_type=string
|p1_type=string|p1_name=name|p1_desc=The name of the data to request
|p1_type=string|p1_name=name|p1_desc=The name of the data to request
|func_footnote
|func_footnote=Note that the value returned is a string, you may need to cast it to an integer for use in calculations.
|func_desc
|func_desc
|return_text=with the requested data about the [[region]].
|return_text=with the requested data about the [[region]].
Line 11: Line 10:
|caveats
|caveats
|constants=
|constants=
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}}
<div style="margin-bottom:1em;">
{{!}}+ Table of valid '''{{LSL Param|name}}''' values.
{{{!}} class="sortable" {{Prettytable|style=margin:0;}}
{{!}}+ Table of valid {{LSLP|name}} values.  
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}
! {{!}} Name
! {{!}} Name
! class="unsortable"{{!}} Description
! class="unsortable" {{!}} Description
! {{!}} {{HoverText|Type to typecast to|To make the value returned more useful, you will want to typecast it to this type}}
{{!}}-
{{!}}-
{{!}}"sim_channel"
{{!}} "agent_limit"
{{!}}Get the current region's [[Het-Grid_FAQ#What_is_a_channel.3F|channel]] string, for example "Second Life Server"
{{!}} Get the maximum number of avatars normally allowed on this region (teleport home, and login to last location, are allowed to exceed this).
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}}-
{{!}}"sim_version"
{{!}} "agent_limit_max"
{{!}}Get the current region's [[Version numbering|version number]] string, for example "10.11.30.215699"
{{!}} Get the maximum configurable setting for number of agents in the region.
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}}-
{{!}}"frame_number"
{{!}} "agent_reserved"
{{!}}'''After January 2012:''' Get the frame number of the simulator, for example "42042".  Note that the return value is a string, so cast to an integer for use in calculations
{{!}} Get the number of agent slots reserved for premium members in the region.
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "agent_unreserved"
{{!}} Get the number of unreserved (non-premium) agent slots configured for the region.
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "dynamic_pathfinding"
{{!}} Get the region's effective dynamic_pathfinding status, "enabled" or "disabled". This option is configured in the [[SimConsole|Region Debug Console]]
{{!}} {{No|N/A}}
{{!}}-
{{!}} "estate_id"
{{!}} Numerical index identifying which estate a region belongs to. Main grid mainland is "1"
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "estate_name"
{{!}} "mainland", "Linden Homes", "My Happy Estate", etc.
{{!}} {{No|N/A}}
{{!}}-
{{!}} "frame_number"
{{!}} Get the frame number of the simulator, for example "42042".
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "region_cpu_ratio"
{{!}} Get number of regions per CPU for this region type. Returns "1" or "4".
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "region_idle"
{{!}} Get the region's [http://community.secondlife.com/t5/Second-Life-Server/Region-Idling-FAQ/m-p/1535497 idle] status, "1" or "0".
{{!}} {{Yes|[[integer]] [http://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29 boolean]}}
{{!}}-
{{!}} "region_product_name"
{{!}} Get the type of region this is: "Estate / Full Region", "Mainland / Homestead", "Estate / Openspace", "Estate / Full Region - Skill Gaming" etc.
{{!}} {{No|N/A}}
{{!}}-
{{!}} "region_product_sku"
{{!}} Get the region's product number (as string).
{{!}} {{No|N/A}}
{{!}}-
{{!}} "region_start_time"
{{!}} Get the time the region was last (re)started, in [[llGetUnixTime]] format
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "sim_channel"
{{!}} Get the region's [[Het-Grid_FAQ#What_is_a_channel.3F|channel]] string, for example "Second Life Server".
{{!}} {{No|N/A}}
{{!}}-
{{!}} "sim_version"
{{!}} Get the region's [[Version numbering#Second_Life_Server_Versioning|version number]] string, for example "{{HoverText|10|[2-digit year]}}.{{HoverText|11|[2-digit month]}}.{{HoverText|30|[2-digit day]}}.{{HoverText|215699|[build number]}}".
{{!}} {{No|N/A}}
{{!}}-
{{!}} "simulator_hostname"
{{!}} Get the simhost running this region. Same as [[llGetSimulatorHostname]] but without the script delay.
{{!}} {{No|N/A}}
{{!}}-
{{!}} "region_max_prims"
{{!}} Get the maximum number of prims allowed on this region.
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "region_object_bonus"
{{!}} Get the region's object bonus factor.
{{!}} {{Yes|[[float]]}}
{{!}}-
{{!}} "whisper_range"
{{!}} Get the range for whispered chat in the region.
{{!}} {{Yes|[[float]]}}
{{!}}-
{{!}} "chat_range"
{{!}} Get the range for spoken chat in the region.
{{!}} {{Yes|[[float]]}}
{{!}}-
{{!}} "shout_range"
{{!}} Get the range for shouted chat in the region.
{{!}} {{Yes|[[float]]}}
{{!}}-
{{!}} "region_rating"
{{!}} Get the maturity rating of the regionSame as [[DATA_SIM_RATING]] from [[llRequestSimulatorData]].
{{!}} {{No|N/A}}
{{!}}-
{{!}} "grid"
{{!}} Get the [[Land#Grid|grid]] the region is running on.
{{!}} {{No|N/A}}
{{!}}-
{{!}} "allow_damage_adjust"
{{!}} Are scripts allowed to adjust damage. Allowed by default.
{{!}} {{Yes|[[integer]] [http://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29 boolean]}}
{{!}}-
{{!}} "restrict_combat_log"
{{!}} Whether scripts are restricted from writing into the combat log. Allowed by default.
{{!}} {{Yes|[[integer]] [http://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29 boolean]}}
{{!}}-
{{!}} "restore_health"
{{!}} Is health reset to 100% on death. On by default.
{{!}} {{Yes|[[integer]] [http://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29 boolean]}}
{{!}}-
{{!}} "invulnerability_time"
{{!}} invulnerability time applied after avatar death. 0.0 by default.
{{!}} {{Yes|[[float]]}}
{{!}}-
{{!}} "damage_throttle"
{{!}} The maximum number of points of damage a single source may inflict on a target per second. 0.0s by default.
{{!}} {{Yes|[[float]]}}
{{!}}-
{{!}} "health_regen_rate"
{{!}} The speed of health regeneration in hitpoints per second. 1/6s by default.
{{!}} {{Yes|[[float]]}}
{{!}}-
{{!}} "death_action"
{{!}} Set the action to take when an avatar dies in the region. Teleport home by default.
0 = Teleport home
1 = Teleport to parcel landing point.
2 = Teleport to region telehub.
3 = No action
{{!}} {{Yes|[[integer]]}}
{{!}}-
{{!}} "damage_limit"
{{!}} The maximum number of points of damage that may be delivered by a single bullet or a single call to llDamage. If 0, there is no limit.
{{!}} {{Yes|[[float]]}}
{{!}}}
{{!}}}
|examples=<lsl>
 
</div>
|examples=<syntaxhighlight lang="lsl2">
default
default
{
{
Line 41: Line 163:
     }
     }
}
}
</lsl>
</syntaxhighlight>
|helpers
|helpers
|also_functions=
|also_functions=
Line 50: Line 172:
|also_events
|also_events
|also_articles
|also_articles
|notes
|notes=* Region idling lowers a region's framerate when no avatars are currently on or looking into the region.  Scripts measuring time dilation with [[llGetRegionTimeDilation]] may report significant time dilation if the region is idle.
|history=*Introduced in [[Release Notes/Second Life RC LeTigre/10#10.11.30.215699|Second Life RC LeTigre 10.11.30.215699]], deployed on 2010-12-01.
|history=* {{Jira|SVC-4874}}
*Introduced in [[Release Notes/Second Life RC LeTigre/10#10.11.30.215699|Second Life RC LeTigre 10.11.30.215699]], deployed on 2010-12-01.
*Deployed to rest of Agni with Second Life Server 10.11.30.215699, Second Life RC BlueSteel 10.12.06.216207, Second Life RC Magnum 10.11.30.215699
*Deployed to rest of Agni with Second Life Server 10.11.30.215699, Second Life RC BlueSteel 10.12.06.216207, Second Life RC Magnum 10.11.30.215699
*"frame_number" option added in Second Life RC BlueSteel 12.01.03.247042
*"frame_number" option added in Second Life RC BlueSteel 12.01.03.247042

Latest revision as of 15:30, 23 August 2024

Summary

Function: string llGetEnv( string name );

Returns a string with the requested data about the region.

• string name The name of the data to request

Note that the value returned is a string, you may need to cast it to an integer for use in calculations.

Table of valid name values.
Name Description Type to typecast to
"agent_limit" Get the maximum number of avatars normally allowed on this region (teleport home, and login to last location, are allowed to exceed this). integer
"agent_limit_max" Get the maximum configurable setting for number of agents in the region. integer
"agent_reserved" Get the number of agent slots reserved for premium members in the region. integer
"agent_unreserved" Get the number of unreserved (non-premium) agent slots configured for the region. integer
"dynamic_pathfinding" Get the region's effective dynamic_pathfinding status, "enabled" or "disabled". This option is configured in the Region Debug Console N/A
"estate_id" Numerical index identifying which estate a region belongs to. Main grid mainland is "1" integer
"estate_name" "mainland", "Linden Homes", "My Happy Estate", etc. N/A
"frame_number" Get the frame number of the simulator, for example "42042". integer
"region_cpu_ratio" Get number of regions per CPU for this region type. Returns "1" or "4". integer
"region_idle" Get the region's idle status, "1" or "0". integer boolean
"region_product_name" Get the type of region this is: "Estate / Full Region", "Mainland / Homestead", "Estate / Openspace", "Estate / Full Region - Skill Gaming" etc. N/A
"region_product_sku" Get the region's product number (as string). N/A
"region_start_time" Get the time the region was last (re)started, in llGetUnixTime format integer
"sim_channel" Get the region's channel string, for example "Second Life Server". N/A
"sim_version" Get the region's version number string, for example "10.11.30.215699". N/A
"simulator_hostname" Get the simhost running this region. Same as llGetSimulatorHostname but without the script delay. N/A
"region_max_prims" Get the maximum number of prims allowed on this region. integer
"region_object_bonus" Get the region's object bonus factor. float
"whisper_range" Get the range for whispered chat in the region. float
"chat_range" Get the range for spoken chat in the region. float
"shout_range" Get the range for shouted chat in the region. float
"region_rating" Get the maturity rating of the region. Same as DATA_SIM_RATING from llRequestSimulatorData. N/A
"grid" Get the grid the region is running on. N/A
"allow_damage_adjust" Are scripts allowed to adjust damage. Allowed by default. integer boolean
"restrict_combat_log" Whether scripts are restricted from writing into the combat log. Allowed by default. integer boolean
"restore_health" Is health reset to 100% on death. On by default. integer boolean
"invulnerability_time" invulnerability time applied after avatar death. 0.0 by default. float
"damage_throttle" The maximum number of points of damage a single source may inflict on a target per second. 0.0s by default. float
"health_regen_rate" The speed of health regeneration in hitpoints per second. 1/6s by default. float
"death_action" Set the action to take when an avatar dies in the region. Teleport home by default.

0 = Teleport home 1 = Teleport to parcel landing point. 2 = Teleport to region telehub. 3 = No action

integer
"damage_limit" The maximum number of points of damage that may be delivered by a single bullet or a single call to llDamage. If 0, there is no limit. float

Examples

default
{
    touch_start(integer total_number)
    {
        string version = llGetEnv("sim_version");
        llOwnerSay("Region " + llGetRegionName() + " is running "
                   + llGetEnv("sim_channel") + " version " + version );

        list ver = llParseString2List(version, ["."], []);

        llOwnerSay("Build: "+llList2String(ver, 3));
        llOwnerSay("Build Date: "+llList2String(ver, 2)+"-"+llList2String(ver, 1)+"-20"+llList2String(ver, 0));
    }
}

Notes

  • Region idling lowers a region's framerate when no avatars are currently on or looking into the region. Scripts measuring time dilation with llGetRegionTimeDilation may report significant time dilation if the region is idle.

See Also

Deep Notes

History

  • SVC-4874
  • Introduced in Second Life RC LeTigre 10.11.30.215699, deployed on 2010-12-01.
  • Deployed to rest of Agni with Second Life Server 10.11.30.215699, Second Life RC BlueSteel 10.12.06.216207, Second Life RC Magnum 10.11.30.215699
  • "frame_number" option added in Second Life RC BlueSteel 12.01.03.247042
    • Returns an integer that represents the current 'frame' of the simulator. Generally only useful for specific debugging cases.
  • Removed (temporarily?) in Second Life RC BlueSteel 12.01.06.247303

Signature

function string llGetEnv( string name );