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
Weapons BulletExplode  

BulletExplode

BulletExplode

Category: Weapons
By : Encog Dod
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for BulletExplode
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. BulletExplode_1.lsl
1 // From the book:
2 //
3 // Scripting Recipes for Second Life
4 // by Jeff Heaton (Encog Dod in SL)
5 // ISBN: 160439000
6 X// Copyright 2007 by Heaton Research, Inc.
7 //
8 // This script may be freely copied and modified so long as this header
9 // remains unmodified.
10 //
11 // For more information about this book visit the following web site:
12 //
13 // http://www.heatonresearch.com/articles/series/22/
14
15 //
16 // Encog's MultiBullet Gun Bullet
17 //
18 // Explode Bullet: This bullet will do no damage, but will explode
19 //
20
21 fakeMakeExplosion(integer particle_count, float particle_scale, float particle_speed,
22 float particle_lifetime, float source_cone, string source_texture_id,
23 vector local_offset)
24 {
25 //local_offset is ignored
29 PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>,
30 PSYS_PART_END_COLOR, <1.0, 1.0, 1.0>,
33 PSYS_PART_START_SCALE, <particle_scale, particle_scale, 0.0>,
34 PSYS_PART_END_SCALE, <particle_scale * 2 + particle_lifetime, particle_scale * 2 + particle_lifetime, 0.0>,
35 PSYS_PART_MAX_AGE, particle_lifetime,
36 PSYS_SRC_ACCEL, <0.0, 0.0, 0.0>,
37 PSYS_SRC_TEXTURE, source_texture_id,
40 PSYS_SRC_ANGLE_END, source_cone * PI,
41 PSYS_SRC_BURST_PART_COUNT, particle_count / 2,
43 PSYS_SRC_BURST_SPEED_MIN, particle_speed / 3,
44 PSYS_SRC_BURST_SPEED_MAX, particle_speed * 2/3,
45 PSYS_SRC_MAX_AGE, particle_lifetime / 2,
46 PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>
47 ]);
48 }
49
50 explode()
51 {
52 fakeMakeExplosion(80, 1.0, 13.0, 2.2, 1.0, "fire", <0.0, 0.0, 0.0>);
53 llSleep(.5);
54 fakeMakeExplosion(80, 1.0, 13.0, 2.2, 1.0, "smoke", <0.0, 0.0, 0.0>);
55 llSleep(1);
57 }
58
59
60
61
62
63 default
64 {
65 on_rez(integer delay)
66 {
68 llSetDamage(0);
69 llSetBuoyancy(1.0); // Make bullet float and not fall
70 llCollisionSound("", 1.0); // Disable collision sounds
71
72 if(delay >0 )
73 {
74 llSetTimerEvent(delay);
75 }
76 }
77
78 collision_start(integer total_number)
79 {
80 explode();
81 }
82
83 land_collision_start(vector pos)
84 {
85 explode();
86 }
87
88 timer()
89 {
90 llDie();
91 }
92
93 }

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