LlGetStartString: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Lucia Nightfire (talk | contribs)
m Start string is assigned to the rezzed object's root prim via llRezObjectWithParams.
Gwyneth Llewelyn (talk | contribs)
m Replaced <source> with <syntaxhighlight>
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
|func_footnote=
|func_footnote=
*If the containing object was manually rezzed, by dragging from inventory, the start string is blank.
*If the containing object was manually rezzed, by dragging from inventory, the start string is blank.
*If the script calling this function is in a child prim, the start string of the root prim is returned.
*This function reads the start string of the object's root prim.
*Child prims of objects rezzed via llRezObjectWithParams() have an empty start string.
*Child prims of objects rezzed via llRezObjectWithParams() have an empty start string.
|func_desc
|func_desc
Line 14: Line 14:
|constants
|constants
|examples=
|examples=
<source lang="lsl2">
<syntaxhighlight lang="lsl2">
default
default
{
{
Line 27: Line 27:
     }
     }
}
}
</source>
</syntaxhighlight>
|helpers
|helpers
|also_functions=
|also_functions=
Line 37: Line 37:
|notes
|notes
|issues
|issues
|haiku={{Haiku|Passed on rez, a string—|Blank when dragged from invent'ry,|Root prim holds the key.|author=ChatGPT 4o with some tweaks from [[User:Gwyneth Llewelyn|Gwyn]]}}
|cat1=Script
|cat1=Script
|cat2=Combat2
|cat2=Combat2

Latest revision as of 05:08, 29 November 2024

Summary

Function: string llGetStartString( );
0.0 Forced Delay
10.0 Energy

Returns a string that was passed to the object's root prim on rez with llRezObjectWithParams.

  • If the containing object was manually rezzed, by dragging from inventory, the start string is blank.
  • This function reads the start string of the object's root prim.
  • Child prims of objects rezzed via llRezObjectWithParams() have an empty start string.

Caveats

  • Start string survives script resets, region crosses and region restarts.

Examples

default
{
    on_rez(integer param)
    {
        llOwnerSay("rezzed with the number " + (string)param + " and a start string of \"" + llGetStartString() + "\"");
    }
    state_entry()
    {
        string s = llGetStartString();
        llOwnerSay("I was given the string \"" + s + "\" when I was rezzed");
    }
}

See Also

Events

•  on_rez

Functions

•  llRezObjectWithParams
•  llGetStartParameter

Deep Notes

Signature

function string llGetStartString();

Haiku

Passed on rez, a string—
Blank when dragged from invent'ry,
Root prim holds the key.
— ChatGPT 4o with some tweaks from Gwyn