Difference between revisions of "LlResetScript"
Jump to navigation
Jump to search
m (LSL llResetScript moved to LlResetScript: removing prefix) |
m (<lsl> tag to <source>) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 2: | Line 2: | ||
|func_id=163|func_sleep=0.0|func_energy=10.0 | |func_id=163|func_sleep=0.0|func_energy=10.0 | ||
|func=llResetScript | |func=llResetScript | ||
|func_footnote | |func_footnote=On script reset... | ||
*The current event/function is exited without further execution or return. | |||
*Any granted URLs are released. | |||
*All global variables are set to their defaults | |||
*The event queue is cleared. | |||
*The [[default]] state is set as the active state | |||
**If it has a [[state_entry]] event, then it is queued. | |||
|func_desc=Resets the script. | |func_desc=Resets the script. | ||
|return_text | |return_text | ||
Line 8: | Line 14: | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples | |examples= | ||
<source lang="lsl2"> | |||
default | |||
{ | |||
// reset script when the object is rezzed | |||
on_rez(integer start_param) | |||
{ | |||
llResetScript(); | |||
} | |||
changed(integer change) | |||
{ | |||
// reset script when the owner or the inventory changed | |||
if (change & (CHANGED_OWNER | CHANGED_INVENTORY)) | |||
llResetScript(); | |||
} | |||
// script initialization here | |||
state_entry() | |||
{ | |||
; | |||
} | |||
} | |||
</source> | |||
|helpers | |helpers | ||
|also_functions=*{{LSLG|llResetOtherScript}} | |also_functions=*{{LSLG|llResetOtherScript}} |
Revision as of 14:30, 22 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llResetScript( );163 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Resets the script.
On script reset...
- The current event/function is exited without further execution or return.
- Any granted URLs are released.
- All global variables are set to their defaults
- The event queue is cleared.
- The default state is set as the active state
- If it has a state_entry event, then it is queued.
Caveats
Examples
default
{
// reset script when the object is rezzed
on_rez(integer start_param)
{
llResetScript();
}
changed(integer change)
{
// reset script when the owner or the inventory changed
if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
llResetScript();
}
// script initialization here
state_entry()
{
;
}
}