Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

script dies

Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
10-20-2007 06:55
this is starting to annoy the crap out of me, been trying different things in the past days...

busy making a script wich works perfectly well with the timer function, last evening i added an touch_start() so on click u get llmapdestination to open the map

timer event set to 15 minutes

From: someone
state normal
{
state_entry()
{
llSetTimerEvent(timer_var);
llRequestAgentData(tenant_key,DATA_ONLINE);
name_var = llGetObjectName();
}

dataserver(key queryid, string data)
{
online_var = data;
}

changed (integer change)
{
state default;
}

timer()
{
state status;
}

this works perfectly with no problems, but when i want to show the map on click:
From: someone

state normal_map
{
state_entry()
{
llSetTimerEvent(timer_var);
llRequestAgentData(tenant_key,DATA_ONLINE);
name_var = llGetObjectName();
}

dataserver(key queryid, string data)
{
online_var = data;
}

changed (integer change)
{
state default;
}

touch_start(integer abc)
{
llMapDestination(rental_region, (vector)rental_vector, (vector)rental_vector);
}

timer()
{
if(DEBUG2)
{
llSay(0, "Exiting timer period: normal_map";);
}
state status;
}
}

now the pain with the touch added, the script dies after 5- to 10 minutes and needs to be reset, then it dies again while in the timer wait

now the stupid thing, if i add llsay(0, "what ever crap here";); abouve "state normal;"
the script keeps running for ever fine, if i change the channel to private it dies again, if i just do a simple math to keep it active it dies aswell
make a math to check if a certain time has passed to keep the timer on 60second and it dies aswell
set it to say something in public when exiting the waiting time and it runs fine again

so my question is: WTF?!?!?!

wished i could wrap that touch into an if statement so it could just run in the normal state after checking instead of using 2 but i can`t figure the hell of it why i need to add llsay(); befor changing state in the normal_map state wich includes the touch_start (tried touch() aswell, no luck)

runs fine with DEBUG@ enabled aswell as that says each state entering or exiting with every state change in public but when false, the script dies aswell as it has no llsay() ggrrrr

any ideas? :confused:
_____________________
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
10-20-2007 07:19
It is hard to say what is happening without seeing the rest of the code.

But, I think you can make the touch event handler conditional which may save you a state. Incidentally, I find "state" to be a confusing term (from a software background), and prefer to read it as "change to another set of event handlers" instead. "State" in the conventional sense can be kept in global variables, for example:

integer touchAllowed = 0;

state normal {
...
touch(integer t) {
if(touchAllowed) {
doStuff();
}
}

I hope that gets you somewhere.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-20-2007 07:42
If in doubt; simplify, simplfy, simplify!!!!!

Create another script with just the llMapDestination with rental_vector declared as a global variable up top and cast as a string ( I would imagine this is why you are having to typecast it as a vector in the llMapDestination call) and try it.

ALso would check if you are ending the timer with llSetTimerEvent(0.0) or is it still running and doing the same step again and again?

One other thing to try. I have started to find LSLEditor invaluable for debugging now because you can see the state changes, list calls, timer runs etc as they are happening in the debug window.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
10-20-2007 07:56
From: Malachi Petunia
It is hard to say what is happening without seeing the rest of the code.

But, I think you can make the touch event handler conditional which may save you a state. Incidentally, I find "state" to be a confusing term (from a software background), and prefer to read it as "change to another set of event handlers" instead. "State" in the conventional sense can be kept in global variables, for example:

integer touchAllowed = 0;

state normal {
...
touch(integer t) {
if(touchAllowed) {
doStuff();
}
}

I hope that gets you somewhere.

wished i could but it would show to much :/
need to use different states as of data collecting

think i`ve tried that befor aswell but it still kept dying, rewritten parts of it to do the if in the touch again and let it run for a couple of cycles but won`t be suprised if it dies during the timer wait again :(

thx :)
_____________________
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
10-20-2007 08:59
let it run with the touch() and if() in it but it died again after 7-8 minutes

removed the touch() and the script goes on without an glitch

added an empty touch() and the script died again, removed the touch and the script runs fine


something to write home about... how to loose ur mind...
_____________________
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-20-2007 09:03
Well did you try one of my suggestions?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
10-20-2007 09:07
From: Jesse Barnett
Well did you try one of my suggestions?

no not yet, only mal`s tip about trying the if() again in the touch as i wasn`t sure

i kno it isn`t the llMapDestination() as the script dies with it our without it aslong there is an touch in it, even an empty touch and it dies after a reset

i`ll give the lsleditor a try and see if it can figure out wth is going wrong when the touch is enabled, thx for that idea :)
_____________________
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-20-2007 09:13
One other suggestion would be pasting it into the lslint page and see what the analysis is;

http://w-hat.com/lslint

ie maybe 2 touch_starts in same state etc.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
10-20-2007 09:57
well, ran it trough lsleditor and that lslint

both return no errors, with or without an touch in it

SL will still die if it has an touch in it

got 2 running and the script without the touch() in it has been running fine for the past 1.5hour lol
_____________________