Rezzing and sizing
|
|
Gui Ra
Registered User
Join date: 12 Dec 2006
Posts: 9
|
04-17-2007 07:01
Hi,
Who knows i can get some help here, this thing is getting me crazy! hehe I created a box on the floor, opened its contents and made an script inside of it to the touch event. Well...what i want to do.... when touch he copies an object of my inventory and brings to the world (im using llRezObject function) BUT.... the trouble comes now.... i want to know if it´s possible, after this sphere is created, if i can change it´s size using the script IN the box. Describing more objective. i want to change de scale of another object in other object´s script.
I tried to use the llSetScale function, but do not modify the Sphere i want, it modifies the box where the script is >_<
thanks in advance ^^
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
04-17-2007 07:07
You could always have the box send the spehere a message to resize itself. Or even pass a parameter to the sphere when you rez it that specifies the scale the sphere would then resize to on rez.
Rj
|
|
Gui Ra
Registered User
Join date: 12 Dec 2006
Posts: 9
|
04-17-2007 07:18
hi. Thanks for the advice ^^ but i dont know which function i can use to send message to resize >_< sorry about my noob script knowledge >_<
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-17-2007 07:25
How much data are you wanting to pass to the shpere or is this a generic question? To establish communication with the sphere will require that it has a script in it. When rezzed the rezzer can pass an integer parameter which can be used to specify a channel on which to listen. The rezzer and rezeee can then send messages using llSay on that channel. Look in this thread for a more detailed example.
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
04-17-2007 07:26
The easiest way is probably to pass a parameter when you rez it.
What kind of scaling do you plan to use? I.e., 2 times, 3 times the size? Or .5 times the size, 1.7 times, the sizes, etc? (Integer or fractions?)
If it's integers, you can pass an integer parameter as part of the llRezObject function.
Rj
|
|
Gui Ra
Registered User
Join date: 12 Dec 2006
Posts: 9
|
04-17-2007 07:28
Thanks for the help. I´ll read the thread you told about, but just asking your question. I want just to copy a sphere from my inventory and tell it to resize to for example, 2.0 in X axis. Just it! ^^ Im trying to make a kind of "object array" script. ^^
|
|
Gui Ra
Registered User
Join date: 12 Dec 2006
Posts: 9
|
04-17-2007 07:39
I want to pass float values. but im dont know a lot about the script functions.... i want to rez an object with 1.27 (example). How the other objet can read the parameter? i have to drop a script in the object i rezzed too?
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
04-17-2007 07:51
Based on where you seem to be going with this, I'd say Newgate's approach of passing a chat channel and sending the info that way would be best.
Yeah you'd need a script in the rez'ed object to receive the chat channel passed through llRezObject from the box, and then it would llListen for the scale on that channel, which the original box would llSay.
Rj
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-17-2007 08:08
If all you want to do is pass it a single piece of floating data that is its new scale then RJ's integer solution is fine. Multiply the scale by 100000 (for example) and use the result as the integer parameter of llRezInventory. If the scales are known a head of time, i.e. not dynamically calculated then its even easier. integer scale = 127000; // 1.27 llRezObject("ball", pos, <0,0,0>, <0,0,0,0>, scale);
The sphere will need to have a script in it befor eit is rezzed default { on_rez(integer scalefactor) { float scale = (float)scalefactor / 100000.; vector size = llGetScale(); size *= scale; llSetScale(size);
// Delete the script as its function is completed llRemoveInventory(llGetScriptName()); } }
|
|
Gui Ra
Registered User
Join date: 12 Dec 2006
Posts: 9
|
04-17-2007 10:56
Thanks  the code works perfectly!  Let me ask something, the parameter that i send with llRezObject (the last one), MUST be an integer? it exists a way to send more parameters? the sphere works perfectly, now im trying to scale a cube ^^ (i promisse is the last one primitive i want to work with hahahaha) and the cube have 3 different size variables. i need to pass them to the rezzed cube. THANKS for the help ! very helpfull! ^^ 
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
04-17-2007 22:11
I really must be an integer, but you could pack smaller numbers into it, e.g., max positve size is about 2 G, which is 2 x thousand * thousand * thousand, so you could pack 3 integers between 0 and 999, one would be as is, one you would multiply by a thousand and one you would multiply by a million. Hope that makes sense.
Or you could do what Newgate suggested first, and that is to pass a channel number to which the rezzee can respond with its own channel number on which it (the rezzee) will listen, and then for the rezzor to shout whatever data you need passed to the rezzee. iow, you are defining and using a communications protocol!
|