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
Collider Super_Collider  

Super_Collider

Super collider script

Category: Collider
By : Rickard Roentgen
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Super_Collider
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Super_Collider_1.lsl
Get file # 2. Super_Collider_2.lsl
Get file # 3. Super_Collider_3.lsl
1 string fall_anim_fwd = "fall hard forward";
2 string fall_anim_back = "fall hard backward";
3
4 float speed;
5 integer forward;
6 integer listen1;
7 integer blood;
8 integer online = FALSE;
9 string animation;
10 vector size;
11 vector detvel;
12 vector vel;
13
14 default
15 {
17 {
18 llMessageLinked(LINK_SET, 0, "revive", NULL_KEY);
19 llListenRemove(listen1);
20 listen1 = llListen(0, "", llGetOwner(), "");
23 online = FALSE;
25 size = llGetAgentSize(llGetOwner());
26 }
27
28 link_message(integer sender, integer num, string str, key id)
29 {
30 if(str == "online") {
31 online = TRUE;
32 } else if(str == "offline") {
33 online = FALSE;
34 }
35 }
36
37 attach(key id)
38 {
39 if(id != NULL_KEY) {
42 llStopAnimation(fall_anim_fwd);
43 llStopAnimation(fall_anim_back);
44 }
45 }
46
47 listen(integer channel, string name, key id, string message)
48 {
49 message = llToLower(message);
50 if(message == "collide on" || message == "collider on" || message == "super collider on") {
52 llWhisper(0, "/me Online.");
53 online = TRUE;
54 } else if(message == "collide off" || message == "collider off" || message == "super collider off") {
56 llWhisper(0, "/me Offline.");
57 online = FALSE;
58 }
59 }
60
62 {
63 detvel = llDetectedVel(0);
64 vel = llGetVel();
65 speed = llVecMag(detvel - (vel / 2.0));
66 animation = llGetAnimation(llGetOwner());
67 if(speed > 3.5 && llVecMag(detvel) > 3.5 && (animation == "Standing" || animation == "Walking" || animation == "Running") && online) {
68 llSetScale(<0.1, 0.1, 0.1>);
69 llMoveToTarget(llGetPos() + <0.0, 0.0, (2.0 - size.z) / 3.5>, 0.05);
70 if(llRot2Fwd(llGetRot()) * llVecNorm(detvel) <= 0.0) {
71 llStartAnimation(fall_anim_back);
72 forward = FALSE;
73 } else {
74 llStartAnimation(fall_anim_fwd);
75 forward = TRUE;
76 }
77 state dead;
78 }
79 }
80 }
81
82 state dead
83 {
85 {
87 llSetTimerEvent(0.1);
88 blood = 0;
89 llListenRemove(listen1);
90 listen1 = llListen(0, "", llGetOwner(), "");
92 }
93
94 on_rez(integer sparam)
95 {
97 }
98
99 listen(integer channel, string name, key id, string message)
100 {
101 message = llToLower(message);
102 if(message == "collide on" || message == "collider on" || message == "super collider on") {
103 online = TRUE;
105 llWhisper(0, "/me Online.");
106 } else if(message == "collide off" || message == "collider off" || message == "super collider off") {
107 online = FALSE;
109 llWhisper(0, "/me Offline.");
110 }
111 }
112
113 control(key id, integer level, integer edge)
114 {
115 if(llGetTime() > 2.0) {
117 llSleep(0.1);
118 llStopAnimation(fall_anim_back);
119 llStopAnimation(fall_anim_fwd);
120 llSetTimerEvent(0.0);
121 llSleep(0.1);
124 }
125 }
126
127 timer()
128 {
129 if(blood < 10) {
130 blood += 1;
131 } else if(blood == 10) {
132 blood += 1;
133 if(speed > 10.0) {
134 if(forward) {
135 llMessageLinked(LINK_ALL_OTHERS, 0, "blood forward", NULL_KEY);
136 } else {
137 llMessageLinked(LINK_ALL_OTHERS, 0, "blood backward", NULL_KEY);
138 }
139 }
140 }
141 llSetScale(<0.1, 0.1, 0.1>);
142 llSetScale(<0.05, 0.05, 0.05>);
143 }
144 }

Super_Collider

Status Script

Category: Collider
By : Rickard Roentgen
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1 integer online;
2
3 default
4 {
5 on_rez(integer sparam)
6 {
7 llWhisper(0, "Super Collider commands: collide on, collide off");
8 }
9
11 {
12 online = FALSE;
13 }
14
15 link_message(integer sender, integer num, string str, key id)
16 {
17 if(str == "status") {
18 if(online) {
19 llMessageLinked(sender, 0, "online", NULL_KEY);
20 } else {
21 llMessageLinked(sender, 0, "offline", NULL_KEY);
22 }
23 } else if(str == "set status") {
24 online = num;
25 }
26 }
27 }

Super_Collider

Add this to a prim called 'pool of blood' and put it inside

Category: Collider
By : Rickard Roentgen
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1 integer listen1;
2 vector scale;
3
4 default
5 {
7 {
8 scale = <0.1, 0.1, 0.05>;
9 llSetScale(scale);
10 }
11
12 on_rez(integer sparam)
13 {
14 llListenRemove(listen1);
15 listen1 = llListen(20, "", NULL_KEY, (string)llGetOwner() + "revive");
16 scale = <0.1, 0.1, 0.05>;
17 llSetScale(scale);
18 llSetTimerEvent(0.1);
19 }
20
21 timer()
22 {
23 if(scale.x < 1.0) {
24 scale += <0.025, 0.025, 0.0>;
26 } else {
27 llSetTimerEvent(0.0);
28 }
29 }
30
31 listen(integer channel, string name, key id, string message)
32 {
33 if(llGetOwnerKey(id) == llGetOwner()) {
34 llDie();
35 }
36 }
37 }

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