[slscripters] Inventory - Referencing Inventory Objects in LSL

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[slscripters] Inventory - Referencing Inventory Objects in LSL

Nicholas Mcelveen

I have a cube in the inventory of my script. I want to rezz a cube using the cube in my script. Since the name I've given the cube is "cube", would that text work with llRezObject()?

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

Where llList2String(gPrimType, ndx) is equal to "cube".

I'm wondering if I need to use llGetInventoryName(INVENTORY_OBJECT, (find the index of my cube in the collection of objects and place that value here)) in place of llList2String(gPrimType, ndx) where I've stored a string "cube".


Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]
_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Andromeda Quonset-2
At 02:19 PM 5/28/2012, Nicholas Mcelveen wrote:

>I have a cube in the inventory of my script. I want to rezz a cube
>using the cube in my script. Since the name I've given the cube is
>"cube", would that text work with llRezObject()?

That should be sufficient.

I would have a line before the llRezObject that checks if the cube is
present, and prevents attempting to rez if the cube object isn't in the invent


>llRezObject( llList2String(gPrimType, ndx),
>llList2Vector(gTranslate, ndx), ZERO_VECTOR,
>llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);
>
>Where llList2String(gPrimType, ndx) is equal to "cube".
>
>I'm wondering if I need to use llGetInventoryName(INVENTORY_OBJECT,
>(find the index of my cube in the collection of objects and place
>that value here)) in place of llList2String(gPrimType, ndx) where
>I've stored a string "cube".
>
>
>Nic Zenfold
>
>Clemson University
>CCIT - Web & Multimedia Technologies
>[hidden email]
>_______________________________________________
>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
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Nicholas Mcelveen
In reply to this post by Nicholas Mcelveen
I've verified that llList2String(gPrimType, ndx) is equal to "cube" using another script. I guess that means my problem is somewhere else.

Will a string loaded into my script from a notecard, that represents a vector <3.0, 8.0, 1.0>, ever be considered a vector in SL without being casted? I'm storing vectors in a list and when it is time to use those vectors I'm wondering the best way to reference the vector values, (vector)llList2String(listContainingVectors, indexOfVectorIwant) or  llList2Vector(listContainingVectors, indexOfVectorIwant)?

I'm using these vectors in the llRezObject function.

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

 ...or....

llRezObject( llList2String(gPrimType, ndx), (vector)llList2String(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot((vector)llList2String(gRotate, ndx) * DEG_TO_RAD), ndx+1);

gTranslate is a list that looks like this:
list gTranslate = [< 8.32676886726, 5.79051405069, 8.94444444444 >, < 8.32676886726, 5.79051405069, 7.72 >, < 7.61328769672, 5.54252458022, 4.64903888295 >];
---Just thinking out loud.... will spaces before the first and after the last value in a vector cause a problem with how these are used?

From my previous tests,

vector relativePositionVector = (vector)llList2String(gLineData, 3) + gRootPrimPos;
    - yields the correct value!

......but.......

 vector relativePositionVector = llList2Vector(gLineData, 3) + gRootPrimPos;
    - yields the value of gRootprimPos


Where glineData is a list that looks like this:
["cube", "translate", 1.0, < 8.32676886726, 5.79051405069, 9.0 >]



Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]
________________________________________
From: Sasun Steinbeck [[hidden email]]
Sent: Monday, May 28, 2012 4:42 PM
To: Nicholas Mcelveen
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

yep that's exactly how it works. Have you tried it? having problems? and you verified the llList2String actually returns "cube"?

On Mon, May 28, 2012 at 1:19 PM, Nicholas Mcelveen <[hidden email]<mailto:[hidden email]>> wrote:

I have a cube in the inventory of my script. I want to rezz a cube using the cube in my script. Since the name I've given the cube is "cube", would that text work with llRezObject()?

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

Where llList2String(gPrimType, ndx) is equal to "cube".

I'm wondering if I need to use llGetInventoryName(INVENTORY_OBJECT, (find the index of my cube in the collection of objects and place that value here)) in place of llList2String(gPrimType, ndx) where I've stored a string "cube".


Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]<mailto:[hidden email]>
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Jack of Spades

On May 28, 2012, at 4:56 PM, Nicholas Mcelveen wrote:

> vector relativePositionVector = (vector)llList2String(gLineData, 3) + gRootPrimPos;
>    - yields the correct value!

This is the method I use, with success. When read from a notecard, the data is all typed as string; it has to be cast to a vector.

--
Jack of Spades  A: Because it messes up the order in which people normally read text.
jack_of_spades  Q: Why is top-posting such a bad thing?
@me.com         A: Top-posting.
                Q: What is the most annoying thing in e-mail?






_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Frans-5
In reply to this post by Nicholas Mcelveen
You might be hitting the rez distance limit. The official distance you can rez something from the rezzing object is 10 meters, though depending on size it can be a somewhat further. 

On Mon, May 28, 2012 at 10:56 PM, Nicholas Mcelveen <[hidden email]> wrote:
I've verified that llList2String(gPrimType, ndx) is equal to "cube" using another script. I guess that means my problem is somewhere else.

Will a string loaded into my script from a notecard, that represents a vector <3.0, 8.0, 1.0>, ever be considered a vector in SL without being casted? I'm storing vectors in a list and when it is time to use those vectors I'm wondering the best way to reference the vector values, (vector)llList2String(listContainingVectors, indexOfVectorIwant) or  llList2Vector(listContainingVectors, indexOfVectorIwant)?

I'm using these vectors in the llRezObject function.

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

 ...or....

llRezObject( llList2String(gPrimType, ndx), (vector)llList2String(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot((vector)llList2String(gRotate, ndx) * DEG_TO_RAD), ndx+1);

gTranslate is a list that looks like this:
list gTranslate = [< 8.32676886726, 5.79051405069, 8.94444444444 >, < 8.32676886726, 5.79051405069, 7.72 >, < 7.61328769672, 5.54252458022, 4.64903888295 >];
---Just thinking out loud.... will spaces before the first and after the last value in a vector cause a problem with how these are used?

From my previous tests,

vector relativePositionVector = (vector)llList2String(gLineData, 3) + gRootPrimPos;
   - yields the correct value!

......but.......

 vector relativePositionVector = llList2Vector(gLineData, 3) + gRootPrimPos;
   - yields the value of gRootprimPos


Where glineData is a list that looks like this:
["cube", "translate", 1.0, < 8.32676886726, 5.79051405069, 9.0 >]



Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]
________________________________________
From: Sasun Steinbeck [[hidden email]]
Sent: Monday, May 28, 2012 4:42 PM
To: Nicholas Mcelveen
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

yep that's exactly how it works. Have you tried it? having problems? and you verified the llList2String actually returns "cube"?

On Mon, May 28, 2012 at 1:19 PM, Nicholas Mcelveen <[hidden email]<mailto:[hidden email]>> wrote:

I have a cube in the inventory of my script. I want to rezz a cube using the cube in my script. Since the name I've given the cube is "cube", would that text work with llRezObject()?

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

Where llList2String(gPrimType, ndx) is equal to "cube".

I'm wondering if I need to use llGetInventoryName(INVENTORY_OBJECT, (find the index of my cube in the collection of objects and place that value here)) in place of llList2String(gPrimType, ndx) where I've stored a string "cube".


Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]<mailto:[hidden email]>
_______________________________________________
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



--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Frans-5
Jack is correct, what is read from a notecard is a string, so either you have to cast them as a vector in your list or do a (vector)llList2String when you retrieve the item from the list. 

On Mon, May 28, 2012 at 11:00 PM, Frans <[hidden email]> wrote:
You might be hitting the rez distance limit. The official distance you can rez something from the rezzing object is 10 meters, though depending on size it can be a somewhat further. 

On Mon, May 28, 2012 at 10:56 PM, Nicholas Mcelveen <[hidden email]> wrote:
I've verified that llList2String(gPrimType, ndx) is equal to "cube" using another script. I guess that means my problem is somewhere else.

Will a string loaded into my script from a notecard, that represents a vector <3.0, 8.0, 1.0>, ever be considered a vector in SL without being casted? I'm storing vectors in a list and when it is time to use those vectors I'm wondering the best way to reference the vector values, (vector)llList2String(listContainingVectors, indexOfVectorIwant) or  llList2Vector(listContainingVectors, indexOfVectorIwant)?

I'm using these vectors in the llRezObject function.

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

 ...or....

llRezObject( llList2String(gPrimType, ndx), (vector)llList2String(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot((vector)llList2String(gRotate, ndx) * DEG_TO_RAD), ndx+1);

gTranslate is a list that looks like this:
list gTranslate = [< 8.32676886726, 5.79051405069, 8.94444444444 >, < 8.32676886726, 5.79051405069, 7.72 >, < 7.61328769672, 5.54252458022, 4.64903888295 >];
---Just thinking out loud.... will spaces before the first and after the last value in a vector cause a problem with how these are used?

From my previous tests,

vector relativePositionVector = (vector)llList2String(gLineData, 3) + gRootPrimPos;
   - yields the correct value!

......but.......

 vector relativePositionVector = llList2Vector(gLineData, 3) + gRootPrimPos;
   - yields the value of gRootprimPos


Where glineData is a list that looks like this:
["cube", "translate", 1.0, < 8.32676886726, 5.79051405069, 9.0 >]



Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]
________________________________________
From: Sasun Steinbeck [[hidden email]]
Sent: Monday, May 28, 2012 4:42 PM
To: Nicholas Mcelveen
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

yep that's exactly how it works. Have you tried it? having problems? and you verified the llList2String actually returns "cube"?

On Mon, May 28, 2012 at 1:19 PM, Nicholas Mcelveen <[hidden email]<mailto:[hidden email]>> wrote:

I have a cube in the inventory of my script. I want to rezz a cube using the cube in my script. Since the name I've given the cube is "cube", would that text work with llRezObject()?

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

Where llList2String(gPrimType, ndx) is equal to "cube".

I'm wondering if I need to use llGetInventoryName(INVENTORY_OBJECT, (find the index of my cube in the collection of objects and place that value here)) in place of llList2String(gPrimType, ndx) where I've stored a string "cube".


Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]<mailto:[hidden email]>
_______________________________________________
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



--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay




--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Nicholas Mcelveen
Thank you all for your help! I appreciate the quick response and whenever I finish this project I'll share my results with you.


Nicholas


Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]
________________________________________
From: Frans [[hidden email]]
Sent: Monday, May 28, 2012 5:04 PM
To: Nicholas Mcelveen
Cc: [hidden email]
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Jack is correct, what is read from a notecard is a string, so either you have to cast them as a vector in your list or do a (vector)llList2String when you retrieve the item from the list.

On Mon, May 28, 2012 at 11:00 PM, Frans <[hidden email]<mailto:[hidden email]>> wrote:
You might be hitting the rez distance limit. The official distance you can rez something from the rezzing object is 10 meters, though depending on size it can be a somewhat further.

On Mon, May 28, 2012 at 10:56 PM, Nicholas Mcelveen <[hidden email]<mailto:[hidden email]>> wrote:
I've verified that llList2String(gPrimType, ndx) is equal to "cube" using another script. I guess that means my problem is somewhere else.

Will a string loaded into my script from a notecard, that represents a vector <3.0, 8.0, 1.0>, ever be considered a vector in SL without being casted? I'm storing vectors in a list and when it is time to use those vectors I'm wondering the best way to reference the vector values, (vector)llList2String(listContainingVectors, indexOfVectorIwant) or  llList2Vector(listContainingVectors, indexOfVectorIwant)?

I'm using these vectors in the llRezObject function.

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

 ...or....

llRezObject( llList2String(gPrimType, ndx), (vector)llList2String(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot((vector)llList2String(gRotate, ndx) * DEG_TO_RAD), ndx+1);

gTranslate is a list that looks like this:
list gTranslate = [< 8.32676886726, 5.79051405069, 8.94444444444 >, < 8.32676886726, 5.79051405069, 7.72 >, < 7.61328769672, 5.54252458022, 4.64903888295 >];
---Just thinking out loud.... will spaces before the first and after the last value in a vector cause a problem with how these are used?

From my previous tests,

vector relativePositionVector = (vector)llList2String(gLineData, 3) + gRootPrimPos;
   - yields the correct value!

......but.......

 vector relativePositionVector = llList2Vector(gLineData, 3) + gRootPrimPos;
   - yields the value of gRootprimPos


Where glineData is a list that looks like this:
["cube", "translate", 1.0, < 8.32676886726, 5.79051405069, 9.0 >]



Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]<mailto:[hidden email]>
________________________________________
From: Sasun Steinbeck [[hidden email]<mailto:[hidden email]>]
Sent: Monday, May 28, 2012 4:42 PM
To: Nicholas Mcelveen
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

yep that's exactly how it works. Have you tried it? having problems? and you verified the llList2String actually returns "cube"?

On Mon, May 28, 2012 at 1:19 PM, Nicholas Mcelveen <[hidden email]<mailto:[hidden email]><mailto:[hidden email]<mailto:[hidden email]>>> wrote:

I have a cube in the inventory of my script. I want to rezz a cube using the cube in my script. Since the name I've given the cube is "cube", would that text work with llRezObject()?

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

Where llList2String(gPrimType, ndx) is equal to "cube".

I'm wondering if I need to use llGetInventoryName(INVENTORY_OBJECT, (find the index of my cube in the collection of objects and place that value here)) in place of llList2String(gPrimType, ndx) where I've stored a string "cube".


Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]<mailto:[hidden email]><mailto:[hidden email]<mailto:[hidden email]>>
_______________________________________________
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



--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay




--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Nicholas Mcelveen
In reply to this post by Frans-5
Speaking of the rez distance limit any suggestions for getting around some of the distance limitations of SL? I could rez the object at the prim root and the move it into position. I could rez the object at root then wright a script that reads the root prims note card for values and updates itself. Is this an area where others have been able to leverage the rules of SL for personal effects?


Nicholas


Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]
________________________________________
From: Frans [[hidden email]]
Sent: Monday, May 28, 2012 5:00 PM
To: Nicholas Mcelveen
Cc: Sasun Steinbeck; [hidden email]
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

You might be hitting the rez distance limit. The official distance you can rez something from the rezzing object is 10 meters, though depending on size it can be a somewhat further.

On Mon, May 28, 2012 at 10:56 PM, Nicholas Mcelveen <[hidden email]<mailto:[hidden email]>> wrote:
I've verified that llList2String(gPrimType, ndx) is equal to "cube" using another script. I guess that means my problem is somewhere else.

Will a string loaded into my script from a notecard, that represents a vector <3.0, 8.0, 1.0>, ever be considered a vector in SL without being casted? I'm storing vectors in a list and when it is time to use those vectors I'm wondering the best way to reference the vector values, (vector)llList2String(listContainingVectors, indexOfVectorIwant) or  llList2Vector(listContainingVectors, indexOfVectorIwant)?

I'm using these vectors in the llRezObject function.

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

 ...or....

llRezObject( llList2String(gPrimType, ndx), (vector)llList2String(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot((vector)llList2String(gRotate, ndx) * DEG_TO_RAD), ndx+1);

gTranslate is a list that looks like this:
list gTranslate = [< 8.32676886726, 5.79051405069, 8.94444444444 >, < 8.32676886726, 5.79051405069, 7.72 >, < 7.61328769672, 5.54252458022, 4.64903888295 >];
---Just thinking out loud.... will spaces before the first and after the last value in a vector cause a problem with how these are used?

From my previous tests,

vector relativePositionVector = (vector)llList2String(gLineData, 3) + gRootPrimPos;
   - yields the correct value!

......but.......

 vector relativePositionVector = llList2Vector(gLineData, 3) + gRootPrimPos;
   - yields the value of gRootprimPos


Where glineData is a list that looks like this:
["cube", "translate", 1.0, < 8.32676886726, 5.79051405069, 9.0 >]



Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]<mailto:[hidden email]>
________________________________________
From: Sasun Steinbeck [[hidden email]<mailto:[hidden email]>]
Sent: Monday, May 28, 2012 4:42 PM
To: Nicholas Mcelveen
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

yep that's exactly how it works. Have you tried it? having problems? and you verified the llList2String actually returns "cube"?

On Mon, May 28, 2012 at 1:19 PM, Nicholas Mcelveen <[hidden email]<mailto:[hidden email]><mailto:[hidden email]<mailto:[hidden email]>>> wrote:

I have a cube in the inventory of my script. I want to rezz a cube using the cube in my script. Since the name I've given the cube is "cube", would that text work with llRezObject()?

llRezObject( llList2String(gPrimType, ndx), llList2Vector(gTranslate, ndx), ZERO_VECTOR, llEuler2Rot(llList2Vector(gRotate, ndx) * DEG_TO_RAD), ndx+1);

Where llList2String(gPrimType, ndx) is equal to "cube".

I'm wondering if I need to use llGetInventoryName(INVENTORY_OBJECT, (find the index of my cube in the collection of objects and place that value here)) in place of llList2String(gPrimType, ndx) where I've stored a string "cube".


Nic Zenfold

Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]<mailto:[hidden email]><mailto:[hidden email]<mailto:[hidden email]>>
_______________________________________________
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



--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Stickman-2
> Speaking of the rez distance limit any suggestions for getting around some of the distance limitations of SL? I could rez the object at the prim root and the move it into position. I could rez the object at root then wright a script that reads the root prims note card for values and updates itself. Is this an area where others have been able to leverage the rules of SL for personal effects?

You probably want to rez the object, and then have the object use the
wonderful new llSetRegionPos
http://wiki.secondlife.com/wiki/LlSetRegionPos that was added a bit
ago. It's technically only accurate to 0.1m, though I haven't tested
it. So you can call llSetRegionPos, and then
llSetLinkPrimitiveParamsFast on the root prim just to make sure it's
nudged into position.

If you need to communicate the position the rezzed prim should move,
one way is to pass a number with the final parameter of llRezAtRoot()
and use that as a channel to listen on, then pass the position for the
rezzed prim to move to using that channel. If you pick a random
channel, you can avoid crosstalk. Though you may need to delay a bit
to make sure the listen comes up on the rezzed prim before the rezzing
prim says the position.

Another solution could be moving the rezzing prim to the place you
want to rez using llSetRegionPos(), rezzing at ZERO_VECTOR, then move
the rezzing prim to the next location. That relies on the rezzing prim
being able to move, though.

Stickman
_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

AnnMarie Otoole
In reply to this post by Nicholas Mcelveen
I do this frequently and extensively.  The rezzee item Whispers to the
rezzer with "Location?".  You can use a preset channel or use a channel
number supplied by the rezzer and read by the rezzee.
Rezzer sends "Location=vector" information to Rezzee.  Rezzee then
extracts ID of rezzer for future use and navigates to the destination.
In fact on one product a single prim can end up with over 400 prims
spread out over 4 sims communicating as a system with various
communication methods.

On 5/28/2012 5:11 PM, Nicholas Mcelveen wrote:

> Speaking of the rez distance limit any suggestions for getting around some of the distance limitations of SL? I could rez the object at the prim root and the move it into position. I could rez the object at root then wright a script that reads the root prims note card for values and updates itself. Is this an area where others have been able to leverage the rules of SL for personal effects?
>
>
> Nicholas
>
>
> Clemson University
> CCIT - Web&  Multimedia Technologies
> [hidden email]
>

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Jack of Spades
In reply to this post by Nicholas Mcelveen

On May 28, 2012, at 5:11 PM, Nicholas Mcelveen wrote:

> Speaking of the rez distance limit any suggestions for getting around some of the distance limitations of SL? I could rez the object at the prim root and the move it into position. I could rez the object at root then wright a script that reads the root prims note card for values and updates itself. Is this an area where others have been able to leverage the rules of SL for personal effects?

When that's all I need to send to the child script, I use the start parameter, taking 8 bits for each of x, y, & z and decoding them in the newly-rezzed child to give an offset from the initial rez position. So something like:

integer X_MASK = 0x7FC0000;
integer X_OFFSET = 18;
integer Y_MASK = 0x3FE00;
integer Y_OFFSET = 9;
integer Z_MASK = 0x1FF
integer Z_OFFSEST = 0x0;

default
{
    on_rez( integer p )
    {
        if ( p ) {
            integer x = ( p & X_MASK ) >> X_OFFSET - 255;
            integer y = ( p & Y_MASK ) >> Y_OFFSET - 255;
            integer z = ( p & Z_MASK ) >> Z_OFFSET - 255;
           
            llSetRegionPos( llGetPos() + < x, y, z > / 10.0 );
           
            llRemoveInventory(llGetScriptName() );
        }
    }
}    


--
Jack Abraham A: Because it messes up the order in which people normally read text.
jack.abraham Q: Why is top-posting such a bad thing?
@me.com      A: Top-posting.
             Q: What is the most annoying thing in e-mail?




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Nicholas Mcelveen
Thank you for the ideas. I'll read up on this in the Scripting Your World book that I'm using for reference/introduction. I remember seeing a script there that uses the listen feature.  

With llSetRegionPos, the root/rezzing prim has to move in order to be within a 10 meter distance of the rezzed prim in order to update the rezzed prim position?

Looking at the specifications I see that:

llSetRegionPos( vector position );

where:
position is more than 10m off region or above 4096m.

    The x & y components of position must be in the range [-10.0, 266.0].[1]
    The z component must be in the range [0.0, 4096].


So llSetRegionPos can be used in place of llSetLinkPrimitiveParamsFast and I don't have to worry about using the listen method?



Nic


Clemson University
CCIT - Web & Multimedia Technologies
[hidden email]
________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Jack Abraham [[hidden email]]
Sent: Monday, May 28, 2012 5:31 PM
To: SL Scripters
Subject: Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

On May 28, 2012, at 5:11 PM, Nicholas Mcelveen wrote:

> Speaking of the rez distance limit any suggestions for getting around some of the distance limitations of SL? I could rez the object at the prim root and the move it into position. I could rez the object at root then wright a script that reads the root prims note card for values and updates itself. Is this an area where others have been able to leverage the rules of SL for personal effects?

When that's all I need to send to the child script, I use the start parameter, taking 8 bits for each of x, y, & z and decoding them in the newly-rezzed child to give an offset from the initial rez position. So something like:

integer X_MASK = 0x7FC0000;
integer X_OFFSET = 18;
integer Y_MASK = 0x3FE00;
integer Y_OFFSET = 9;
integer Z_MASK = 0x1FF
integer Z_OFFSEST = 0x0;

default
{
    on_rez( integer p )
    {
        if ( p ) {
            integer x = ( p & X_MASK ) >> X_OFFSET - 255;
            integer y = ( p & Y_MASK ) >> Y_OFFSET - 255;
            integer z = ( p & Z_MASK ) >> Z_OFFSET - 255;

            llSetRegionPos( llGetPos() + < x, y, z > / 10.0 );

            llRemoveInventory(llGetScriptName() );
        }
    }
}


--
Jack Abraham A: Because it messes up the order in which people normally read text.
jack.abraham Q: Why is top-posting such a bad thing?
@me.com      A: Top-posting.
             Q: What is the most annoying thing in e-mail?




_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Stickman-2
> So llSetRegionPos can be used in place of llSetLinkPrimitiveParamsFast and I don't have to worry about using the listen method?

If the origin/rezzer object can move around, yes. That sounds easier
than managing interprim communication. Usually when I'm rezzing
things, I don't have control over the rezzing object because it's
attached, or needs to stay in a fixed position. If there's no problem
with moving the rezzing prim around, that sounds like the simplest
solution.

Stickman
_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Dallas Denny
In reply to this post by Nicholas Mcelveen
Two ideas come to mind. First, you can make the cube part of a
linkset and move the cube as far as possible from the root. which
will have to be within the 10m limit. Rez with the linkset invisible
except for the cube, unlink the cube, then delete the rest of the linkset.

Or, have the first cube rez a second cube up to 10 meters away. You
could set this up as many times as was necessary.

I'm sure there are other ways to do it. I like that LSL allows so
many solutions.


-----

Speaking of the rez distance limit any suggestions for getting around
some of the distance limitations of SL? I could rez the object at the
prim root and the move it into position. I could rez the object at
root then wright a script that reads the root prims note card for
values and updates itself. Is this an area where others have been
able to leverage the rules of SL for personal effects?


Nicholas

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Inventory - Referencing Inventory Objects in LSL

Jack of Spades
In reply to this post by Nicholas Mcelveen

On May 28, 2012, at 6:17 PM, Nicholas Mcelveen wrote:

> With llSetRegionPos, the root/rezzing prim has to move in order to be within a 10 meter distance of the rezzed prim in order to update the rezzed prim position?

The script snippet I posted is meant to be in the rezzed object. The start parameter is used to pass the final position to the new object via llRezObject so as to avoid the cycle of setting up a listener and passing the data that way, though it's only useful if you're not using the start parameter for anything else. Constructing the start parameter is left as an exercise for the student. : )

> Looking at the specifications I see that:
>
> llSetRegionPos( vector position );
>
> where:
> position is more than 10m off region or above 4096m.
>
>    The x & y components of position must be in the range [-10.0, 266.0].[1]
>    The z component must be in the range [0.0, 4096].
>
>
> So llSetRegionPos can be used in place of llSetLinkPrimitiveParamsFast and I don't have to worry about using the listen method?

llSetLinkPrimitiveParamsFast is an older way to move prims into position; we now have llSetRegionPos for that. (llSetLinkPrimitiveParams also does tons of other stuff.) As Stickman says, if the rezzer can move around so that it's always within 10m of where the prim needs to be rezzed, that's another approach.

Learning to construct listeners is something you'll want to have in your toolbox regardless; they're essential for short-range communication. Pay particular attention to llRegionSayTo; it's a new tool and a lot of documentation won't be aware of it yet, but it makes communication much more efficient when you can use it.

--
Jack Abraham A: Because it messes up the order in which people normally read text.
jack.abraham Q: Why is top-posting such a bad thing?
@me.com      A: Top-posting.
             Q: What is the most annoying thing in e-mail?




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