Second Life Copybot
Particle Targeting - Printable Version

+- Second Life Copybot (https://secondlifecopybot.com)
+-- Forum: SECOND LIFE PRODUCTS (https://secondlifecopybot.com/forum-1.html)
+--- Forum: SCRIPTS (https://secondlifecopybot.com/forum-1022.html)
+---- Forum: SCRIPTS (https://secondlifecopybot.com/forum-8.html)
+----- Forum: PARTICLES (https://secondlifecopybot.com/forum-52.html)
+----- Thread: Particle Targeting (/thread-816.html)



Particle Targeting - deadpool - 02-19-2013

How-to/Info:

•Copy paste the scripts below into new scripts inworld.
•Save it & then put them into separate objects (if not there already).
•Touch the object with the Give Key script.
•The Particle Script should now have it’s particle streaming towards the ‘Give Key’ object.

Give Key Script
PHP Code:
integer our_channel = -1212123;
default{
    
touch_start(integer total_number){
        
llSay(our_channel"Key="+(string)llGetKey());
    }


Particle Script
PHP Code:
//We listen on this channel for our target key
integer our_channel = -1212123;
//Message we listen for "Key=b31b25aa-de... etc". The = symbol being the seperator.
 
//Particle Params
key target;
integer glow TRUE;           
integer bounce FALSE;         
integer interpColor TRUE;    
integer interpSize TRUE;      
integer wind FALSE;           
integer followSource FALSE;    
integer followVel TRUE;       
integer pattern PSYS_SRC_PATTERN_ANGLE_CONE;
float age 5.0;                  
float maxSpeed 1.5;            
float minSpeed 0.5;           
string texture "b31b25aa-de9a-32d7-7c3d-6cfb997c37ba";                 
float startAlpha 1.0;           
float endAlpha 1.0;           
vector startColor = <1,1,1>;    
vector endColor = <0,0,0>;     
vector startSize = <0.0,0.0,0.0>;    
vector endSize = <0.1,0.1,0.0>;       
vector push = <0,0,0>;          
float rate 0.01;           
float radius 0.0;         
integer count 1000;        
float outerAngle 1.55;   
float innerAngle 1.55;   
vector omega = <20,20,20>;    
float life 0;             
integer flags;
set_particles(){
    if (
glowflags flags PSYS_PART_EMISSIVE_MASK;
    if (
bounceflags flags PSYS_PART_BOUNCE_MASK;
    if (
interpColorflags flags PSYS_PART_INTERP_COLOR_MASK;
    if (
interpSizeflags flags PSYS_PART_INTERP_SCALE_MASK;
    if (
windflags flags PSYS_PART_WIND_MASK;
    if (
followSourceflags flags PSYS_PART_FOLLOW_SRC_MASK;
    if (
followVelflags flags PSYS_PART_FOLLOW_VELOCITY_MASK;
    if (
target != ""flags flags PSYS_PART_TARGET_POS_MASK;
    
llParticleSystem([  
        
PSYS_PART_MAX_AGE,age,
        
PSYS_PART_FLAGS,flags,
        
PSYS_PART_START_COLORstartColor,
        
PSYS_PART_END_COLORendColor,
        
PSYS_PART_START_SCALE,startSize,
        
PSYS_PART_END_SCALE,endSize
        
PSYS_SRC_PATTERNpattern,
        
PSYS_SRC_BURST_RATE,rate,
        
PSYS_SRC_ACCELpush,
        
PSYS_SRC_BURST_PART_COUNT,count,
        
PSYS_SRC_BURST_RADIUS,radius,
        
PSYS_SRC_BURST_SPEED_MIN,minSpeed,
        
PSYS_SRC_BURST_SPEED_MAX,maxSpeed,
        
PSYS_SRC_TARGET_KEY,target,
        
PSYS_SRC_INNERANGLE,innerAngle
        
PSYS_SRC_OUTERANGLE,outerAngle,
        
PSYS_SRC_OMEGAomega,
        
PSYS_SRC_MAX_AGElife,
        
PSYS_SRC_TEXTUREtexture,
        
PSYS_PART_START_ALPHAstartAlpha,
        
PSYS_PART_END_ALPHAendAlpha]);
}
 
default{
//
    
state_entry(){
        
llListen(our_channel"","","");
        
set_particles();
    }
//
    
listen(integer channelstring namekey idstring message){
        if (
channel == our_channel){
            list 
cmd_list llParseString2List(message, ["="], []);
            
string cmd0 llList2String(cmd_list0);
            
string cmd1 llList2String(cmd_list1);
            if(
cmd0 == "Key"){
                
target = (key)cmd1;
                
set_particles();
            }
        }
    }
//