Rotation question

View: New views
13 Messages — Rating Filter:   Alert me  

Rotation question

by Colleen Marjeta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: Rotation question

by Colleen Marjeta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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

Re: Rotation question

by Tigro Spottystripes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

how 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

by Stickman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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 out

by Maxxi Short :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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

Re: Reading a notecard times out

by Andromeda Quonset-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: Reading a notecard times out

by Tigro Spottystripes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In 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 out

by AnnMarie@SLFBI :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
It 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 out

by Glen Canaday :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.
 
I've never seen a timeout on a notecard read before.
 
--GC

On Sat, Nov 7, 2009 at 11:32 AM, <AnnMarie@...> wrote:
It 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



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Re: Reading a notecard times out

by Dale Innis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 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

Parent Message unknown Re: Reading a notecard times out

by jbhancroft :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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().

- JB

------Original Message------
From: Dale Innis
Sender: secondlifescripters-bounces@...
To: secondlifescripters@...
Subject: Re: Reading a notecard times out
Sent: Nov 10, 2009 2:01 PM

On 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


Sent via BlackBerry by AT&T
_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Re: Reading a notecard times out

by Glen Canaday :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

@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().

- JB

------Original Message------
From: Dale Innis
Sender: secondlifescripters-bounces@...
To: secondlifescripters@...
Subject: Re: Reading a notecard times out
Sent: Nov 10, 2009 2:01 PM

On 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


Sent via BlackBerry by AT&T
_______________________________________________
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

Parent Message unknown Re: Reading a notecard times out

by Glen Canaday :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

haha.. Dale's not the only one who sees a problem ;P You definitely will need the number of lines. I honestly just think that you had a few asset server hiccups, but I haven't a clue how you'd get it to time out. I've never once seen that in 3 years.
 
Someone else suggested a timer for it that would re-request a read on timeout. I think I can agree with that.
--GC

 
On Tue, Nov 10, 2009 at 7:31 PM, Maxxi Short <maxxi@...> wrote:
Good idea, Glen, and probably feasible while I only have a hundred or so lines in the notecard. Ultimately though, I'd like to have a thousand or more lines in the notecard, and only want to read in a random selection of a few dozen questions.
 
----- Original Message -----
Sent: Tuesday, November 10, 2009 5:50 PM
Subject: Re: Reading a notecard times out

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.
 
I've never seen a timeout on a notecard read before.
 
--GC

On Sat, Nov 7, 2009 at 11:32 AM, <AnnMarie@...> wrote:
It 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



_______________________________________________
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