02-19-2013, 02:19 AM
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
Particle Script
•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 (glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
if (wind) flags = flags | PSYS_PART_WIND_MASK;
if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
if (followVel) flags = 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_COLOR, startColor,
PSYS_PART_END_COLOR, endColor,
PSYS_PART_START_SCALE,startSize,
PSYS_PART_END_SCALE,endSize,
PSYS_SRC_PATTERN, pattern,
PSYS_SRC_BURST_RATE,rate,
PSYS_SRC_ACCEL, push,
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_OMEGA, omega,
PSYS_SRC_MAX_AGE, life,
PSYS_SRC_TEXTURE, texture,
PSYS_PART_START_ALPHA, startAlpha,
PSYS_PART_END_ALPHA, endAlpha]);
}
default{
//
state_entry(){
llListen(our_channel, "","","");
set_particles();
}
//
listen(integer channel, string name, key id, string message){
if (channel == our_channel){
list cmd_list = llParseString2List(message, ["="], []);
string cmd0 = llList2String(cmd_list, 0);
string cmd1 = llList2String(cmd_list, 1);
if(cmd0 == "Key"){
target = (key)cmd1;
set_particles();
}
}
}
//
}