Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

False 'TYPE' error

Harley Dae
Registered User
Join date: 28 Dec 2006
Posts: 3
12-28-2006 22:19
Hi,

I'm trying to modify the particle script from Ama Omega (modified by Eep Quirk).

http://rpgstats.com/wiki/index.php?title=ExampleParticleScript1

I want to let the particles flow towards an opposite avatar (like the white dots that are flowing to an object when you touch it). To find the avatar I use the 'LLSensor' function. But I keep getting the error message 'invalid type' at the 'range' attribute with the LLSensor. Can someone give me a hint how to solve this? Is there an other way to find an opposite avatar (key) to send the particles to?

Here is the example of my coding part:

if (target == "owner";) target = llSensor ("", NULL_KEY, AGENT | ACTIVE, 9.9, PI_BY_TWO)

The problems are always appearing at the 9.9 area. It doesn't matter if I change this to 10 or 10.0. I will always recieve an error two caharcters behind the , from the ACTIVE. My main scripting abilities are 'copy and paste' so I might have missed something somewhere?

Hope someone can help me out.

regards

Harley Dae
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
12-29-2006 01:04
Hi Harley,

The llSensor function does not "return" anything, so the error is actually the "target =" portion of the code, not the llSensor call itself.

Instead of assigning llSensor() to the target variable, you need to handle the sensor event. See this thread for a basic sensor script you can examine.

-peekay
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-29-2006 02:07
If you are only interested in the Owner then use

if (target == "owner";) target = llGetOwner();

No Sensor required.

For non owner targets, the normal way for this kind of thing, poofies are a prime example, is for the user to type in the name of the target. You use this to fire of a sensor and then in the sensor event trigger the particles. Partial name matching is possible using a non specific sensor (no name) and then checking each return for a match.
Harley Dae
Registered User
Join date: 28 Dec 2006
Posts: 3
12-29-2006 02:11
Thnx Peekay for the quick reply.

As I understand the only return I get from the LLSensor is a number of avatars whitin the range. I don't receive an avatar name or key somewhere.

I would like to point a 'shower' of particles to an opposite avatar from a stick. (like the magical want of Harry Potter). But I need to have the name or key of the opposite avatar to point to. Then by pointing the want with and right click the shower of particles (sparks) will hit the opposite avatar.

Do you have any other idea how to get an opposite avatar as 'target'.

Harley.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-29-2006 02:14
You get the number of detected targets to a maximum of 16. This can then be used to iterate through the list. You can get the details using llDetectedKey and llDetectedName to see who it was.

The particle system use a key not a name.
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
12-29-2006 02:19
Hi Harley,

As Newgate mentioned sensor() gives you a number because there could be multiple avatars within the detection range, and you can use llDetectedKey to obtain the keys of those avatars.

Suppose sensor returned 2 results. Then "key target = llDetectedKey(0)" within the sensor handler gets the key of the first avatar, and llDetectedKey(1) returns the key of the second avatar. Usually scripters use a "for" loop to go through all the results sensor returned.

See the thread mentioned above for an example.

-peekay
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-29-2006 02:22
ever get the feeling we are writing the same thing at the same time Peekay???
Harley Dae
Registered User
Join date: 28 Dec 2006
Posts: 3
12-29-2006 02:34
Newgate and Peekay,

Thnx to the both of you for the quick responses, I think I do get the feeling after your advices. But here is another question for you.

How can I get particles flowing around at the time I 'touch' something. For instance if I really touch something (not tru the pie chart 'touch') with my magic want, there will be particles emmitting from the place where my want touches the opposite item (avatar or other items).

regards Harley.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-29-2006 02:38
I take it you mean get the object you touch to emit particles? Not unless you own them and wrote them to respond to your wand.

Other way is for your wand to rez a prim, move it to the target and then start emitting particles. This obviously has limitations on no script or no rez land.