User:Strife Onizuka/The State of State

From Second Life Wiki
Jump to navigation Jump to search

When it comes to scripting state can mean one of several things.

  • It can be a group of events that as a group can be used to handle incoming events.
  • It can be the running status of the script.
  • It can be the all of the script running information (memory, event queue, execution position, etc)

Unless otherwise stated, state will refer to the script running information.

Background

Before we can talk about state, the structure of scripts needs to be expounded upon.

Inventory

A script (as the user sees it) is an inventory item that once put into a prim can interact with the world the prim exists in. The important part of this definition for now is that it is an inventory item. All inventory items are made up of two parts: the underlying asset and the wrapper. The wrapper holds the inventory aspects of the item, for example the name, permissions, etc. The asset is the actual data. Assets in SL are read-only.

State

A script however is not a normal inventory item, besides the ordinary inventory aspect it also has an additional part. This extra part is the state which encompasses all execution information, pending events, etc.

Problems

The big issue with state, is when should it be maintained and when it should be discarded.

  • Optional
    • pros
    • cons
  • Out of object
    • pros
    • cons
  • Not Running
    • pros
    • cons

Current Implementation

lorem ipsum yada yada

The state is not really a part the inventory item, it is better thought of as a part of the containing prim.

FAQ