|
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
|
05-25-2007 04:51
I need to have my script re-read a note card if the note card changed. I have the proper "Changed" event in place to detect the change and that seems to work okay. What I'm doing is an llResetScript() when that condition occurs. I may be wrong, but it looks as though the note card is not getting re-read at the llResetScript and I'm wondering if it's because the E-O-F switch, which is a system variable, isn't getting reset so it "thinks" there's nothing else to read. Could this be what's going on and, if so, what do I do to force a re-read? Any help you can provide would be greatly appreciated as I am completely stumped! Thank you, Bartiloux Desmoulins
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
05-25-2007 05:34
EOF simply occurs when you read a line number beyond the number of lines in the notecard... this is not a true database EOF. You do not have to reset the 'pointer'. Reading the notecard from line zero will suffice. Resetting the script should reinitialise all script conditions predictably each time.
Are you sure that the script is really being reset?
|
|
Salvador Nakamura
http://www.sl-index.com
Join date: 16 Jan 2007
Posts: 557
|
05-25-2007 05:40
Hello, i encounterd the same problem, it seems the CHANGE event, looks for the size of the notecard, if that does not change the script will not reset ?
...perhaps you can try adding ie. a space to the notecard and see if it helps..
|
|
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
|
05-25-2007 05:54
Pale, to make sure the script was being reset I even went so far as to press the <RESET> button on the script window. Initially, upon rezzing, the script reads a note card to get the listen channel and then tells the user what channel it's listening on. Subsequent commands to the script using the designated script channel work fine. If, however, I change the note card to point to a different listen channel, and then reset the script either manually or automatically, I do not get the message that tells me the new script channel AND I am no longer able to issue commands on the new OR the old listen channel. At the top of the script I added I changed the script from integer cfg_channel; to integer cfg_channgel=9898; After that point is where the read of the note card config channel takes place. Initially the listen works on the original channel. Changing the note card and forcing a reset, however, after adding the manual assignment to channel 9898, causes the script to start listening not on the old or the new note card channel, but on channel 9898. I'm so confused. :/ Bartiloux Desmoulins
|
|
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
|
05-25-2007 06:16
From: Bartiloux Desmoulins Initially, upon rezzing, the script reads a note card to get the listen channel and then tells the user what channel it's listening on. I think I see your problem. The on_rez event is not called when you reset a script, only when the object is rezzed into the world. So if you are reading the notecard from your on-rez event using llResetScript will not cause it to read in the informaion. Take a look here for information on what events are called when: http://lslwiki.net/lslwiki/wakka.php?wakka=events
|