Another important thing to take into account when dealing with scripted objects is the dreaded no outside scripts parcel. These are a huge downer and I personally try to stay away from them, but there are times when one must enter them anyways. The no-script rule exists for various reasons, and is entirely up to the parcel owner on whether or not to apply it, but even then...sometimes you just want your stuff to work! Fortunately there is a small workaround implemented by the Lindens to preserve the functionality of vehicles, AOs, and the like. Basically, a script that has taken controls from an avatar will NOT cease to function when entering a no-script parcel. That being said, here is a small example of a non-intrusive way to take controls from the owner without actually doing anything with them:
llTakeControls(CONTROL_LBUTTON,FALSE,TRUE);
This takes controls from the left mouse button but does not accept (process) them. You don't even need a control event to handle the input.
There are a few supposed limitations to this rule, however. For starters, the script must have already taken controls BEFORE entering the parcel, else the script cannot start up to take controls in the first place. Also, certain "blacklisted" functions will cause the script to stop working anyways. I have not tested this in detail so I can't tell you just which ones they are...the obvious answer is to experiment. This workaround is good for non-obtrusive scripts such as radars, AOs, dash huds, and the like. It's not so great for things like rezzers, for while the rezzing will still take place, if the rezzed object is scripted it will not be able to run properly. Anyways, always something to consider when making your various objects.
Side note: Some functions seem to work in no-script areas in a script that isn't even taking controls, for instance llOwnerSay(). That happens to be the only one I've tested, but it does prove my point. So, again, experiment a bit...your script might not even need to take controls to keep working.
No comments:
Post a Comment