Hi everyone,
I'm new to scripting and i would like to ask a question about how to organize code. Personally i dislike a high number of global vars or having one event that handles multiple operations (like dataserver), so im thinking to use multiple scripts that do small pieces of code. I know the first reply would be that idle scripts consume memory, but do they still consume memory if i stop them (llSetScriptState)?
For example, have one script to return avatar key, another to
yes is quite a few cases where states make sense for the reasons you mention
a smart house fr example that does stuff on presence of the home owner
default
{
state_entry()
{
llSensorRepeat("", llGetOwner(), AGENT, 64.0, PI, 60.0);
}
sensor(integer num_detected)
{
state ownerAtHome;
}
}
state ownerAtHome
{
state_entry()
{
// .. unlock the doors
// .. turn the lights on
// .. start the fireplace burning
// .. put the kettle on
//