Difference between revisions of "Changed"

From Second Life Wiki
Jump to navigation Jump to search
(added example.)
Line 1: Line 1:
{{LSL_Event|event_id=30|event_delay|event=changed|p1_type=integer|p1_name=change |p1_desc={{LSLG|bit field}} of CHANGE_* flags|event_footnote=Multiple changes can be representing in a single event, so use bitwise arithmetic.|event_desc=Various changes to the object/prim trigger this event|constants={{LSL Constants Changed}}|spec|caveats|examples|helpers|also_header|also_events|also_functions|also_articles|also_footer|notes|mode|deprecated}}[[Category:LSL_Stub]]
{{LSL_Event|event_id=30
|event_delay
|event=changed
|p1_type=integer
|p1_name=change  
|p1_desc={{LSLG|bit field}} of CHANGE_* flags
|event_footnote=Multiple changes can be representing in a single event, so use bitwise arithmetic.
|event_desc=Various changes to the object/prim trigger this event
|constants={{LSL Constants Changed}}
|spec
|caveats
|examples=
<pre>
changed(integer change) //reset script if inventory changes
{
    if (change & CHANGED_INVENTORY) //note that it's & and not &&... it's bitwise!
    {
        llResetScript();
    }
}
</pre>
|helpers
|also_header
|also_events
|also_functions
|also_articles
|also_footer
|notes
|mode
|deprecated}}
 
[[Category:LSL_Stub]]

Revision as of 16:30, 11 February 2007

Description

Event: changed( integer change ){ ; }

Various changes to the object/prim trigger this event

• integer change bit field of CHANGE_* flags

Multiple changes can be representing in a single event, so use bitwise arithmetic.

Flag Description Scope
CHANGED_INVENTORY 0x001 Prim inventory has changed[1]. prim
CHANGED_COLOR 0x002 Prim color or alpha parameters have changed. prim
CHANGED_SHAPE 0x004 Prim shape has changed. prim
CHANGED_SCALE 0x008 Prim scale has changed. prim
CHANGED_TEXTURE 0x010 Prim texture parameters have changed. prim
CHANGED_LINK 0x020 The number of prims making up the object or avatars seated on the object have changed. object
CHANGED_ALLOWED_DROP 0x040 A user other than the owner (or the owner if the object is no-mod) has added inventory to the prim. prim
CHANGED_OWNER 0x080 The object has changed owners. object
CHANGED_REGION 0x100 The object has changed region. object
CHANGED_TELEPORT 0x200 The avatar to whom this object is attached has teleported. object
CHANGED_REGION_START 0x400 The region this object is in has just come online. region
CHANGED_MEDIA 0x800 Prim Media has changed. prim
CHANGED_RENDER_MATERIAL 0x1000 Render Material has changed. Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer. prim

Examples

changed(integer change) //reset script if inventory changes
{
    if (change & CHANGED_INVENTORY) //note that it's & and not &&... it's bitwise!
    {
        llResetScript();
    }
}

Deep Notes

Footnotes

  1. ^ CHANGED_INVENTORY won't be triggered if the inventory change was caused by a script function or a user taking advantage of llAllowInventoryDrop

Signature

event void changed( integer change );