|
View:
New views
13 Messages
—
Rating Filter:
Alert me
|
|
|
Rotation questionOkay... so i'm dealing with a problem involving rotation, which I don't have a real clue about. Reading up all I can.
What I'm trying to accomplish is this: Avatar sits on object
Avatar goes into mouselook On the control (mouse left click) event, I want to detect the rotation of the avatar in mouselook (where the avatar is looking). I've tried llGetRot(), llDetectedRot(), both return the initial sitting rotation of the avatar, rather than the direction the avatar is facing in mouselook. Not sure if this can be done, or if so how. Any thoughts? _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Rotation questionOf course as soon as I sent this I found a solution. Don't know if its the best one though....
In the control event, I call llSensor("", avatar, blah.... in the _sensor_ event I call llDetectedRot()
It's returning the correct info now On Wed, Nov 4, 2009 at 7:35 AM, Colleen Marjeta <colleenmarjeta@...> wrote: Okay... so i'm dealing with a problem involving rotation, which I don't have a real clue about. Reading up all I can. _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Rotation questionhow about tracking camera rotation? wouldn't even have to waste
resources with sensor stuff Colleen Marjeta escreveu: > Of course as soon as I sent this I found a solution. Don't know if > its the best one though.... > > In the control event, I call llSensor("", avatar, blah.... > > in the _sensor_ event I call llDetectedRot() > > It's returning the correct info now > > On Wed, Nov 4, 2009 at 7:35 AM, Colleen Marjeta > <colleenmarjeta@... <mailto:colleenmarjeta@...>> wrote: > > Okay... so i'm dealing with a problem involving rotation, which I > don't have a real clue about. Reading up all I can. > > What I'm trying to accomplish is this: > > Avatar sits on object > > Avatar goes into mouselook > > On the control (mouse left click) event, I want to detect the > rotation of the avatar in mouselook (where the avatar is looking). > > I've tried llGetRot(), llDetectedRot(), both return the initial > sitting rotation of the avatar, rather than the direction the > avatar is facing in mouselook. Not sure if this can be done, or > if so how. > > Any thoughts? > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Click here to unsubscribe or manage your list subscription: > https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters > _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Rotation question> I've tried llGetRot(), llDetectedRot(), both return the initial sitting
llGetRot() in an attachment while in mouselook will return the direction an avatar is looking. http://wiki.secondlife.com/wiki/LlGetRot I assume you're not working with attachments, so another solution like you found is necessary. -Stickman _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Reading a notecard times outI've got a general knowledge quiz machine in my
shop, and it works by reading questions from a notecard.
The notecard has around a hundred lines in it (one
per question), and the script works as follows:
1. In state_entry, it calls
llGetNumberOfNotecardLines, with a timer event. This has so far never failed, so
it reads the notecard OK at this stage to get the number of lines.
2. In the dataserver event, the logic
goes:
a. If this is the first time in (ie we got here via
the llGetNumberOfNotecardLines call), check that we have enough lines in the
notecard - that the number of lines is > 10. This bit has never failed. Then
build up a list of ten random integers, all different, where each integer is a
number from 0 to maxlines-1 (maxlines is the number of lines in the notecard).
Then call llGetNotecardLine(notecard,seq) where seq is the first number in our
list.
b. If this is not the first time in (ie we got here
via the llGetNotecardLine call above), get the data returned (it's a line with
the question and answer in) and append it to a list, then call
llGetNotecardLine(notecard,seq) again, where seq is the next integer in our
numbers list.
So for example, in step a my list may look like
this: [84, 15, 9, 2,19...]
and my second list in step b may look like this:
["What is the capital of France:Paris","How many signs of the zodiac are
there:12",...]
Once I have all 10 questions, I change
state.
So it's fairly standard code, except I'm not
reading the notecard sequentially - I'm reading ten random lines from
it.
Most of the time this works fine - however, every
few days the llGetNotecardLine call times out. It then e-mails to me say it's
timed out, and the debug info tell me it's usually read a few lines before
timing out. I've set the timer to time out after not getting a response for 30
seconds.
Is this just down to SL lag, or is there a coding
reason why my llGetNotecardLine would time out occasionally?
Maxxi.
_______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Reading a notecard times out
Hi!
I have a lot of things which rely on notecard reading. My requirements have always been to read in sequence, so I've always depended on the EOF to know I've read the entire notecard, rather than using llGetNumberOfNotecardLines, but I see why you do it, and it seems to me to be reasonable. I have had a few issues in recent months myself with stuck notecard reading. What I have done is to introduce a 10-second timer event when I request a line from a notecard. If the timer event is triggered, then the same line is re-requested. If the line is received, the timer event is disabled until the next different line is requested. So far, it has worked well. My only issue has been when I'm already using the event timer for something else, which makes implementation a little more complex. Andro At 03:43 AM 11/7/2009, you wrote: I've got a general knowledge quiz machine in my shop, and it works by reading questions from a notecard. _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Reading a notecard times outIn emergences you can use llSensorRepeat looking for somthign that can't
be found, like a agent without last name, and use the no_sensor event for the second timer. Looking for somthing that is sure to not ever be found gives you mroe certainty it will run than looking for somthign you expect to always be there as some unexpected future condition could cause it to not be there, but if you look for somthing that is techinicly impossible to ever be found, you can always count with the no_sensor event. But if when needing two repeting timers in signle script, the two timers rats are both multiples of a same number, you could have a single timer for that number and keep counting how many timer events happened between each separated trigger, whenever it reaches the desired amount of repetitionss an if statement would lead to the adequate code for either frequency. Andromeda Quonset escreveu: > Hi! > > I have a lot of things which rely on notecard reading. My > requirements have always been to read in sequence, so I've always > depended on the EOF to know I've read the entire notecard, rather than > using llGetNumberOfNotecardLines, but I see why you do it, and it > seems to me to be reasonable. > > I have had a few issues in recent months myself with stuck notecard > reading. What I have done is to introduce a 10-second timer event > when I request a line from a notecard. If the timer event is > triggered, then the same line is re-requested. If the line is > received, the timer event is disabled until the next different line is > requested. So far, it has worked well. My only issue has been when > I'm already using the event timer for something else, which makes > implementation a little more complex. > > Andro > > At 03:43 AM 11/7/2009, you wrote: >> I've got a general knowledge quiz machine in my shop, and it works by >> reading questions from a notecard. >> >> The notecard has around a hundred lines in it (one per question), and >> the script works as follows: >> >> 1. In state_entry, it calls llGetNumberOfNotecardLines, with a timer >> event. This has so far never failed, so it reads the notecard OK at >> this stage to get the number of lines. >> >> 2. In the dataserver event, the logic goes: >> >> a. If this is the first time in (ie we got here via the >> llGetNumberOfNotecardLines call), check that we have enough lines in >> the notecard - that the number of lines is > 10. This bit has never >> failed. Then build up a list of ten random integers, all different, >> where each integer is a number from 0 to maxlines-1 (maxlines is the >> number of lines in the notecard). Then call >> llGetNotecardLine(notecard,seq) where seq is the first number in our >> list. >> >> b. If this is not the first time in (ie we got here via the >> llGetNotecardLine call above), get the data returned (it's a line >> with the question and answer in) and append it to a list, then call >> llGetNotecardLine(notecard,seq) again, where seq is the next integer >> in our numbers list. >> >> So for example, in step a my list may look like this: [84, 15, 9, >> 2,19...] >> and my second list in step b may look like this: ["What is the >> capital of France:Paris","How many signs of the zodiac are there:12",...] >> >> Once I have all 10 questions, I change state. >> >> So it's fairly standard code, except I'm not reading the notecard >> sequentially - I'm reading ten random lines from it. >> >> Most of the time this works fine - however, every few days the >> llGetNotecardLine call times out. It then e-mails to me say it's >> timed out, and the debug info tell me it's usually read a few lines >> before timing out. I've set the timer to time out after not getting a >> response for 30 seconds. >> >> Is this just down to SL lag, or is there a coding reason why my >> llGetNotecardLine would time out occasionally? >> >> Maxxi. >> >> >> >> _______________________________________________ >> Click here to unsubscribe or manage your list subscription: >> https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters > > ------------------------------------------------------------------------ > > _______________________________________________ > Click here to unsubscribe or manage your list subscription: > https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters > _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Reading a notecard times outIt is not uncommon, especially in times of lag, for
incoming data to arrive out of sequence. It might help to add sequence
numbers to the line data on the notecard and check the incoming sequence, then
buffer locally. I use techniques like this for all my http communications,
and even some local object to object communicatioans.
_______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Reading a notecard times outI can understand why you'd do it this way and I see the logic, but I'd probably read in the whole note, one line per list item, randomize the list, then toss out all but the first 10 questions with lDeleteSubList(list, 9, llGetListLength(list) - 1) or somesuch. Afterward I'd most likely parse the remaining 10 items into Q & A pairs and then move into normal operation without using the llGetNumberOfNotecardLines() call at all.
I've never seen a timeout on a notecard read before.
--GC
On Sat, Nov 7, 2009 at 11:32 AM, <AnnMarie@...> wrote:
_______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
Re: Reading a notecard times outOn Tue, Nov 10, 2009 at 12:50 PM, Glen Canaday <gcanaday@...> wrote:
> I can understand why you'd do it this way and I see the logic, but I'd > probably read in the whole note, one line per list item, randomize the list, > then toss out all but the first 10 questions with lDeleteSubList(list, 9, > llGetListLength(list) - 1) or somesuch. Afterward I'd most likely parse the > remaining 10 items into Q & A pairs and then move into normal operation > without using the llGetNumberOfNotecardLines() call at all. The big disadvantage of that is that reading notecard lines can be reallllly slow; so reading zillions of them and then throwing away all but ten would be a huge waste of elapsed time. _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
|
|
|
Re: Reading a notecard times out@JB: Naught wrong with that at all! I use that very method on a couple of things since they have to store way more data than I'm comfy with in a single script.
@ Dale: Yeah, it can be a waste of reading time, no doubt. Won't get the problem in the original post tho! Thankfully I don't make trivia games :D Her original problem's just the asset server being a buttface on occasion. It happens to all of us at one point or another (and another).
My biggest concern isn't really the read-time but the amount of memory it eats. It's temporary, and the memory can be freed by emptying the lists, but the initial surge could be more than the script engine can bear if the note's big enough. I have a few items that skirt the edge a bit, my AO being one of them since it allows as many anims as memory will hold. I'm definitely thinking of splitting that up into a reader module and an execution module... as soon as I can replace my dead computer and get off of this loaner.
--GC
On Tue, Nov 10, 2009 at 5:09 PM, <jbhancroft@...> wrote: I've used an approach of having a separate script whose job is to read through the notecard(s), pre-process the text as needed, and have it available for other scripts to retrieve via llMessageLinked(). _______________________________________________ Click here to unsubscribe or manage your list subscription: https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |