Hello,
Can you pass parameters when you rez an object?
ty,
kt
These forums are CLOSED. Please visit the new forums HERE
rezobject params |
|
Komuso Tokugawa
Registered User
Join date: 3 Mar 2005
Posts: 93
|
07-05-2005 02:23
Hello,
Can you pass parameters when you rez an object? ty, kt |
Vortex Saito
Quintzee Creator
Join date: 10 Sep 2004
Posts: 73
|
07-05-2005 03:37
_____________________
|
Komuso Tokugawa
Registered User
Join date: 3 Mar 2005
Posts: 93
|
07-05-2005 15:14
mmm...that's just one interger param no?
Anyway to pass multiple constuctor params? |
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
07-05-2005 15:21
http://secondlife.com/badgeo/wakka.php?wakka=object_rez
http://secondlife.com/badgeo/wakka.php?wakka=llListen http://secondlife.com/badgeo/wakka.php?wakka=llListenRemove _____________________
---
|
Komuso Tokugawa
Registered User
Join date: 3 Mar 2005
Posts: 93
|
07-05-2005 16:11
ah...doh!
object-rez and send a message with the params to the newly created object? How fast will this work in the case of an object being fired, and I want to set the mass, for example? np...I'll test it. thanks again, Jeffrey. |
Bond Harrington
Kills Threads At 500yds
Join date: 15 May 2005
Posts: 198
|
07-05-2005 16:31
ah...doh! object-rez and send a message with the params to the newly created object? How fast will this work in the case of an object being fired, and I want to set the mass, for example? np...I'll test it. thanks again, Jeffrey. Ummm, I don't think you can set mass. You can fake it with Bouyancy or adjust it by making the prim larger (mass is based off volume of the prim/object), but there's no llSetMass command, despite what LSL says. |
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
07-05-2005 16:51
Fairly rapidly. Roughly within the split-second range, because object-rez ensures the object has been properly rezzed before it's invoked.
As for mass, the best ways to "fake" it are llSetForce, llApplyImpulse, and learning how to "divide out" mass in functions like llPushObject. In general, I've yet to find a reason to use buoyancy, but that's just me. _____________________
---
|
Catherine Omega
Geometry Ninja
![]() Join date: 10 Jan 2003
Posts: 2,053
|
07-05-2005 18:51
Remember, an integer can actually contain quite a bit of data. You can "conceal" several different presets within the 32-bit range. Remember, integer values range from -2147483648 to 2147483647. Depending on what you're trying to accomplish, you may yet be able to get away without using a listener.
_____________________
|
Johnny Noir
Registered User
Join date: 5 Jan 2004
Posts: 28
|
07-06-2005 06:23
Remember, an integer can actually contain quite a bit of data. You can "conceal" several different presets within the 32-bit range. Remember, integer values range from -2147483648 to 2147483647. Depending on what you're trying to accomplish, you may yet be able to get away without using a listener. A good point, Catherine. To make it more explicit, remember that you can cast between strings and integers. This means that, for example, you could build your string with a series of 0 and 1 (representing true/false) or other values, and then cast it to an integer so that it could be passed with the rez command. So long as you're careful to avoid leading zeroes (since the leading zeroes would be eliminated in the cast), and keep your sequencing tight, you can get a reasonable amount of data in. It's not huge (since you're basically limited to 10 digits, although you could play with the negative I guess, so 11) but it's enough for a couple starting parameters. As an example of how to really play with this, you could also use the param to pass a customized listen channel. In other words, to avoid cross-channel contamination (and to speed listening by not having to parse commands as much) you could pass the channel to be listened on via the param, with the rez'd object listening only on that channel. Alternately, if you were REALLY clever (I mean exceedingly so) you could figure out a way to encode - in those 11 digits - the data required to procedurally generate a larger number that itself contained the info you wanted to pass. This could be done through prime-products (the product of any two primes is always unique, with that product being the "full" data set for the receiving object), etc. Of course, this gets into some rather sophisticated math - far beyond my skills, personally - in order to be effective. If you pull it off though, please share: we're all eager for better ways to pass information between objects. (LINDEN PLEASE HEAR OUR PRAYERS!) |
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
07-06-2005 09:27
You can get (obviously) 32 true/false statements - just think of the runs of 1's and 0's in binary, convert them to base 10 and pass that. It might well be more hassle than it's worth, but it gives you a lot of scope.
Passing other things requires some more play, but can be done - you could use a leading 1 or 2 (in the right-hand most column) to code for different sorts of following messages, then have 10 digits to code for what you want. That could be a 3sf vector, 5 letters, or a range of other things pretty easily. At some point though using an llListen, or rezzing it linked and adding a link message or similar is going to be more effecient I strongly suspect. Always open listens on open channels are to be avoided, but there are times when nothing else will do, so use it if it's the right option. If it is a 'listen' once situation unlinking or llListenRemove are your friends... Everyone elses too! |