Difference between revisions of "On rez"

From Second Life Wiki
Jump to: navigation, search
m (<lsl> example)
Line 19: Line 19:
 
|also_events=
 
|also_events=
 
{{LSL DefineRow||[[object_rez]]|triggered when this object rezzes an object from inventory}}
 
{{LSL DefineRow||[[object_rez]]|triggered when this object rezzes an object from inventory}}
 +
{{LSL DefineRow||[[state_entry]]|triggered during script startup, reset and state change}}
 
|also_functions=
 
|also_functions=
 
{{LSL DefineRow||[[llGetStartParameter]]|}}
 
{{LSL DefineRow||[[llGetStartParameter]]|}}
Line 25: Line 26:
 
|also_articles
 
|also_articles
 
|also_footer
 
|also_footer
|notes
+
|notes=
 +
===[[on_rez]] & [[state_entry]]===
 +
[[state_entry]] will be triggered prior to [[on_rez]] if [[state_entry]] has not be run prior.
 
|mode
 
|mode
 
|deprecated
 
|deprecated

Revision as of 21:49, 15 April 2009

Description

Event: on_rez( integer start_param ){ ; }

Triggered when an object is rezzed (by script or by user). Also triggered in attachments when a user logs in, or when the object is attached from inventory.

• integer start_param parameter supplied to llRezObject or llRezAtRoot

start_param is always zero when an object is not rezzed by llRezObject or llRezAtRoot.
start_param is available at any subsequent time by calling llGetStartParameter (unless it has been overridden by llRemoteLoadScriptPin).

Caveats

  • If an object is rezzed by another object then the object_rez event in the parent object does not trigger at the same time as the on_rez event in the child object.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

   on_rez(integer start_param)
   {
       // Restarts the script every time the object is rezzed
       llResetScript(); 
   }

}</lsl>

Notes

on_rez & state_entry

state_entry will be triggered prior to on_rez if state_entry has not be run prior.

See Also

Events

•  object_rez triggered when this object rezzes an object from inventory
•  state_entry triggered during script startup, reset and state change

Functions

•  llGetStartParameter
•  llRezObject
•  llRezAtRoot

Deep Notes

Signature

event void on_rez( integer start_param );