Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
XS Pets Breedable_pet_eye_scripts  

Breedable_pet_eye_scripts

This script uses animated eyes made from GIF files. There is an article on how to use it at http://metaverse.mitsi.com/secondlife/posts/breedable-pet-robot/pet-Robot.htm

Category: XS Pets
By : Ferd Frederix
Created: 2012-08-16 Edited: 2012-08-16
Worlds: Second Life

the Zip file

Download all files for Breedable_pet_eye_scripts
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Breedable_pet_eye_scripts_1.lsl
Get file # 2. Breedable_pet_eye_scripts_2.lsl
Get file # 3. Breedable_pet_eye_scripts_3.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 // xs_eye script
2 // Version 0.32 12-03-2011
3
4
5 // blinking eye plug in script.lsl
6 // Use this with eyes made by the Gif2SL converter
7 /////////////////////////////////////////////////////////////////////
8 // This code is licensed as Creative Commons Attribution/NonCommercial/Share Alike
9
10 // See http://creativecommons.org/licenses/by-nc-sa/3.0/
11 // Noncommercial -- You may not use this work for commercial purposes
12 // If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
13 // This means that you cannot sell this code but you may share this code.
14 // You must attribute authorship to me and leave this notice intact.
15 //
16 // Exception: I am allowing this script to be sold inside an original build.
17 // You are not selling the script, you are selling the build.
18 // Ferd Frederix
19
20
21 // Put any texture converted by gif_2_SL_animation_v0.6.exe into a prim with this script to get it to play back automatically as a movie
22 //
23
24 integer nTextures;
25
26 integer animOn = TRUE; //Set to FALSE and call initAnim() again to stop the animation.
27 list effects = [LOOP]; // LOOP for GIF89 movies
28 integer movement = 0;
29 integer face = ALL_SIDES; //Number representing the side to activate the animation on.
30 integer sideX = 1; //Represents how many horizontal images (frames) are contained in your texture.
31 integer sideY = 1; //Same as sideX, except represents vertical images (frames).
32 float start = 0.0; //Frame to start animation on. (0 to start at the first frame of the texture)
33 float length = 0.0; //Number of frames to animate, set to 0 to animate all frames.
34 float speed = 10.0; //Frames per second to play.
35
36
37 integer i;
38
39 fetch()
40 {
44
46 llSetTexture(texture,ALL_SIDES);
47
48 llSleep(llFrand(5));
49
50 list data = llParseString2List(texture1,[";"],[]);
51 string X = llList2String(data,1);
52 string Y = llList2String(data,2);
53 string Z = llList2String(data,3);
54
55 sideX = (integer) X;
56 sideY = (integer) Y;
57 speed = (float) Z;
58
59 float tot = (float) (sideX * sideY);
60
61 llSetTextureAnim(ANIM_ON|LOOP,ALL_SIDES,sideX,sideY,start,length,speed);
62 llSetTexture(texture1,ALL_SIDES);
63 llSetTimerEvent(tot/10);
64 }
65
66
67 default
68 {
70 {
72 }
73 // touch the prim to switch to a pair of flipping textures, one of them a movie
75 {
76 i+=2;
77 if(i >= nTextures)
78 {
79 i = 0;
80 }
81 }
82
83 timer()
84 {
85 fetch();
86 }
87
88 }

Breedable_pet_eye_scripts

xs sleep script. This script makes particle Zzzzs float above the head on XS pets at night.

Category: XS Pets
By : Ferd Frederix
Created: 2012-08-16 Edited: 2012-08-16
Worlds: Second Life


This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 // xs_sleep
2 // Particle plug in for XS_Pets.
3 // place this in the head of any animal. When it falls asleep, it will spit out Zzzzs
4 // only use this with xs_animated_eye script, as the xs_two_texture eye script has this built-in
5
6 // GLOBAL CONSTANTS VERSION 0.38
7 //
8 // COPIED FROM GLOBAL CONSTANTS FILE LOCATED IN the /Debug folder
9 // INCLUDE THESE IN ALL SCRIPTS! //
10 // If you change this in any script, change it in all of them
11 //
12 // LICENSE
13 /////////////////////////////////////////////////////////////////////
14 // This code is licensed as Creative Commons Attribution/NonCommercial/Share Alike
15 // See http://creativecommons.org/licenses/by-nc-sa/3.0/
16 // Noncommercial -- You may not use this work for commercial purposes
17 // If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
18 // This means that you cannot sell this code but you may share this code.
19 // You must attribute authorship and leave this notice intact.
20 // Exception: I am allowing this script to be sold inside an original build.
21 // You are not selling the script, you are selling the build.
22 // Ferd Frederix
23 // Based on original code from Xundra Snowpaw
24 ////////////////////////////////////////////////////////////////////
25
26 // This first section are tuneable numbers that should be changed for any new pet
27
28
29 // SECURITY
30 /////////////////////////
31 string SECRET_PASSWORD = "top secret string"; // must use a password unique to any animal with enctryption on
32 integer SECRET_NUMBER = 99999; // any number thats a secret
33 integer ENCRYPT = TRUE; // set to TRUE to encrypt all data, Opensim prefers FALSE, TRUE is the most secure
34
35 // if you add the UUID for your avatar here, you can change it later
36 // and other alts or friends can change it too, and all of you can work on these pets.
37 // If you leave it blank, only the creator of the root prim can work on these pets.
38
39 key YOUR_UUID = "";
40
41 // PET NAMES
42 /////////////////////////
43 string Animal = "Troubot"; // was 'Quail', must be the name of your animal
44 string Egg = "Nut and Bolt"; // was 'XS Egg', must be the name of your egg
45 string Crate = "Transport UFO"; // was XS-Cryocrate, must be the name of the crate
46 string HomeObject = "Home Flag"; // was "XS Home Object", must be the name of your Home Post
47 string sound = "robot_sound"; // a basic sound, one needed, You can also use xs_sound, a plugin for more sounds
48
49
50 // more changeble numbers
51
52 // Prim animation linkmessages are sent by these scripts on Link Message number 1
53 // These are the bnames of the animations that are recorded.
54 // No need to change them unless you want to change names of the animations when you run the prim animator, or you add additional link messages
55 // you need to record these and save them in the notecard
56 // Example:
57 // llMessageLinked(LINK_SET, 1, ANI_STAND, "");
58 // The above line will play the pre-recorded 'stand up' animation "stand" using the animator script.
59
60 string ANI_STAND = "stand"; // default standing animation
61 string ANI_WALKL = "left"; // triggers Left foot and Right arm walk animation
62 string ANI_WALKR = "right"; // triggers Right foot and Left arm walk animation
63 string ANI_SLEEP = "sleep"; // Sleeping
64 string ANI_WAVE = "wave"; // Calling for sex, needs help with food, etc.
65
66
67 // misc tunables
68 float GROWTH_AMOUNT = 0.10; // 10% size increase each day for MaxAge days
69 integer MaxAge = 7; // can get pregnant in 7 days
70 integer UNITS_OF_FOOD = 168; // food bowl food qty, used by food bowl only
71 float secs_to_grow = 86400; // grow daily = 86400
72 float FOOD_BOWL_SCAN_INTERVAL = 1800.0; // look for food every 3 hours
73 float fPregnancy = 172800.0; // how many seconds to lay an egg = 2 days or 48 hours.
74 float fDaysToAdult = 7; // 7 days to become old enough to breed.
75 integer SECONDS_BETWEEN_FOOD_NORMAL = 14400; // this number of seconds to get hungry = 4 hours
76 integer SECONDS_BETWEEN_FOOD_HUNGRY = 3600; // this number of seconds before hunger count increases = 1 hour
77 integer MAXIMUM_HUNGER = 30; // not used, just displayed
78
79
80 // the following are global constants and do not need to be changed
81
82 float VERSION = 0.28; // This is the Protocol version. If you change this, then all pets older than this will not be compatible
83
84 ///// GLOBAL CONSTANTS extracted from original source //////
85 //
86 // if you change any of these constants, change it everywhere and in a list in XS_Debug so it can print them
87 //
88 integer FOOD_CHANNEL = -999191;
89 integer ANIMAL_CHANNEL = -999192;
90 integer EGG_CHANNEL = -999193;
91 integer HOME_CHANNEL = -999194;
92 integer BOX_CHANNEL = -999195;
93 integer ACC_CHANNEL = -999196;
94 integer UPDATE_CHANNEL = -999197;
95 integer API_CHANNEL = -999198;
96
97
98
99 // global link messages to control the animal
100 integer LINK_AGE_START = 800; // when quail is rezzed and secret_number, is sent by brain to breeder, eater and informatic get booted up
101 integer LINK_TEXTURE = 801; // ask for a new texture, or paint a color
102 integer LINK_FOOD_CONSUME = 900; // from movement to brain when close to food, brain then consumes a random amount up to 10000
103 integer LINK_FOODMINUS = 901; // xs_brain receives FOOD_CONSUME, decrement hunger (eat)
104 integer LINK_HUNGRY = 903; // sent by eater (string)hunger_amount, checks each hour
105 integer LINK_HAMOUNT = 904; // hunger_amount = (integer)str,m updates the hunger amount in scripts
106 integer LINK_SET_HOME = 910; // loc ^ dist
107 integer LINK_MOVER = 911; // tell mover to rest for str seconds
108 integer LINK_FOODIE_CLR = 920; // clear all food_bowl_keys and contents
109 integer LINK_FOODIE = 921; // send FOOD_LOCATION coordinates to movement
110 integer LINK_COLOR1 = 930; // colour1
111 integer LINK_COLOR2 = 931; // colour2
112 integer LINK_SEX = 932; // sex
113 integer LINK_SHINE = 933; // shine
114 integer LINK_GLOW = 934; // glow
115 integer LINK_GEN = 935; // generation
116 integer LINK_RESET_SIZE = 936; // reset size to 1
117 integer LINK_MAGE = 940; // xs_brain sends, xs_ager consumes, adds str to age, if older than 7 days, will grow the animal
118 integer LINK_DAYTIME = 941; // xs_ager consumes, starts a timer of 86,400 seconds in xs_ager
119 integer LINK_GET_AGE = 942; // get age from xs_ager and sent it on channel 943
120 integer LINK_PUT_AGE = 943; // print age from xs_ager
121 integer LINK_PACKAGE = 950; // look for a cryo_crate
122 integer LINK_SEEK_FEMALE = 960; // MALE_BREED_CALL
123 integer LINK_MALE_BREED_CALL = 961; // triggered by LINK_SEEK_FEMALE
124 integer LINK_SIGNAL_ELIGIBLE = 962; // sent by female when hears LINK_MALE_BREED_CALL
125 integer LINK_FEMALE_ELIGIBLE = 963; // sent when it hears in chat FEMALE_ELIGIBLE
126 integer LINK_CALL_MALE = 964; // if LINK_FEMALE_ELIGIBLE && looking_for_female
127 integer LINK_MALE_ON_THE_WAY = 965; // triggered by LINK_CALL_MALE
128 integer LINK_FEMALE_LOCATION = 966; // female location, sends coordinates of a female
129 integer LINK_RQST_BREED = 967; // sent when close enough to male/female
130 integer LINK_CALL_MALE_INFO = 968; // sent by xs_breeding, this line of code was in error in v.24 of xs_breeding see line 557 and 636 of xs_brain which make calls and also xs_breeding which receives LINK_MALE_INFO.
131 integer LINK_MALE_INFO = 969;
132 integer LINK_LAY_EGG = 970; // llRezObject("XS Egg"
133 integer LINK_BREED_FAIL = 971; // key = father, failed, timed out
134 integer LINK_PREGNANT = 972; // chick is preggers
135 integer LINK_SOUND_OFF= 974; // sound is off
136 integer LINK_SOUND_ON= 973; // sound is on
137 integer LINK_SLEEPING = 990; // close eyes
138 integer LINK_UNSLEEPING = 991; // open eyes
139 integer LINK_SOUND = 1001; // plays a sound if enabled
140 integer LINK_SPECIAL = 1010; // xs_special, is str = "Normal", removes script
141 integer LINK_PREGNANCY_TIME = 5000; // in seconds as str
142 integer LINK_SLEEP = 7999; // disable sleep by parameter
143 integer LINK_TIMER = 8000; // scan for food bowl about every 1800 seconds
144 integer LINK_DIE = 9999; // death
145
146
147 ///////// end global Link constants ////////
148
149
150 ///////////// END OF COPIED CODE ////////////
151
152
153
154 // Original Particle Script 0.4j
155 // Created by Ama Omega 3-7-2004
156 // Updated by Jopsy Pendragon 5-11-2004
157 // For classes/tutorials/tricks, visit the Particle Labratory in Teal
158 // Values marked with (*) are defaults.
159
160 // SECTION ONE: APPEARANCE -- These settings affect how each particle LOOKS.
161 integer glow = TRUE; // TRUE or FALSE(*)
162 vector startColor = <1,1,1>; // RGB color, black<0,0,0> to white<1,1,1>(*)
163 vector endColor = <1,1,1>; //
164 float startAlpha = 1.0; // 0.0 to 1.0(*), lower = more transparent
165 float endAlpha = 1.0; //
166 vector startSize = <0.1,0.1,0>; // <0.04,0.04,0>(min) to <10,10,0>(max>, <1,1,0>(*)
167 vector endSize = <.3,.3,0>; // (Z part of vector is discarded)
168 key texture = "f9b67edf-d837-e507-361b-0d34f4c64396"; // Texture used for particles. Texture must be in prim's inventory.
169
170 // SECTION TWO: FLOW -- These settings affect how Many, how Quickly, and for how Long particles are created.
171 // Note,
172 integer count = 1; // Number of particles created per burst, 1(*) to 4096
173 float rate = 1.0; // Delay between bursts of new particles, 0.0 to 60, 0.1(*)
174 float age = 5.0; // How long each particle lives, 0.1 to 60, 10.0(*)
175 float life = 0.0; // When to stop creating new particles. never stops if 0.0(*)
176
177 // SECTION THREE: PLACEMENT -- Where are new particles created, and what direction are they facing?
178 float radius = .30; // 0.0(default) to 64? Distance from Emitter where new particles are created.
179 float innerAngle = 0.75; // "spread", for all ANGLE patterns, 0(default) to PI
180 float outerAngle = 0.0; // "tilt", for ANGLE patterns, 0(default) to TWO_PI, can use PI_BY_TWO or PI as well.
181 integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE; // Choose one of the following:
182 // PSYS_SRC_PATTERN_EXPLODE (sends particles in all directions)
183 // PSYS_SRC_PATTERN_DROP (ignores minSpeed and maxSpeed. Don't bother with count>1 )
184 // PSYS_SRC_PATTERN_ANGLE_CONE (set innerangle/outerange to make rings/cones of particles)
185 // PSYS_SRC_PATTERN_ANGLE (set innerangle/outerangle to make flat fanshapes of particles)
186 vector omega = <0,0,0>; // How much to rotate the emitter around the <X,Y,Z> axises. <0,0,0>(*)
187 // Warning, there's no way to RESET the emitter direction once you use Omega!!
188 // You must attach the script to a new prim to clear the effect of omega.
189
190 // SECTION FOUR: MOVEMENT -- How do the particles move once they're created?
191 integer followSource = FALSE; // TRUE or FALSE(*), Particles move as the emitter moves, (TRUE disables radius!)
192 integer followVel = FALSE; // TRUE or FALSE(*), Particles rotate towards their direction
193 integer wind = FALSE; // TRUE or FALSE(*), Particles get blown away by wind in the sim
194 integer bounce = TRUE; // TRUE or FALSE(*), Make particles bounce on Z altitude of emitter
195 float minSpeed = 0.1; // 0.01 to ? Min speed each particle is spit out at, 1.0(*)
196 float maxSpeed = 0.2; // 0.01 to ? Max speed each particle is spit out at, 1.0(*)
197 vector push = <0,0,-0.3>; // Continuous force pushed on particles, use small settings for long lived particles
198 key target = ""; // Select a target for particles to arrive at when they die
199 // can be "self" (emitter), "owner" (you), "" or any prim/persons KEY.
200
201 // SECTION FIVE: Ama's "Create Short Particle Settings List"
202 integer enableoutput = FALSE; // If this is TRUE, clicking on your emitter prim will cause it to speak
203 // very terse "shorthand" version of your particle settings. You can cut'n'paste
204 // this abbreviated version into a call to llParticleSystem([ ]); in another script.
205 // Pros: Takes up far less scripting space, letting you focus on the rest of your code.
206 // Cons: makes tune your settings afterwards rather awkward
207
208 // === Don't muck about below this line unless you're comfortable with the LSL scripting language ====
209
210 // Script variables
211 integer pre = 2; //Adjust the precision of the generated list.
212 integer flags;
213 list sys;
214
215
216 string float2String(float in)
217 {
218 return llGetSubString((string)in,0,pre - 7);
219 }
220
221 updateParticles()
222 {
223 flags = 0;
224 if(target == "owner") target = llGetOwner();
225 if(target == "self") target = llGetKey();
226 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
227 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
228 if(startColor != endColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
229 if(startSize != endSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
230 if(wind) flags = flags | PSYS_PART_WIND_MASK;
231 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
232 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
233 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
234 sys = [ PSYS_PART_MAX_AGE,age,
235 PSYS_PART_FLAGS,flags,
236 PSYS_PART_START_COLOR, startColor,
237 PSYS_PART_END_COLOR, endColor,
238 PSYS_PART_START_SCALE,startSize,
239 PSYS_PART_END_SCALE,endSize,
240 PSYS_SRC_PATTERN, pattern,
242 PSYS_SRC_ACCEL, push,
248 PSYS_SRC_INNERANGLE,innerAngle,
249 PSYS_SRC_OUTERANGLE,outerAngle,
250 PSYS_SRC_OMEGA, omega,
251 PSYS_SRC_MAX_AGE, life,
252 PSYS_SRC_TEXTURE, texture,
253 PSYS_PART_START_ALPHA, startAlpha,
254 PSYS_PART_END_ALPHA, endAlpha
255 ];
256 float newrate = rate;
257 if(newrate == 0.0) newrate=.01;
258 if( (age/rate)*count < 4096) llParticleSystem(sys);
259 else {
260 llInstantMessage(llGetOwner(),"Your particle system creates too many concurrent particles.");
261 llInstantMessage(llGetOwner(),"Reduce count or age, or increate rate.");
262 llParticleSystem( [ ] );
263 }
264 }
265 integer onoff;
266 default
267 {
269 {
270 onoff=0;
271 llParticleSystem( [ ] );
272 }
273
274 on_rez(integer num)
275 {
277 }
278
279 link_message(integer sender, integer num, string str, key id)
280 {
281 if(num == 1 && str==ANI_SLEEP) {
282 updateParticles();
283 }
284 else if(num == 1 && str == ANI_STAND) {
285 llParticleSystem( [ ] );
286 }
287 }
288
289 }

Breedable_pet_eye_scripts

Combined eye and particle script.

This script flips between two textures for eye blinking and also supports a 'dead' eye look. It combines the particle plug-in with eyes together. It may be more useful on non-robot pets.
An article on how to use it, including a set of example eye textures, is located at http://metaverse.mitsi.com/secondlife/posts/breedable-pet-robot/blinking%20eyes.htm

Category: XS Pets
By : Ferd Frederix
Created: 2012-08-16 Edited: 2012-08-16
Worlds: Second Life


This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 // This code is licensed as Creative Commons Attribution/NonCommercial/Share Alike
2
3 // See http://creativecommons.org/licenses/by-nc-sa/3.0/
4 // Noncommercial -- You may not use this work for commercial purposes
5 // If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
6 // This means that you cannot sell this code but you may share this code.
7 // You must attribute authorship to me and leave this notice intact.
8 //
9 // Exception: I am allowing this script to be sold inside an original build.
10 // You are not selling the script, you are selling the build.
11 // Ferd Frederix
12
13
14
15 // the names of the textures for eyes that shut and close by flipping between them.
16 string OPEN = "cubit_eyes open";
17 string CLOSED = "cubit_eyes closed";
18 string DEAD = "cubit_eyes dead"; // could be a copy of eyes closed, or (X)(X)
19
20
21 string ANI_DIE = "death"; // a string taught to the pet by the animator when the animal is to die.
22 string ANI_SLEEP = "sleep"; // Sleeping
23 string ANI_STAND = "stand"; // default standing animation
24
25 integer flags;
26 // Original Particle Script 0.4j
27 // Created by Ama Omega 3-7-2004
28 // Updated by Jopsy Pendragon 5-11-2004
29 // For classes/tutorials/tricks, visit the Particle Labratory in Teal
30 // Values marked with (*) are defaults.
31
32 // SECTION ONE: APPEARANCE -- These settings affect how each particle LOOKS.
33 integer glow = TRUE; // TRUE or FALSE(*)
34 vector startColor = <1,1,1>; // RGB color, black<0,0,0> to white<1,1,1>(*)
35 vector endColor = <1,1,1>; //
36 float startAlpha = 1.0; // 0.0 to 1.0(*), lower = more transparent
37 float endAlpha = 1.0; //
38 vector startSize = <0.1,0.1,0>; // <0.04,0.04,0>(min) to <10,10,0>(max>, <1,1,0>(*)
39 vector endSize = <.3,.3,0>; // (Z part of vector is discarded)
40 key texture = "f9b67edf-d837-e507-361b-0d34f4c64396"; // Texture used for particles. Texture must be in prim's inventory.
41
42 // SECTION TWO: FLOW -- These settings affect how Many, how Quickly, and for how Long particles are created.
43 // Note,
44 integer count = 1; // Number of particles created per burst, 1(*) to 4096
45 float rate = 1.0; // Delay between bursts of new particles, 0.0 to 60, 0.1(*)
46 float age = 5.0; // How long each particle lives, 0.1 to 60, 10.0(*)
47 float life = 0.0; // When to stop creating new particles. never stops if 0.0(*)
48
49 // SECTION THREE: PLACEMENT -- Where are new particles created, and what direction are they facing?
50 float radius = .30; // 0.0(default) to 64? Distance from Emitter where new particles are created.
51 float innerAngle = 0.75; // "spread", for all ANGLE patterns, 0(default) to PI
52 float outerAngle = 0.0; // "tilt", for ANGLE patterns, 0(default) to TWO_PI, can use PI_BY_TWO or PI as well.
53 integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE; // Choose one of the following:
54 // PSYS_SRC_PATTERN_EXPLODE (sends particles in all directions)
55 // PSYS_SRC_PATTERN_DROP (ignores minSpeed and maxSpeed. Don't bother with count>1 )
56 // PSYS_SRC_PATTERN_ANGLE_CONE (set innerangle/outerange to make rings/cones of particles)
57 // PSYS_SRC_PATTERN_ANGLE (set innerangle/outerangle to make flat fanshapes of particles)
58 vector omega = <0,0,0>; // How much to rotate the emitter around the <X,Y,Z> axises. <0,0,0>(*)
59 // Warning, there's no way to RESET the emitter direction once you use Omega!!
60 // You must attach the script to a new prim to clear the effect of omega.
61
62 // SECTION FOUR: MOVEMENT -- How do the particles move once they're created?
63 integer followSource = FALSE; // TRUE or FALSE(*), Particles move as the emitter moves, (TRUE disables radius!)
64 integer followVel = FALSE; // TRUE or FALSE(*), Particles rotate towards their direction
65 integer wind = FALSE; // TRUE or FALSE(*), Particles get blown away by wind in the sim
66 integer bounce = TRUE; // TRUE or FALSE(*), Make particles bounce on Z altitude of emitter
67 float minSpeed = 0.1; // 0.01 to ? Min speed each particle is spit out at, 1.0(*)
68 float maxSpeed = 0.2; // 0.01 to ? Max speed each particle is spit out at, 1.0(*)
69 vector push = <0,0,-0.3>; // Continuous force pushed on particles, use small settings for long lived particles
70 key target = ""; // Select a target for particles to arrive at when they die
71 // can be "self" (emitter), "owner" (you), "" or any prim/persons KEY.
72
73 list sys;
74
75 updateParticles()
76 {
77 flags = 0;
78 if(target == "owner") target = llGetOwner();
79 if(target == "self") target = llGetKey();
80 if(glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
81 if(bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
82 if(startColor != endColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
83 if(startSize != endSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
84 if(wind) flags = flags | PSYS_PART_WIND_MASK;
85 if(followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
86 if(followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
87 if(target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
88 sys = [ PSYS_PART_MAX_AGE,age,
89 PSYS_PART_FLAGS,flags,
90 PSYS_PART_START_COLOR, startColor,
91 PSYS_PART_END_COLOR, endColor,
92 PSYS_PART_START_SCALE,startSize,
93 PSYS_PART_END_SCALE,endSize,
94 PSYS_SRC_PATTERN, pattern,
96 PSYS_SRC_ACCEL, push,
102 PSYS_SRC_INNERANGLE,innerAngle,
103 PSYS_SRC_OUTERANGLE,outerAngle,
104 PSYS_SRC_OMEGA, omega,
105 PSYS_SRC_MAX_AGE, life,
106 PSYS_SRC_TEXTURE, texture,
107 PSYS_PART_START_ALPHA, startAlpha,
108 PSYS_PART_END_ALPHA, endAlpha
109 ];
110 float newrate = rate;
111 if(newrate == 0.0) newrate=.01;
112 if( (age/rate)*count < 4096) llParticleSystem(sys);
113 else {
114 llInstantMessage(llGetOwner(),"Your particle system creates too many concurrent particles.");
115 llInstantMessage(llGetOwner(),"Reduce count or age, or increate rate.");
116 llParticleSystem( [ ] );
117 }
118 }
119
120
121
122 default
123 {
124
125 on_rez(integer startparam)
126 {
128 }
129
131 {
132 llSetTexture(OPEN, ALL_SIDES); // open
134 }
135
136
137 timer()
138 {
139 llSetTexture(CLOSED, ALL_SIDES); // closed
140 llSleep(llFrand(0.2) + .1); // sometimes blink a little faster, from 0.2 to 0.3
141 llSetTexture(OPEN, ALL_SIDES); // open
142 llSetTimerEvent(llFrand(3) + 3); // make them blink randomly
143 }
144
145
146 link_message(integer sender, integer num, string str, key id)
147 {
148 if(num == 1 && str == ANI_SLEEP )
149 {
150 llSetTexture(CLOSED, ALL_SIDES); //closed
151 updateParticles(); // turn on particle Zzzz's
152 llSetTimerEvent(0); // no blink
153 }
154
155 else if(num == 1 && str == ANI_STAND)
156 {
157 llParticleSystem( [] ); // turn off particle ZZZ's by sending an empty list
158 llSetTexture(OPEN, ALL_SIDES); //open
160
161 }
162 else if(num == 1 && str == ANI_DIE)
163 {
164 llSetTexture(DEAD ,ALL_SIDES) ; // dead eye (X)(X) texture
165 llParticleSystem( [ ] ); // turn off particle ZZZ's
166 llSetTimerEvent(0); // no blink
167 }
168 }
169 }

Back to the Best Free Tools in Second Life and OpenSim.