From: Wyatt Burton
1) Can there be multiple scripts inside the same prim? If yes which one's default state is executed first?
yes, and whichever compiles fastest/first... effectively they are simultaneous
[technically, tiny slices of each one would be executed in the order the sim finds them (possibly the same order they are listed in the prim)]
From: someone
2) Is llMessageLink the only way multiple scripts communicate with each other inside the same prim.
they could possibly communicate other ways by modifying and monitoring a prim property, or any of several other things, but link messages will usually be your best bet
From: someone
3) Are global variables the only ones that retain permanently their values (until reset) when a prim is not active. Can you have globals in multiple scripts of the same prim?
essentially, yes, variables declared in an event handler clear when the handler is exited. globals don't (unless you do something to clear them). you can have as many globals as you can fit in each script (there are other possible static storage options like prim properties, whith their own cost and benefits)
From: someone
4) Is a reset only done when one saves or manually resets to clear the global variables. Must each script be reset individually?
script resets occur:
- these will reset a single script
when compiling
when called from the script (llResetScript)
when called from another script (llResetOtherScript)
when called by the user from the script window (reset)
-this may reset multiple scripts
when called from the tools menu by the user (reset selected script, or reset all scripts in selection)
and sometimes (but not always) when a sim is reset/restarted
global variables can be cleared just like any other variable, so a reset is NOT the only way to do it.
for reference:
