In one of the projects I'm working on I have a complex script that's stopped and started by a shorter script.
The shorter one uses llSensorRepeat() to see if there's an avatar within a certain distance and will set the bigger script running (with llSetScriptState()) if someone comes within the range of llSensorRepeat(). Once the avatar leaves the llSensorRepeat() range it stops the bigger one, again with llSetScriptState().
However, I've noticed that I get a lot of stack/heap collision errors when using the two together and testing with llGetFreeMemory() shows there to be anywhere between 4.6K and 2K of free memory in the bigger script right before the collisions occur (which is making me doubt that it really is running out of memory).
If I leave the smaller script out and just let the bigger one run I don't seem to get the stack/heap collisions.
So, does anyone know if llSetScriptState() can cause stack/heap collisions in the script it's supposed to stop and start?