Script just stops running
|
Dante Breck
Spellchek Roxs
Join date: 29 Oct 2006
Posts: 113
|
01-01-2010 12:25
Can anyone tell me why my script will run after compiled and for an indeterminate time afterwards and then become unresponsive even when reset? Everything works fine for a while but then it no longer wants to respond to a touch. Recompiling it will get it running again but not a reset and not a "set scripts running".
I'm not seven sure where to begin to look for a reason.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-01-2010 12:49
depending on the permissions of the object/script some of those commands will fail, particularly the ones from the tools menu
if you're the creator of the object and script I'd chalk it up to the sim having issues and try it on another sim.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-01-2010 12:56
It's hard to say without knowing more about either the script or the environment where it's running. If you find yourself in a parcel where scripts are disabled, for example, that could do it. Or you may have exceeded the script's memory somehow, perhaps by adding to many names or keys to some internal list. There are also functions which, given the wrong type of data, will cause a script to stop dead.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Dante Breck
Spellchek Roxs
Join date: 29 Oct 2006
Posts: 113
|
Thanks for input - figured it out
01-01-2010 13:16
Well I fixed it but not sure I understand what I was doing wrong.
The script is a basic dialogue based script. On touch present user (owner) with a dialogue. Depending on what option is selected the script changes from the default state to a new state. In the new state there is a secondary dialogue presented. Amongst the options there is a Back button and a Done button. For Back I wanted it to go back to the main dialogue. For Done I wanted it to return to the default state. Back was working but Done would cause the script to stop.
What I was using before was just the return; command. I changed it to explicitly send the script back to the default state and added in a global variable to monitor what my current state was so that the main menu would not be represented to the user when they click done.
Even though it works I would like to understand why return; wasn't doing the trick. I thought return would discontinue further execution within the state it was called and return the user to a default state.
I am hesitant to put the script up here as it is going to be part of an inworld product but I can give a copy of the development object with that in it inworld.
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
01-01-2010 13:27
From: Dante Breck Even though it works I would like to understand why return; wasn't doing the trick. I thought return would discontinue further execution within the state it was called and return the user to a default state. One you go into a new state, you are basically "trapped" in that state and its event handlers until you explicitly go to another state (with state default or whatever) or reset the script. return will only get you out of functions and event handlers.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-01-2010 13:29
Ah..... return will dump you out of the current function or event but keep you in the same state. If you want to change states, as you discovered, you need to do it explicitly.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Dante Breck
Spellchek Roxs
Join date: 29 Oct 2006
Posts: 113
|
01-01-2010 13:33
Ah ok, now I understand. Makes sense now. Thanks Victoria, Rolliq. The Wiki didn't come across that way to me.
|
Dante Breck
Spellchek Roxs
Join date: 29 Oct 2006
Posts: 113
|
01-01-2010 14:02
One more question .. how do I turn off the partical effect every time the script does something?
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
01-01-2010 14:23
From: Dante Breck One more question .. how do I turn off the partical effect every time the script does something? You mean the swirly chat things? You can't get rid of those short of making the object silent, it's a viewer feature.
|
Dante Breck
Spellchek Roxs
Join date: 29 Oct 2006
Posts: 113
|
01-01-2010 14:32
Yup those are the things I was talking about but I figured there must be a way since I have a pair of shoes that you can make changes to using the scripts in them and they don't generate any of those swirly things.
When I peek at the shoes they have what would appear to be listener scripts in all the child prims (yeah there are a lot of them .. wholly lag) and several main scripts in the root. The two shoes must talk to each other through chat but there are no swirly things.
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
01-01-2010 14:36
Avoiding chat is really the only way, you won't get swirlies if you use a different interface like everything in dialogs. The swirlies are kind of limited; for example, if there is an llOwnerSay, only the owner sees the swirls because other people's viewers aren't receiving the message at all.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-01-2010 14:36
if a script says something via chat an av can see, that particle effect will appear (for the av that can see it). if you use llInstantMessage instead, the particle effect will not appear.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Tanith Rosenbaum
Registered User
Join date: 10 Sep 2008
Posts: 42
|
01-01-2010 20:38
From: Dante Breck One more question .. how do I turn off the partical effect every time the script does something? Only way I know to get rid of the swirly particles thing is to attach it as HUD.
|
Dante Breck
Spellchek Roxs
Join date: 29 Oct 2006
Posts: 113
|
01-03-2010 13:06
Well I got rid of the swirlies .. just eliminated all chatting that I could hear. Once I was finished debugging and removed all the llOwnerSay commands telling me what was going on all the swirlies went away.
Thanks everyone for the help, I appreciate it. I learned a lot building this script and its companion.
|