Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Targeting Particles

Ziggy21 Slade
Registered User
Join date: 10 Jul 2007
Posts: 6
01-03-2010 05:34
Hi

I am using a couple of free scripts from The Particle Laboratory to shoot particles at an avatar named in chat, it works great but the particles go straight for the avatars crotch, which, although amusing, is a little weird for my particular use, is there a way to make the particles hit the avatars chest area?
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
01-03-2010 08:45
According to the caveats at http://wiki.secondlife.com/wiki/LlParticleSystem/
From: someone
Particles moving towards a humanoid avatar, specified by PSYS_SRC_TARGET_KEY rule and setting the PSYS_PART_TARGET_POS_MASK flag, will end up at the geometric center of the avatar's bounding box which, unfortunately, make them appear to be striking the person in the groin area. If you want them to end up at another point on a target avatar, you instead have to place a target prim that is moved to the position where you wish them to end up, and use the key of that prim for the value of the PSYS_SRC_TARGET_KEY rule.

What you want can be done, but it involves a fair bit of work...
jeaniesing Trilling
Loves to animate & script
Join date: 21 Oct 2006
Posts: 61
01-03-2010 08:57
From: Ziggy21 Slade
Hi

I am using a couple of free scripts from The Particle Laboratory to shoot particles at an avatar named in chat, it works great but the particles go straight for the avatars crotch, which, although amusing, is a little weird for my particular use, is there a way to make the particles hit the avatars chest area?



unfortunately no.. it goes for object center and avatar mass center is... well...

you can make the particles go large to avoid the anatomic target look?
_____________________
Pinastri/113/171/30
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
01-03-2010 10:05
From: Pete Olihenge
According to the caveats at http://wiki.secondlife.com/wiki/LlParticleSystem/

What you want can be done, but it involves a fair bit of work...


Ayup.

You'd likely want to use llSensor to find the avatar, then llDetectedPos to get their position and then move a target prim with a known UUID to llDetectedPos + <0,0,x> with x being your desired vertical offset from the pelvis. Then you can fire the particles at the target prim.

Another option is to just fire at the prim always and tell the prim what avatar name to constantly follow until told to come back to "home". That way the prim does the work following the AV and offsetting itself and the particle generator just does its job firing particles.
Ziggy21 Slade
Registered User
Join date: 10 Jul 2007
Posts: 6
01-03-2010 10:16
Thanks for your replies everyone, I've decided to just shoot everyone in the balls! as it does have some comedy value, and the 'move a prim' solution is perhaps a little over the top for this little novelty item.

Jeredin - just wondering where you are from? cos we say 'Ayup' a lot, here in Nottingham!
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
01-03-2010 10:18
From: Ziggy21 Slade
Thanks for your replies everyone, I've decided to just shoot everyone in the balls! as it does have some comedy value, and the 'move a prim' solution is perhaps a little over the top for this little novelty item.

Jeredin - just wondering where you are from? cos we say 'Ayup' a lot, here in Nottingham!


Born in CA, raised in NV... basically a west coaster from the US... I got "ayup" from reading too many Stephen King books where the characters have a Maine accent I think. Either that or from my grandpa hehe.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
01-03-2010 10:28
From: jeaniesing Trilling
you can make the particles go large to avoid the anatomic target look?


A biggish particle with an offset texture could do the trick. It will still look weird at first until the texture loads :/
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
01-03-2010 10:31
'Eyup, me duck! (bet they don't say that in Maine).

In addition to the methods discussed (and I was going to suggest using a follower prim as the target -- I often do that), you might try angling the emitter. I've just been playing the the particle lab's "beam" template and this, with some success:

CODE
vector lookat; 
key target;
default
{
state_entry()
{
llSetRot( llRotBetween( < 0.0, 0.0, 0.1 >, llVecNorm(lookat-llGetPos())));
}

touch_start(integer n){

target = llDetectedKey(0);
lookat = llList2Vector(llGetObjectDetails (target,[OBJECT_POS]),0);
lookat.z+=0.5;
llSetRot( llRotBetween( < 0.0, 0.0, 0.1 >, llVecNorm(lookat-llGetPos())));
llSetTimerEvent(0.5);
}

timer(){

lookat = llList2Vector(llGetObjectDetails (target,[OBJECT_POS]),0);
lookat.z+=0.5;
llSetRot( llRotBetween( < 0.0, 0.0, 0.1 >, llVecNorm(lookat-llGetPos())));
}

}
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-03-2010 10:33
you may find this old thread useful (or not..) it has an idea or three that should theoretically work, although none are detailed out in code.


ayup is fairly popular in several areas of the southc eastern US too.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
01-03-2010 10:50
From: Void Singer
you may find this old thread useful (or not..) it has an idea or three that should theoretically work, although none are detailed out in code.


ayup is fairly popular in several areas of the southc eastern US too.


Ahh I liked your suggestion in that thread.

Basically a particle cannon aimed where you want the particles to go, firing a particle with a known speed and known life, terminating coinciding with distance to target. Elegant...
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-03-2010 11:28
From: Jeredin Denimore
Ahh I liked your suggestion in that thread.

Basically a particle cannon aimed where you want the particles to go, firing a particle with a known speed and known life, terminating coinciding with distance to target. Elegant...

and a PITA to code... =/ (would you believe math isn't my strong suite?)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -