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
Pet Mesh_Frog_Project  

Mesh_Frog_Project

Bug Legs script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
Worlds: Second Life

the Zip file

Download all files for Mesh_Frog_Project
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. [58185 bytes] Animation1.anim;1;2;5.png
Get file # 2. [108271 bytes] body texture.jpg
Get file # 3. bug scripts.zip
Get file # 4. [116462 bytes] Bug.Z.jpg
Get file # 5. frog mesh.zip
Get file # 6. [34062 bytes] geometry_00.png
Get file # 7. [34107 bytes] ugly bug body texture.jpg
Get file # 8. [471012 bytes] body and eye uv.png
Get file # 9. [291286 bytes] body and eye.jpg
Get file # 10. [110516 bytes] far rear leg uv.png
Get file # 11. [243245 bytes] far rear leg.jpg
Get file # 12. [116783 bytes] front back leg uv.png
Get file # 13. [244015 bytes] front back leg.jpg
Get file # 14. [243106 bytes] front legs.jpg
Get file # 15. [117560 bytes] front legs.png
Get file # 16. mesh frog.dae
Get file # 17. [264504 bytes] rear first leg.jpg
Get file # 18. [331742 bytes] rear first leg.png
Get file # 19. [16690 bytes] tongue uv.png
Get file # 20. [227337 bytes] tongue.jpg
Get file # 21. Mesh_Frog_Project_1.lsl
Get file # 22. Mesh_Frog_Project_2.lsl
Get file # 23. Mesh_Frog_Project_3.lsl
Get file # 24. Mesh_Frog_Project_4.lsl
Get file # 25. Mesh_Frog_Project_5.lsl
Get file # 26. Mesh_Frog_Project_6.lsl
Get file # 27. Mesh_Frog_Project_7.lsl
Get file # 28. Mesh_Frog_Project_8.lsl
Get file # 29. Mesh_Frog_Project_9.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 //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. You can get the GIF 2 SL executable at http://secondlife.mitsi.com/download/
2 //
3
4 // Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=1594
5
6 // This program is free software; you can redistribute it and/or modify it.
7 // Additional Licenes may apply that prevent you from selling this code
8 // and these licenses may require you to publish any changes you make on request.
9 //
10 // There are literally thousands of hours of work in these scripts. Please respect
11 // the creators wishes and follow their license requirements.
12 //
13 // Any License information included herein must be included in any script you give out or use.
14 // Licenses are included in the script or comments by the original author, in which case
15 // the authors license must be followed.
16
17 // A GNU license, if attached by the author, means the original code must be FREE.
18 // Modifications can be made and products sold with the scripts in them.
19 // You cannot attach a license to make this GNU License
20 // more or less restrictive. see http://www.gnu.org/copyleft/gpl.html
21
22 // Creative Commons licenses apply to all scripts from the Second Life
23 // wiki and script library and are Copyrighted by Linden Lab. See
24 // http://creativecommons.org/licenses/
25
26 // Please leave any author credits and headers intact in any script you use or publish.
27 // If you don't like these restrictions, then don't use these scripts.
28 //////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////
29 // 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
30
31
32 integer animOn = TRUE; //Set to FALSE and call initAnim() again to stop the animation.
33 //Effect parameters: (can be put in list together, to make animation have all of said effects)
34 //LOOP - loops the animation
35 //SMOOTH - plays animation smoothly
36 //REVERSE - plays animation in reverse
37 //PING_PONG - plays animation in one direction, then cycles in the opposite direction
38 list effects = [LOOP]; // LOOP for GIF89 movies
39 //Movement parameters (choose one):
40 //ROTATE - Rotates the texture
41 //SCALE - Scales the texture
42 //Set movement to 0 to slide animation in the X direction, without any special movement.
43 integer movement = 0;
44 integer face = ALL_SIDES; //Number representing the side to activate the animation on.
45 integer sideX = 1; //Represents how many horizontal images (frames) are contained in your texture.
46 integer sideY = 1; //Same as sideX, except represents vertical images (frames).
47 float start = 0.0; //Frame to start animation on. (0 to start at the first frame of the texture)
48 float length = 0.0; //Number of frames to animate, set to 0 to animate all frames.
49 float speed = 10.0; //Frames per second to play.
50 initAnim() //Call this when you want to change something in the texture animation.
51 {
52 if(animOn)
53 {
54 integer effectBits;
55 integer i;
56 for(i = 0; i < llGetListLength(effects); i++)
57 {
58 effectBits = (effectBits | llList2Integer(effects,i));
59 }
60 integer params = (effectBits|movement);
61 llSetTextureAnim(ANIM_ON|params,face,sideX,sideY, start,length,speed);
62 }
63 else
64 {
65 llSetTextureAnim(0,face,sideX,sideY, start,length,speed);
66 }
67 }
68
69 fetch()
70 {
72 llSetTexture(texture,ALL_SIDES);
73 list data = llParseString2List(texture,[";"],[]);
74 llOwnerSay( llDumpList2String(data ,","));
75 string X = llList2String(data,1);
76 string Y = llList2String(data,2);
77 string Z = llList2String(data,3);
78
79 // llOwnerSay("X=" + X + " Y=" + Y + " Z = " + (string) Z);
80
81 sideX = (integer) X;
82 sideY = (integer) Y;
83 speed = (float) Z;
84 if(speed)
85 initAnim();
86 }
87
88 default
89 {
91 {
92 fetch();
93 }
94 changed(integer what)
95 {
96 if(what & CHANGED_INVENTORY)
97 {
98 fetch();
99 }
100 }
101 }

Mesh_Frog_Project

Bug Movement script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 // Bug movement script
2 // rez the bug, touch it, and it woill move around randombly in about 1/2 meters space
3
4
5 vector pos; // the home position is saved here
6
7
8 // This is an OpenSim compatible llLookAt()!
9 face_target(vector lookat)
10 {
11 rotation rot = llGetRot() * llRotBetween(<0.0 ,0.0 ,1.0 > * llGetRot(), lookat - llGetPos());
12 llSetRot(rot);
13 }
14
15
16 default
17 {
19 {
22 pos = llGetPos(); // save start
23 llSetObjectName("Bug"); // the frog will look for this name
24 }
25
26 listen(integer n, string name, key id, string message)
27 {
28 if(message == "eat") // the frog is trying to grab us.
29 {
30 list details = llGetObjectDetails(id,[OBJECT_POS]);
31
32 // see if he is close enough to grab us.
33 if(llVecDist( llList2Vector(details,0),llGetPos()) < 0.3)
34 {
35
36 // make us invisible to people
39
40 // and make us invisible to the frog
41 llSetObjectName("invisible Bug");
42 llSleep(15);
43
44 // okay, time to live again
47 llSetObjectName("Bug");
48 }
49
50
51 }
52 }
53
54 timer()
55 {
56 // get a position somewhere withing 1/2 meter of home
57 float newX = llFrand(1)+.5 -.75;
58 float newY = llFrand(1)+.5 -.75;
59
60 vector newpos = <pos.x + newX, pos.y + newY, pos.z>; // in the same Z plane as when we were rezzed
61
62 // look at that spot
63 face_target(newpos);
64 // and go there
65 llSetPos(newpos);
66 }
67
68 // if owner touches us, set a new position
69 touch_start(integer whowmany)
70 {
72 {
73 pos = llGetPos();
74
75 //and start the movement
77 llListen(2222,"","","eat"); // we turn invisible and rename when we hear commands on this channel
78
79 }
80 }
81
82
84 {
86 }
87 }

Mesh_Frog_Project

Frog script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 // ______ _ ______ _ _
2 // | ___| | | | ___| | | (_)
3 // | |_ ___ _ __ __| | | |_ _ __ ___ __| | ___ _ __ ___ __
4 // | _/ _ \ '__/ _` | | _| '__/ _ \/ _` |/ _ \ '__| \ \/ /
5 // | || __/ | | (_| | | | | | | __/ (_| | __/ | | |> <
6 // \_| \___|_| \__,_| \_| |_| \___|\__,_|\___|_| |_/_/\_\
7 //
8 // fred@mitsi.com
9 // hopping animal script
10 //
11 //Revisions:
12 // 3/16/2012 initial release
13 // 6/8/2012 tweks to names
14
15 string SIT = "SIT"; // the prim animator name to sit down
16 string EAT = "EAT"; // the prim animator name to eat something
17 string HOP = "HOP"; // the prim animator name to hop
18
19 string foodName = "Bug"; // the name of the object we will eat.
20
21 // tunable constants
22
23 float roam_range = 5; // default roaming range
24
25 float atimer = 10;
26
27 vector rezpoint; // home point
28 rotation rezrot; // our original rez rotation
29 integer flightCounter; // boolean, true if we are moving
30
31 // menu
32 integer listen_chan; // random channel for menu
33 integer listener; // stoarge for menu listener
34
35
36 string flag ; // what menu item thay need integers for
37 vector nextDestination; // Where we are heading
38 integer seekingFood = FALSE; // boolean if we are looking for food
39
40 Dialog()
41 {
42 listener = llListen(listen_chan,"","","");
43 llDialog(llGetOwner(),"Flight Controls: Home: Set the home location\nTime: How often to hop when no one is near\nRange: Distance to roam\nHelp: get notecard",["Range","Help","Home","Time", "Off"],listen_chan);
44 }
45
46 // This is an OpenSim compatible llLookAt()!
47 face_target(vector lookat)
48 {
49 rotation rot = llGetRot() * llRotBetween(<0.0 ,0.0 ,1.0 > * llGetRot(), lookat - llGetPos());
50
51 vector n = <0,0,90> * DEG_TO_RAD;
52
53 rotation rot_xyzq = llEuler2Rot(n); // Change to a Rotation
54
55 llSetRot(rot * rot_xyzq); //add 90
56 }
57
58
59 DoMove()
60 {
61
62 face_target(nextDestination);
63 llSleep(.5);
64
65 // amimate and hop thataway
66 llMessageLinked(LINK_SET,1,HOP,""); // hop up
67
68 llSetPos(nextDestination);
69
70 // stand still
71 llMessageLinked(LINK_SET,1,SIT,""); // hop up
72
73
74 }
75
76
77 setNewDestination()
78 {
79 // random direction
80 nextDestination = llGetPos();
81 nextDestination.x += llFrand(1) +.5 - 0.75 ;
82 nextDestination.y += llFrand(1) +.5 - 0.75 ;
83
84 }
85
86
87 // start to hop routine
88 startHopping()
89 {
90
91
92 flightCounter = 0;
93
94
95 setNewDestination();
96
97 seekingFood = FALSE;
98 llSensorRepeat(foodName,"", ACTIVE|PASSIVE|SCRIPTED, 10, PI, 5.0);
99 ;
100
101 llSetTimerEvent(2); // fast
102 }
103
104 default
105 {
106
108 {
110 }
111
113 {
114 llMessageLinked(LINK_SET,1,SIT,""); // hop down to default position
115 llSetStatus(STATUS_DIE_AT_EDGE,FALSE); // return to nventory instead of poofing
116
117 rezpoint = llGetPos();
118 rezrot = llGetRot();
119 nextDestination = rezpoint;
120
121 }
122
124 {
126 {
127 listen_chan=llCeil(llFrand(10000) + 10000);
128 Dialog();
129
130 state moving;
131 }
132
133 }
134 }
135
136
137 state moving
138 {
139
141 {
143 }
144
145
147 {
148 seekingFood = FALSE;
149 startHopping(); // startHopping at startup
150 }
151
152
153 timer()
154 {
155
157
158 if(!flightCounter++)
159 llSensorRepeat(foodName,"", ACTIVE|PASSIVE|SCRIPTED, 10, PI, 5.0);
160
161 // too far
162 if((llVecDist(rezpoint,llGetPos()) > roam_range) )
163 {
164
165 nextDestination = rezpoint;
166 }
167
168 DoMove();
169
170 if(seekingFood && llVecDist(nextDestination,llGetPos()) < .1)
171 {
172
173
174 llWhisper(2222,"eat"); // tell the food to poof
175 llMessageLinked(LINK_SET,1,EAT,""); // grab the fish
176 setNewDestination();
177 seekingFood = FALSE;
178 }
179 else if(llVecDist(nextDestination,llGetPos()) < .1) // get within a meter of dest is okay
180 {
181 setNewDestination();
182 }
183
184 if(flightCounter == 28)
185 {
186 // back home
187 nextDestination = rezpoint;
188 }
189
190
191
192 if(flightCounter == 30)
193 {
194 nextDestination = rezpoint;
195
196 llSetRot(rezrot);
197 llSetPos(rezpoint);
198
200
201 llMessageLinked(LINK_SET,1,SIT,""); // hop up
202
203 llSetTimerEvent(atimer);
204
205 seekingFood = FALSE;
206 flightCounter = 0;
207
208 setNewDestination();
209
210 }
211 }
212
213
214
215 sensor(integer total_number)
216 {
217
218 vector where = llDetectedPos(0);
219
220 nextDestination.x = where.x;
221 nextDestination.y = where.y;
222
223 seekingFood = TRUE;
224
225 }
226
228 {
230 {
231 listen_chan=llCeil(llFrand(10000) + 10000);
232 Dialog();
233 }
234 }
235
236 listen(integer channel,string name, key id, string msg)
237 {
238 if(msg == "Range")
239 {
240 llDialog(llGetOwner(),"Range from Home in meters",["5","10","15"],listen_chan);
241 flag = "R";
242 }
243 else if((integer) msg >= 10 && flag == "R")
244 {
245 roam_range = (integer) msg;
246 flag = "";
247 Dialog();
248 }
249
250 else if(msg == "Help")
251 {
252 llLoadURL(llGetOwner(),"Get Help", "http://metaverse.mitsi.com/secondlife/posts/Mesh-Frog");
253 }
254 else if(msg == "Home")
255 {
256 rezpoint = llGetPos();
257 llOwnerSay("Position is set to " + (string) rezpoint);
258 Dialog();
259 }
260 else if(msg =="Time")
261 {
262 llDialog(llGetOwner(),"How often to in seconds",["Off","10s","30s","60s"],listen_chan);
263 }
264 else if(msg =="Off")
265 {
267 }
268 else if(msg =="60s")
269 atimer = 60;
270 else if(msg =="10s")
271 atimer = 10;
272 else if(msg =="30s")
273 atimer = 30;
274
275
276 llOwnerSay("Hop range is " + (string) roam_range + " meters. ");
277 if(atimer)
278 llOwnerSay("Jump every " + (string) atimer + " seconds");
279
280 if(! flightCounter)
281 {
282 llSetTimerEvent(atimer);
283 }
284 }
285 }

Mesh_Frog_Project

Front leg #1 script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 // front leg #1, in front of all of the legs
2
3 float visible = 1.0;
4 float invisible = 0;
5
6 default
7 {
9 {
10 llSetAlpha(visible,ALL_SIDES);
11 }
12
13 link_message(integer who, integer num, string str, key id)
14 {
15 if(str == "SIT")
16 {
17 llSetAlpha(visible,ALL_SIDES);
18 }
19 else if(str == "HOP")
20 {
21 llSetAlpha(invisible,ALL_SIDES);
22 llSleep(0.5);
23 llSetAlpha(visible,ALL_SIDES);
24 }
25 else if(str == "EAT")
26 {
27 llSetAlpha(visible,ALL_SIDES);
28 }
29 }
30
31 }

Mesh_Frog_Project

Front leg #2 sacript

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 // front leg #2, behind the very front pair
2
3 float visible = 1.0;
4 float invisible = 0;
5
6 default
7 {
9 {
10 llSetAlpha(invisible,ALL_SIDES);
11 }
12
13 link_message(integer who, integer num, string str, key id)
14 {
15 if(str == "SIT")
16 {
17 llSetAlpha(invisible,ALL_SIDES);
18 }
19 else if(str == "HOP")
20 {
21 llSetAlpha(visible,ALL_SIDES);
22 llSleep(0.5);
23 llSetAlpha(invisible,ALL_SIDES);
24 }
25 else if(str == "EAT")
26 {
27 llSetAlpha(invisible,ALL_SIDES);
28 }
29 }
30
31 }

Mesh_Frog_Project

Rear leg #3 script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 // rear leg #3, in front of the very back set
2
3 float visible = 1.0;
4 float invisible = 0;
5
6 default
7 {
9 {
10 llSetAlpha(visible,ALL_SIDES);
11 }
12
13 link_message(integer who, integer num, string str, key id)
14 {
15 if(str == "SIT")
16 {
17 llSetAlpha(visible,ALL_SIDES);
18 }
19 else if(str == "HOP")
20 {
21 llSetAlpha(invisible,ALL_SIDES);
22 llSleep(.5);
23 llSetAlpha(visible,ALL_SIDES);
24 }
25 else if(str == "EAT")
26 {
27 llSetAlpha(invisible,ALL_SIDES);
28 llSleep(1);
29 llSetAlpha(visible,ALL_SIDES);
30 }
31 }
32
33 }

Mesh_Frog_Project

Rear leg #4 script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 // rear leg #4, in the very back
2
3 float visible = 1.0;
4 float invisible = 0;
5
6 default
7 {
9 {
10 llSetAlpha(invisible,ALL_SIDES);
11 }
12
13 link_message(integer who, integer num, string str, key id)
14 {
15 if(str == "SIT")
16 {
17 llSetAlpha(invisible,ALL_SIDES);
18 }
19 else if(str == "HOP")
20 {
21 llSetAlpha(visible,ALL_SIDES);
22 llSleep(.5);
23 llSetAlpha(invisible,ALL_SIDES);
24 }
25 else if(str == "EAT")
26 {
27 llSetAlpha(visible,ALL_SIDES);
28 llSleep(1);
29 llSetAlpha(invisible,ALL_SIDES);
30 }
31 }
32
33 }

Mesh_Frog_Project

tongue script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 // tongue
2
3 float visible = 1.0;
4 float invisible = 0;
5
6 default
7 {
9 {
10 llSetAlpha(invisible,ALL_SIDES);
11 }
12
13 link_message(integer who, integer num, string str, key id)
14 {
15 if(str == "SIT")
16 {
17 llSetAlpha(invisible,ALL_SIDES);
18 }
19 else if(str == "HOP")
20 {
21 llSetAlpha(invisible,ALL_SIDES);
22 }
23 else if(str == "EAT")
24 {
25 llSetAlpha(visible,ALL_SIDES);
26 llSleep(.3);
27 llSetAlpha(invisible,ALL_SIDES);
28 }
29 }
30
31 }

Mesh_Frog_Project

Leg test script

Category: Pet
By : Ferd Frederix
Created: 2012-05-11 Edited: 2012-05-11
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 default
2 {
4 {
5
6 }
7
8
10 {
11
12 llMessageLinked(LINK_SET,0,"SIT","");
13 llSleep(2);
14
15 llMessageLinked(LINK_SET,0,"HOP","");
16 llSleep(2);
17
18 llMessageLinked(LINK_SET,0,"SIT","");
19 llSleep(2);
20
21 llMessageLinked(LINK_SET,0,"EAT","");
22 llSleep(2);
23
24 llMessageLinked(LINK_SET,0,"SIT","");
25 llSleep(2);
26 }
27
28 }

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