Difference between revisions of "LlGetStartParameter"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
 
(12 intermediate revisions by 6 users not shown)
Line 3: Line 3:
|sort=GetStartParameter
|sort=GetStartParameter
|func=llGetStartParameter|return_type=integer
|func=llGetStartParameter|return_type=integer
|func_footnote
|func_footnote=
*If the script was loaded with [[llRemoteLoadScriptPin]] then that start parameter is returned.
*If the containing object was rezzed by [[llRezObject]] or [[llRezAtRoot]] then the return is the [[on_rez]] parameter.
*If the containing object was manually rezzed, by dragging from inventory, the start parameter is 0.
|func_desc
|func_desc
|return_text=that is the start parameter passed to {{LSLG|llRezObject}}.
|return_text=that is the script start/rez parameter.
|spec
|spec
|caveats
|caveats=
* The start parameter does not survive region restarts ({{Jira|SVC-2251}}) or region change ({{Jira|SVC-3258}}, crossing or teleport).
* If the script is reset (using [[llResetScript]] or other means), the start parameter is set to 0.
|constants
|constants
|examples
|examples=
<source lang="lsl2">
default
{
    on_rez(integer param)
    {
        llOwnerSay("rezzed with the number " + (string)param);
    }
    state_entry()
    {
        integer i = llGetStartParameter();
        if (i)
        {
            llOwnerSay("I was given the number " + (string)i + " when I was rezzed");
        }
        else
        {
            llOwnerSay("rezzed from inventory (or rezzed/loaded with 0)");
        }
    }
}
</source>
|helpers
|helpers
|also_functions
|also_functions=
|also_events
{{LSL DefineRow||[[llRemoteLoadScriptPin]]|Used to load a script into a remote prim}}
{{LSL DefineRow||[[llRezObject]]|Used to rez an object at the center of mass}}
{{LSL DefineRow||[[llRezAtRoot]]|Used to rez an object at the root}}
|also_events=
{{LSL DefineRow||[[on_rez]]|}}
|also_articles
|also_articles
|notes
|notes
|permission
|issues=
|negative_index
{{Issue/V1|SVC-2251|llGetStartParameter returns zero after sim restart|type=bug}}
|cat1
{{Issue/V1|SVC-3258|llGetStartParameter returns zero after change of region|type=bug}}
|cat1=Script
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}
{{LSLC|Stub}}

Latest revision as of 02:54, 22 January 2015

Summary

Function: integer llGetStartParameter( );

Returns an integer that is the script start/rez parameter.

  • If the script was loaded with llRemoteLoadScriptPin then that start parameter is returned.
  • If the containing object was rezzed by llRezObject or llRezAtRoot then the return is the on_rez parameter.
  • If the containing object was manually rezzed, by dragging from inventory, the start parameter is 0.

Caveats

  • The start parameter does not survive region restarts (SVC-2251) or region change (SVC-3258, crossing or teleport).
  • If the script is reset (using llResetScript or other means), the start parameter is set to 0.
All Issues ~ Search JIRA for related Bugs

Examples

default
{
    on_rez(integer param)
    {
        llOwnerSay("rezzed with the number " + (string)param);
    }
    state_entry()
    {
        integer i = llGetStartParameter();
        if (i)
        {
            llOwnerSay("I was given the number " + (string)i + " when I was rezzed");
        }
        else
        {
            llOwnerSay("rezzed from inventory (or rezzed/loaded with 0)");
        }
    }
}

See Also

Events

•  on_rez

Functions

•  llRemoteLoadScriptPin Used to load a script into a remote prim
•  llRezObject Used to rez an object at the center of mass
•  llRezAtRoot Used to rez an object at the root

Deep Notes

All Issues

~ Search JIRA for related Issues
   llGetStartParameter returns zero after sim restart
   llGetStartParameter returns zero after change of region

Signature

function integer llGetStartParameter();