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
NPC NPC HUD  

NPC HUD

animator

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

the Zip file

Download all files for NPC HUD
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. ~animator.lsl
Get file # 2. ~clonesit.lsl
Get file # 3. ~comehere.lsl
Get file # 4. ~controler.lsl
Get file # 5. ~dance.lsl
Get file # 6. ~follow.lsl
Get file # 7. ~master.lsl
Get file # 8. ~recall.lsl
Get file # 9. ~StopAllAnimations.lsl
1
2 // npc animator
3 list lstAnilMenu = ["Nadu","Beauty","Bracelets","Cutie","Kneel","NaduWide","Submit", "Tower" , "Whip", "Chain", "Bara", "Stop"];
4 integer channel = -31;
5 vector npcPos;
6 integer listener;
7 key npc;
8 string clonetype;
9 string curAnim;
10
11 list order_buttons(list buttons)
12 {
13 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
14 }
15
16 rotation getRotToPointAxisAt(vector axis)
17 {
18 return llGetRot() * llRotBetween(axis * osNpcGetRot(npc), llGetPos()- osNpcGetPos(npc) );
19 }
20
21 default
22 {
23 link_message(integer sender_number, integer number, string msg, key id)
24 {
25 if(number == 21)
26 {
27 llDialog(llGetOwner(), "Select an Animation:", order_buttons(lstAnilMenu), channel);
28 listener = llListen(channel, "", NULL_KEY, "");
29 npcPos = llGetPos();
30 clonetype=msg;
31 npc= id;
32 llSetTimerEvent(30.0);
33 }
34 }
35
36 listen(integer channel, string name, key id, string msg)
37 {
38 llListenRemove(listener);
39 llSetTimerEvent(0.0);
40 //--------------------------------------
41 // main menu results here
42 //--------------------------------------
43
44 if(msg != "Stop")
45 {
46 string anim = llToLower(msg);
47 osAvatarStopAnimation(npc,curAnim);
48 curAnim = anim;
49 osAvatarPlayAnimation(npc,anim);
50
51 rotation tempRot = getRotToPointAxisAt(<0,0,1>);
52
53 //osNpcSetRot(npc, llGetRot() * (llEuler2Rot(<0, 0, 0> * DEG_TO_RAD)));
54 osNpcSetRot(npc,tempRot) ;
55 }
56 else
57 {
58 osAvatarStopAnimation(npc,curAnim);
59 }
60
61 //}
62
63 }
64 timer()
65 {
66 llListenRemove(listener);
67 }
68 }

NPC HUD

clone

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 // npc sit
3 list sitbuttons;
4 float scanrange=10;
5 string sitprompt = "Pick the object on which you want the clone to sit. If it's not in the list, have the clone move closer and try again.\n";
6 list sitkeys;
7 integer channel= -21;
8 integer listener;
9 key npc;
10 string clonetype;
11
12
13 list order_buttons(list buttons)
14 {
15 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
16 }
17
18 default
19 {
20
21 listen(integer channel, string name, key id, string message)
22 {
23 llListenRemove(listener);
24 llSetTimerEvent(0.0);
25 integer seatnum = (integer)message - 1 ;
26 osNpcSit(npc, llList2String(sitkeys, seatnum),OS_NPC_SIT_NOW);
27
28 }
29 link_message(integer sender_number, integer number, string msg, key id)
30 {
31 if(number == 30)
32 {
33 clonetype=msg;
34 npc= id;
35 llSensor("", NULL_KEY, SCRIPTED, scanrange, PI);
36 }
37 if(number == 31)
38 {
39 osNpcStand(id);
40 sitkeys = [];
41 sitbuttons = [];
42 llMessageLinked(LINK_ROOT,99,"",npc);
43 }
44 }
45 sensor(integer num)
46 {
47 sitkeys = [];
48 sitbuttons = [];
49 //give menuuser a list of things to choose from
50 //lop the list off at 11 so we don't need multipage menu
51 if(num > 12)
52 {
53 num = 12;
54 }
55 integer n;
56 for (n = 0; n < num; n ++)
57 {
58 //don't add things named "Object"
59 string name = llDetectedName(n);
60 if(name != "Object")
61 {
62 sitbuttons += [(string)(n + 1)];
63 if(llStringLength(name) > 44)
64 { //added to prevent errors due to 512 char limit in poup prompt text
65 name = llGetSubString(name, 0, 40) + "...";
66 }
67 sitprompt += "\n" + (string)(n + 1) + " - " + name;
68 sitkeys += [llDetectedKey(n)];
69 }
70 }
71 //prompt can only have 512 chars
72 while(llStringLength(sitprompt) >= 512)
73 {
74 //pop the last item off the buttons, keys, and prompt
75 sitbuttons = llDeleteSubList(sitbuttons, -1, -1);
76 sitkeys = llDeleteSubList(sitkeys, -1, -1);
77 sitprompt = llDumpList2String(llDeleteSubList(llParseString2List(sitprompt, ["\n"], []), -1, -1), "\n");
78 }
79 llDialog(llGetOwner(), sitprompt, order_buttons(sitbuttons), channel);
80 listener = llListen(channel, "", llGetOwner(), "");
81 llSetTimerEvent(30.0);
82
83 }
84 no_sensor()
85 {
86 //nothing close by to sit on, tell menuuser
87 llInstantMessage(llGetOwner(), "Unable to find sit targets.");
88 }
89 timer()
90 {
91 llListenRemove(listener);
92 llSetTimerEvent(0.0);
93
94 }
95
96
97
98 }

NPC HUD

come here

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 // npc move to
3 vector offset = < 3, 0, 1.5>; //3 meter in front
4 vector npcPos;
5 key npc;
6 string clonetype;
7
8
9 default
10 {
11 link_message(integer sender_number, integer number, string msg, key id)
12 {
13 if(number == 23)
14 {
15 // Owner detect
16 list det = llGetObjectDetails(llGetOwner(),[OBJECT_POS,OBJECT_ROT" title="View Definition" class="tooltip">OBJECT_ROT]);
17 npc=id;
18 // Get position and rotation
19 vector pos = llList2Vector(det,0);
20 rotation rot = (rotation)llList2String(det,1);
21 // use whatever offset you want.
22 vector worldOffset = offset;
23 // Offset relative to owner needs a quaternion.
24 vector avOffset = offset * rot;
25 pos += avOffset;
26 osNpcMoveToTarget(npc,pos, OS_NPC_NO_FLY );
27 }
28 }
29
30 }

NPC HUD

controller

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 // npc control
3 list lstCrtllMenu = ["Animate","Dance","Come Here","Follow","Force Sit", "Unsit" ];//"Move","Speak",
4 integer channel = -30;
5 vector npcPos;
6 integer listener;
7 key npc;
8 string clonetype;
9
10 list order_buttons(list buttons)
11 {
12 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
13 }
14
15
16 default
17 {
18 link_message(integer sender_number, integer number, string msg, key id)
19 {
20 if(number == 20)
21 {
22 llDialog(llGetOwner(), "Select control option:", order_buttons(lstCrtllMenu), channel);
23 listener = llListen(channel, "", NULL_KEY, "");
24 npcPos = llGetPos();
25 clonetype=msg;
26 npc= id;
27 llSetTimerEvent(30.0);
28 }
29 }
30
31 listen(integer channel, string name, key id, string message)
32 {
33 llListenRemove(listener);
34 llSetTimerEvent(0.0);
35 //--------------------------------------
36 // main menu results here
37 //--------------------------------------
38 if(message =="Animate")
39 {
40 llMessageLinked(LINK_ROOT,21,clonetype,npc);
41 }
42 if(message =="Dance")
43 {
44 llMessageLinked(LINK_ROOT,22,clonetype,npc);
45 }
46 if(message =="Come Here")
47 {
48 llMessageLinked(LINK_ROOT,23,clonetype,npc);
49 }
50 if(message =="Follow")
51 {
52 llMessageLinked(LINK_ROOT,24,clonetype,npc);
53 }
54 if(message =="Force Sit")
55 {
56 llMessageLinked(LINK_SET,30,clonetype,npc);
57 //llSay(0,"30");
58 }
59 if(message =="Unsit")
60 {
61 llMessageLinked(LINK_ROOT,31,clonetype,npc);
62 }
63 }
64
65 timer()
66 {
67 llListenRemove(listener);
68 }
69 }

NPC HUD

dance

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 // npc dance
3 list lstAnilMenu = ["WeLoveYou","AKEYO","Full of it","Caramel","Kiss my Buttons","Room with a View","Shamo","Dambuster","Everybody Loves Me","Washing Machine","Yipe","Stop"];
4 integer channel = -32;
5 vector npcPos;
6 integer listener;
7 key npc;
8 string clonetype;
9 string curAnim;
10
11 list order_buttons(list buttons)
12 {
13 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
14 }
15
16
17 default
18 {
19 link_message(integer sender_number, integer number, string msg, key id)
20 {
21 if(number == 22)
22 {
23 llDialog(llGetOwner(), "Select a Dance:", order_buttons(lstAnilMenu), channel);
24 listener = llListen(channel, "", NULL_KEY, "");
25 npcPos = llGetPos();
26 clonetype=msg;
27 npc= id;
28 llSetTimerEvent(30.0);
29 }
30 }
31
32 listen(integer channel, string name, key id, string msg)
33 {
34 llListenRemove(listener);
35 llSetTimerEvent(0.0);
36 //--------------------------------------
37 // main menu results here
38 //--------------------------------------
39
40 if(msg != "Stop")
41 {
42 string anim = llToLower(msg);
43 osAvatarStopAnimation(npc,curAnim);
44 curAnim = anim;
45 osAvatarPlayAnimation(npc,anim);
46 }
47 else
48 {
49 osAvatarStopAnimation(npc,curAnim);
50 }
51
52 //}
53
54 }
55 timer()
56 {
57 llListenRemove(listener);
58 }
59 }

NPC HUD

follow

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 // npc follow
3 list lstFollowMenu = ["Start","Stop"];
4 integer channel = -34;
5 integer listener;
6 key npc;
7 string clonetype;
8 vector offset = < 3, 0, 1.0>; //3 meter behind. 1.5 up (bot does seamto walk if not raised a bit
9
10
11 list order_buttons(list buttons)
12 {
13 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
14 }
15
16
17 default
18 {
19 link_message(integer sender_number, integer number, string msg, key id)
20 {
21 if(number == 24)
22 {
23 llDialog(llGetOwner(), "Start/ Stop Following:", order_buttons(lstFollowMenu), channel);
24 listener = llListen(channel, "", NULL_KEY, "");
25 clonetype=msg;
26 npc= id;
27
28 }
29 else
31 llSetTimerEvent(0.0);}
32
33 }
34
35 listen(integer channel, string name, key id, string msg)
36 {
37 llListenRemove(listener);
38 //
39 //--------------------------------------
40 // main menu results here
41 //--------------------------------------
42 if(msg == "Start")
43 {
44 llSetTimerEvent(1.0);
45 }
46 if(msg == "Stop")
47 {
49 llSetTimerEvent(0.0);
50
51 }
52
53
54 //}
55
56 }
57 timer()
58 {
59 llSensor("",npc,AGENT,4,PI);
60 }
61 no_sensor()
62 {
63 list det = llGetObjectDetails(llGetOwner(),[OBJECT_POS,OBJECT_ROT" title="View Definition" class="tooltip">OBJECT_ROT]);
64 // Get position and rotation
65 vector pos = llList2Vector(det,0);
66 rotation rot = (rotation)llList2String(det,1);
67 // use whatever offset you want.
68 vector worldOffset = offset;
69 // Offset relative to owner needs a quaternion.
70 vector avOffset = offset * rot;
71 pos += avOffset;
72 osNpcMoveToTarget(npc,pos, OS_NPC_NO_FLY );
73 }
74
75 }

NPC HUD

Master

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 key npc = "00000000-0000-0000-0000-000000000000";
3 string notecard= "clonedAV";
4 string clonetype;
5 key av;
6 key toucher;
7 vector npcPos ;
8
9 integer channel = -19;
10 integer clonechannel = -18;
11 // menus
12 list lstMainMenu = ["Clone","Recall","Destroy","Control","Settings","Load","-","-","Reset"];
13
14 string cmdname;
15
16 float range = 12.0;
17
18 string name;
19 string first;
20 string last;
21
22 list avatarlist;//2 strided list in form of name,key used to create menu of people to grab, and process responses.
23
24 integer listener;
25 integer timeout = 30;
26
27 AvMenu(key id)
28 {
29 //give list of people in victims list
30 list buttons;
31 integer n;
32 integer stop = llGetListLength(avatarlist);
33 for (n = 0; n < stop; n = n + 2)
34 {
35 buttons += llList2String(avatarlist, n);
36 }
37 string prompt = "Select who to clone.";
38 prompt += " (Menu will time out in " + (string)timeout + " seconds.)";
39 llSetTimerEvent(timeout);
40 listener = llListen(clonechannel, "", id, "");
41 llDialog(id, prompt, buttons,clonechannel );
42 }
43
44 ControlMenu(key id)
45 {
46 list buttons = ["Unsit"];
47 string prompt = "Pick an option.";
48 prompt += " (Menu will time out in " + (string)timeout + " seconds.)";
49 llSetTimerEvent(timeout);
50 listener = llListen(clonechannel, "", id, "");
51 llDialog(id, prompt, buttons, clonechannel);
52 }
53
54
55 CloneAv(key id,string name)
56 {
57
58 //--------------------------------------------------
59 first = llList2String(llParseString2List(name,[" "],[]),0);
60 last = llList2String(llParseString2List(name,[" "],[]),1);
61 vector npcPos = llGetPos() + <3,0,0>;
62 osAgentSaveAppearance(id, notecard);
63 npc = osNpcCreate("_" + first, last, npcPos, notecard);
64 clonetype= "default";
66 //-------------------------------------------------
67 }
68
69 list order_buttons(list buttons)
70 {
71 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
72 }
73
74 default
75 {
77 {
79 {
80 //
81 llDialog(llDetectedKey(0), "What do you want to do?", order_buttons(lstMainMenu), channel);
82 listener = llListen(channel, "", NULL_KEY, "");
83 npcPos = llGetPos() + <3,0,0>;
84 llSetTimerEvent(30.0);
85 }
86 }
87
88
89
90 listen(integer channel, string name, key id, string message)
91 {
92 llListenRemove(listener);
93 llSetTimerEvent(0.0);
94 //--------------------------------------
95 // main menu results here
96 //--------------------------------------
97 if(channel == channel)
98 {
99 if(message == "Clone")
100 {
101 if(npc == "00000000-0000-0000-0000-000000000000")
102 {
103 llSensor("", NULL_KEY, AGENT, range, PI);
104 }
105 else
106 {
107 llOwnerSay("Sorry,but it appears you have already have a clone");
108 }
109
110 }
111 if(message == "Recall")
112 {
113 if(npc == "00000000-0000-0000-0000-000000000000")
114 {
115 llMessageLinked(LINK_ROOT,10,"Recall",id);
116 }
117 else
118 {
119 llOwnerSay("Sorry,but it appears you have already have a clone");
120 }
121 }
122 if(message == "Control")
123 {
124 if(npc != "00000000-0000-0000-0000-000000000000")
125 {
126 llMessageLinked(LINK_ROOT,20,clonetype,npc);
127 }
128 else
129 {
130 llOwnerSay("Sorry,but it appears you do not have a clone to control");
131 }
132 }
133 if(message == "Destroy")
134 {
136 llOwnerSay("Removing clone");
137 osAvatarPlayAnimation(npc, "shock");
138 llSleep(5);
139 osNpcRemove(npc);
140 npc = "00000000-0000-0000-0000-000000000000";
141 }
142 if(message == "Reset")
143 {
144 llResetOtherScript("~animator");
145 llResetOtherScript("~clonesit");
146 llResetOtherScript("~comehere");
147 llResetOtherScript("~controler");
148 llResetOtherScript("~dance");
149 llResetOtherScript("~follow");
150 llResetOtherScript("~recall");
151 llResetOtherScript("~StopAllAnimations");
152 llSleep(0.2);
154 }
155 if(message == "-")
156 {
157 }
158 }
159 //--------------------------------------
160 // avatar selected to clone
161 //--------------------------------------
162 if(channel == clonechannel)
163 {
164 //message will be victim name. get key from list
165 integer index = llListFindList(avatarlist, [message]);
166 key victim = llList2Key(avatarlist, index + 1);
167 CloneAv(victim, message);
168 }
169
170 }
171
172 sensor(integer num)
173 {
174 llListenRemove(listener);
175 llSetTimerEvent(0.0);
176 //give menu of potential avatars
177 integer n;
178 avatarlist = [];
179
180 //cap at 12 victims to avoid needed multi page menu
181 if(num > 12)
182 {
183 num = 12;
184 }
185
186 for (n = 0; n < num; ++n)
187 {
188 avatarlist += [llDetectedName(n), llDetectedKey(n)];
189 }
190 AvMenu(llGetOwner());
191
192 }
193
194 no_sensor()
195 {
196 llOwnerSay( "Sorry, there's no one close enough to clone.");
197 llListenRemove(listener);
198 llSetTimerEvent(0.0);
199 }
200
201 timer()
202 {
203 llSetTimerEvent(0.0);
204 llListenRemove(listener);
205 }
206 link_message(integer sender_number, integer num, string msg, key id)
207 {
208 if(num == 99)
209 {
210 npc = id;
211 llSay(0,(string)npc);
212 clonetype=msg;
213
214 }
215 }
216
217 }

NPC HUD

Recall

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 list lstRecallMenu = ["Bunny T","Latex Slut","Barbosa","Whitey","3A", "Voodoo", "Vanessa", "White 06"];
3 integer channel = -20;
4 vector npcPos;
5 integer listener;
6 key npc;
7
8 list order_buttons(list buttons)
9 {
10 return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
11 }
12
13 default
14 {
15 link_message(integer sender_number, integer number, string message, key id)
16
17 {
18 if(number == 10)
19 {
20 llDialog(id, "Select the clone you want to create?", order_buttons(lstRecallMenu), channel);
21 listener = llListen(channel, "", NULL_KEY, "");
22 npcPos = llGetPos() + <3,0,0>;
23 llSetTimerEvent(30.0);
24
25 }
26 }
27 listen(integer channel, string name, key id, string message)
28 {
29 llListenRemove(listener);
30 llSetTimerEvent(0.0);
31 //--------------------------------------
32 // main menu results here
33 //--------------------------------------
34 if(channel == channel)
35 {
36 if(message =="Bunny T")
37 {
38 npc = osNpcCreate("Bunneh","Fuckme", npcPos, "BunnyT");
39 llMessageLinked(LINK_ROOT,99,"Bunny T",npc);
41 }
42 if(message =="Latex Slut")
43 {
44 npc = osNpcCreate("Your","LSlut", npcPos, "LatexSlut");
45 llMessageLinked(LINK_ROOT,99,"LatexSlut",npc);
47 }
48 if(message =="Barbosa")
49 {
50 npc = osNpcCreate("Barbosa","Aardvark", npcPos, "Barbosa");
51 llMessageLinked(LINK_ROOT,99,"Barbosa",npc);
53 }
54 if(message =="Whitey")
55 {
56 npc = osNpcCreate("Whitey","Aardvark", npcPos, "Whitey Basic 02");
57 llMessageLinked(LINK_ROOT,99,"Whitey Basic 02",npc);
59 }
60 if(message =="3A")
61 {
62 npc = osNpcCreate("Aaacky","Aardvark", npcPos, "yo");
63 llMessageLinked(LINK_ROOT,99,"yo",npc);
65 }
66 if(message =="Voodoo")
67 {
68 npc = osNpcCreate("Voodoo","Aardvark", npcPos, "voodoo");
69 llMessageLinked(LINK_ROOT,99,"voodoo",npc);
71 }
72 if(message =="Vanessa")
73 {
74 npc = osNpcCreate("Vanessa","Aardvark", npcPos, "Vanessa");
75 llMessageLinked(LINK_ROOT,99,"Vanessa",npc);
77 }
78 if(message =="White 06")
79 {
80 npc = osNpcCreate("White","Aardvark", npcPos, "White 06");
81 llMessageLinked(LINK_ROOT,99,"White 06",npc);
83 }
84 }
85 }
86 timer()
87 {
88 llListenRemove(listener);
89 }
90
91 }

NPC HUD

Stop

Category: NPC
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: OpenSim

1
2 default
3 {
4
5 link_message(integer sender_number, integer number, string msg, key id)
6 {
7 if(number == 99)
8 {
9 list anims = llGetAnimationList(id); // get list of animations
10 integer len = llGetListLength(anims);
11 integer i;
12 llSay(0, "Stopping " + (string)len + llGetSubString(" animations",0,-1 - (len == 1)));
13 for (i = 0; i < len; ++i){
14 key curAnim = llList2Key(anims, i);
15 osAvatarStopAnimation(id,curAnim);
16 llSay(0, "Stopping " + (string)curAnim);
17 llSleep(2);
18 }
19 }
20 }
21 }

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