Don't click here unless you want to be banned.

LSL Wiki : fork

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are


"There is no spoon" - A student of the Oracle, The Matrix

As the child tells Keanu Reaves that there is no spoon, this page is unfortunately in place to tell you that there is no specific fork function in LSL. There are however methods to handle multiple scripts in a single prim, each script counting as a seperate process. Though this does allow multiple events and functions to occur simultaniously, they are still taken from the same single server timeslice, therefore, more scripts will slow down others as the task manager for the sim checks all it's scripts, the sim itself working in a Debian Linux task manager to find out when it can go compared with the kernel, postfix, squid proxies and often another simulator. This means that the processes have a limited ammount of time to work.
Methods to communicate between scripts include:

llMessageLinked link_message
llEmail sends e-mail, use llGetNextEmail to recieve
llGetNextEmail email
llSay llShout llWhisper chats on specified channel, use llListen to recieve
llListen listen
llSensor llSensorRepeat sensor

See Communications for a more thorough discussion of these functions.

A way to create a fork though not recomended in large numbers (think of Fish8) involves adding a prim to the inventory of the object and having it give that object a script using the following code.

     on_rez(integer number)

     touch_start(integer touched)
          llRezObject("cube", <0.0, 0.0, 0.5>, <0.0,0.0,0.0>, ZERO_ROTATION,1);

     object_rez(key object)
          llGiveInventory(object, llGetScriptName());

There is no comment on this page. [Display comments/form]