Jump to content

Recompiling Scripts: When And Why?


Perrie Juran
 Share

You are about to reply to a thread that has been inactive for 4483 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Oftentimes when a scripted object In World such as a bed or a dance ball begins to malfunction the common fix has been to go into 'edit' and 'reset the scripts.'  I can't even remember when and where and who and why I learned this from.  It's more or less a reflex now and 99% of the time works.

But I have also noticed that many times when I go into edit and look at the build menu I am presented with the options also of "recompile mono" or "recompile LSO" in addition to the choice to simply "reset scripts."

So for what reason would I choose to recompile verses reset?  Will I gain any advantage (improvement in performance) by this?  Will one style be better than another?  Or should I just play it safe and stick with "reset?"

Thanks

Perrie

Link to comment
Share on other sites

There's no point in recompiling a script unless you made a change in it, or unless you decided that you would rather compile it as LSO rather than Mono (or vice versa).  It doesn't hurt to recompile it, but really all you mean to do is restart the thing.  So yes, stick with "Reset".

The biggest difference betweeen LSO and Mono is how much memory each reserves for a script.  LSO always reserves 16K; Mono defaults to 64K but a scripter can now use llSetMemoryLimit to reserve less space (as little as 4K) if that's appropriate.  You can take a look at recent threads in this forum to get a feel for the finer points of how and why you might want to do that.  Most of that detail is irrelevant to non-scripters and, in fact, is something that most users are better off not paying attention to.  The bottom line is that scripts written today can be written to make more efficient use of memory resources than in the past, and that as a result most scripters are now using Mono rather than LSO. 

Link to comment
Share on other sites

Unless you know something of the internals of the script it's probably best to always reset.

LSO and Mono are the two virtual-machines SL uses to run scripts.  The biggest difference (to us) is that LSO scripts take 16k RAM, Mono scripts 64k.  Recompiling a Mono script to LSO could very well make it run out of memory - since it's suddenly 'lost' 3/4 of what it expected.  Recompiling an LSO script as Mono probably won't have such an impact - and could even be good - but there are technical 'issues' with Mono in some situations (eg; sim crossings) which could mean it's not a sensible idea

Link to comment
Share on other sites

Recompile for either virtual machine(mono or LSO) will build a brand new code from the souce code and do a reset.
Reset alone will reset all variables and conditions to the start values.

Recompile can be done only when you have permissions to modify the source code I guess.
Reset can be done when you have permission to modify the prim the script is in.

I am not certain of the detailed permission circumstances, but I think it is what I said

Link to comment
Share on other sites

thank you for the answers.

sometimes i'm terrible.   :D  one question leads me to a hundred more.

if i recompiled a mono to lso or visa vers, would i be able to change it back?

can an object have more than one style in it?

again,

thanks

Link to comment
Share on other sites


Perrie Juran wrote:

[...]

if i recompiled a mono to lso or visa vers, would i be able to change it back?

can an object have more than one style in it? [...]


Yes, you could change it back.  If you had permission to recompile it in the first pace (see Dora's reply), they you'd have permission to do it again.  As we've each said, though, there's usually little point in doing it. You're better off just leaving things alone.

Yes, you could have a LSO and a Mono-compiled script in the same object.  Neither one knows how the other was compiled.

Link to comment
Share on other sites

Very rarely but it does happen that a script loses its way somewhere in the dark labyrinths of the server and helplessly wanders there for eternity not being able to find its way out... or in computer terms the bytecode gets corrupted and is either executed incorrectly or not executed at all. That is the case when you do need to recompile because reset would not help. In all my time in-world, which is somewhat considerable, I've seen 2 or 3 such cases but it does happen.

Link to comment
Share on other sites


Ela Talaj wrote:

Very rarely but it does happen that a script loses its way somewhere in the dark labyrinths of the server and helplessly wanders there for eternity not being able to find its way out... or in computer terms the bytecode gets corrupted and is either executed incorrectly or not executed at all. That is the case when you do need to recompile because reset would not help. In all my time in-world, which is somewhat considerable, I've seen 2 or 3 such cases but it does happen.

I am guessing here that the "lost in the labyrinth" symptom would be resetting the scripts not fixing the problem.

Which would then prompt this question, how would I know which form, LSL or Mono, to recompile it to?

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4483 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...