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

[Table of Contents]

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 Hypergrid Story One  

Hypergrid Story One

Sample NPC Card

Category: NPC
By : Ferd Frederix
Created: 2015-11-24 Edited: 2015-11-23
Worlds: OpenSim

the Zip file

Download all files for Hypergrid Story One
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Sequencer.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
2 1,1,"@spawn=Namaka ?|<127, 126, 23>|Namaka"
3 2,1,"@spawn=Dylan ?|<127, 129, 23>|Dylan"
4 1,1,"@sit=dancerock"
5 2,2,"@sit=dancerock"
6 1,1,"@say=Hi, I am Namaka"
7 2,5,"@say=I am Dylan!... and now we leave"
8 1,1,"@delete"
9 2,1,"@delete"

Hypergrid Story One

Sample NPC Card

Category: NPC
By : Ferd Frederix
Created: 2015-11-24 Edited: 2015-11-23
Worlds: OpenSim


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 <llsd>
3 <map>
4 <key>serial</key>
5 <integer>0</integer>
6 <key>height</key>
7 <real>1.6691286563873291</real>
8 <key>wearables</key>
9 <array>
10 <array>
11 <map>
12 <key>item</key>
13 <uuid>0d67c6b9-90a6-4430-b124-5d3865253563</uuid>
14 <key>asset</key>
15 <uuid>501d4ff3-7669-4f2b-3de8-6077183b4314</uuid>
16 </map>
17 </array>
18 <array>
19 <map>
20 <key>item</key>
21 <uuid>3d56f323-beb2-4a4f-9b33-bedd01ef6d87</uuid>
22 <key>asset</key>
23 <uuid>9aa403be-7096-d638-d7b5-ab2739926664</uuid>
24 </map>
25 </array>
26 <array>
27 <map>
28 <key>item</key>
29 <uuid>3cc100b5-efb9-4357-84de-d53c763a9fe1</uuid>
30 <key>asset</key>
31 <uuid>9fe42dc9-32b9-863b-bbe3-2ed225aaa4dc</uuid>
32 </map>
33 </array>
34 <array>
35 <map>
36 <key>item</key>
37 <uuid>657b06b0-ec8b-4f13-8fcc-8cab56e76145</uuid>
38 <key>asset</key>
39 <uuid>2ba00144-a1c5-4c60-b70b-54f888d57104</uuid>
40 </map>
41 </array>
42 <array />
43 <array />
44 <array />
45 <array />
46 <array />
47 <array />
48 <array />
49 <array />
50 <array />
51 <array>
52 <map>
53 <key>item</key>
54 <uuid>f0d962ee-8899-4853-b643-5f1e8414f386</uuid>
55 <key>asset</key>
56 <uuid>9942fa1d-a7e6-0dee-2345-9b2449a137fb</uuid>
57 </map>
58 </array>
59 <array />
60 </array>
61 <key>textures</key>
62 <array>
63 <uuid>46697265-7374-6f72-6d00-000000000000</uuid>
64 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
65 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
66 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
67 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
68 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
69 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
70 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
71 <uuid>837d151d-b151-4f28-bd64-d64315dcd787</uuid>
72 <uuid>b74b9a80-b354-4a55-9a11-b04ddf9ad824</uuid>
73 <uuid>8e200c7a-6b01-43df-9196-1f9ad1df19b6</uuid>
74 <uuid>46a5b8b7-5f50-4799-8b0b-27f56cceb424</uuid>
75 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
76 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
77 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
78 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
79 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
80 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
81 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
82 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
83 <uuid>c3632e30-d73b-4d09-a96e-2024652f9562</uuid>
84 </array>
85 <key>visualparams</key>
86 <binary encoding="base64">ADNV/wB/Hpk/AP//P3UBAJyEIEwAP0S8LIhRR316nv/L/wB/AAB/AAAAAAAAAAB6QnWEia1/AAAArABKAAAAAAAAAABehFWHAF4Asq0AAImZbVV/fw84AGTY1szMzDMZWUzMAIIAAMSLf+NjVAB/cn9/f4mHe0SMf10vT4JJoD8AAAAAf38AAAAAfwCfAAAAAEdJSTVxa3xwQgBTAFR6ANbMxgAAaJN/4v/G////////////zAD//////////////wD//////wCCf/8ZZP////9UAAAAMwD///8AABkAGRczABkXMwAAGQAZFzMAABkAGRczABkXMwAZFzMAfw==</binary>
87 <key>attachments</key>
88 <array>
89 <map>
90 <key>point</key>
91 <integer>17</integer>
92 <key>item</key>
93 <uuid>06817d22-cc5c-4964-83a5-da7f9917c3d3</uuid>
94 <key>asset</key>
95 <uuid>07f0840d-9dc5-4011-8524-15918532ba04</uuid>
96 </map>
97 <map>
98 <key>point</key>
99 <integer>29</integer>
100 <key>item</key>
101 <uuid>4d02b390-6aea-4c35-aae2-02c36034340d</uuid>
102 <key>asset</key>
103 <uuid>546bdf75-8b2a-4365-9724-ede209e5b694</uuid>
104 </map>
105 <map>
106 <key>point</key>
107 <integer>2</integer>
108 <key>item</key>
109 <uuid>17d0f3ce-76f7-429a-8d88-ecdf67014c1b</uuid>
110 <key>asset</key>
111 <uuid>3ca39d60-c6c5-40be-817d-cc60ecb60cdb</uuid>
112 </map>
113 <map>
114 <key>point</key>
115 <integer>23</integer>
116 <key>item</key>
117 <uuid>78959931-fcc8-40cf-a2b7-9bc694da2152</uuid>
118 <key>asset</key>
119 <uuid>895b3226-52df-4967-97cc-fc798799363f</uuid>
120 </map>
121 <map>
122 <key>point</key>
123 <integer>1</integer>
124 <key>item</key>
125 <uuid>7bdd00a1-1936-4638-b363-9bfba9d9e203</uuid>
126 <key>asset</key>
127 <uuid>94e3709f-e90b-4395-b94f-9c9940cba790</uuid>
128 </map>
129 </array>
130 </map>
131 </llsd>

Hypergrid Story One

Sample NPC Card

Category: NPC
By : Ferd Frederix
Created: 2015-11-24 Edited: 2015-11-23
Worlds: OpenSim


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 <llsd>
3 <map>
4 <key>serial</key>
5 <integer>0</integer>
6 <key>height</key>
7 <real>1.7412686347961426</real>
8 <key>wearables</key>
9 <array>
10 <array>
11 <map>
12 <key>item</key>
13 <uuid>44fc1681-6782-4053-87d8-435ebf69aca9</uuid>
14 <key>asset</key>
15 <uuid>1e6cec92-51dd-f06e-a96e-6e54fe7e38f5</uuid>
16 </map>
17 </array>
18 <array>
19 <map>
20 <key>item</key>
21 <uuid>90a7592b-c5a4-4e85-9bd5-f1243d9b7fd2</uuid>
22 <key>asset</key>
23 <uuid>a87582b6-ad37-0a21-ac7b-2ffa5e75df77</uuid>
24 </map>
25 </array>
26 <array>
27 <map>
28 <key>item</key>
29 <uuid>726b9feb-15ea-4016-adf5-1de384c90529</uuid>
30 <key>asset</key>
31 <uuid>597937e4-c9a2-1cb6-a7aa-5875cc636ef9</uuid>
32 </map>
33 </array>
34 <array>
35 <map>
36 <key>item</key>
37 <uuid>f72f2605-631c-4fed-8bba-060690dac8ee</uuid>
38 <key>asset</key>
39 <uuid>c7f3d2f2-8c72-9491-b9a5-541fc40f537c</uuid>
40 </map>
41 </array>
42 <array />
43 <array />
44 <array />
45 <array />
46 <array />
47 <array />
48 <array />
49 <array />
50 <array />
51 <array>
52 <map>
53 <key>item</key>
54 <uuid>a46584db-c771-4753-9727-baa9106c6a38</uuid>
55 <key>asset</key>
56 <uuid>85d86e68-d863-2855-5a93-8159ea32f17a</uuid>
57 </map>
58 </array>
59 <array />
60 </array>
61 <key>textures</key>
62 <array>
63 <uuid>46697265-7374-6f72-6d00-000000000000</uuid>
64 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
65 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
66 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
67 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
68 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
69 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
70 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
71 <uuid>3a367d1c-bef1-6d43-7595-e88c1e3aadb3</uuid>
72 <uuid>3a367d1c-bef1-6d43-7595-e88c1e3aadb3</uuid>
73 <uuid>3a367d1c-bef1-6d43-7595-e88c1e3aadb3</uuid>
74 <uuid>3a367d1c-bef1-6d43-7595-e88c1e3aadb3</uuid>
75 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
76 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
77 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
78 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
79 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
80 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
81 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
82 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
83 <uuid>3a367d1c-bef1-6d43-7595-e88c1e3aadb3</uuid>
84 </array>
85 <key>visualparams</key>
86 <binary encoding="base64">PzXWfzFEET1eRBG7cAAApXo6ZwAAfV6cP/8APYRWIwDL/wCRAAB/AAB/AAAAf3J/Yz9/jH9/AAAAvwAACgAAAAAAAAAAkdiFADoA2GgAAI5Rd1V/fwwZAGTY1szMzDMZWUzMAFQAAJ5OT9F/PQB/Qn9/f3A7LkJ/f2FRT14KWT8AAAAAf38AAAAAfwCfAACyfzNVg166SXp9AABMAIJmANbMxgAARCZo4v/G////////////zAD//////////////wD//////wB/Qv8ZZP////9UAAAAMwD///8AABkAGRczABkXMwAAGQAZFzMAABkAGRczABkXMwAZFzMAfw==</binary>
87 <key>attachments</key>
88 <array>
89 <map>
90 <key>point</key>
91 <integer>9</integer>
92 <key>item</key>
93 <uuid>7ff842f2-0ef7-4805-bb04-ec3a61152205</uuid>
94 <key>asset</key>
95 <uuid>3ef0463a-248c-43d8-bdc4-83bcf16e3edf</uuid>
96 </map>
97 <map>
98 <key>point</key>
99 <integer>9</integer>
100 <key>item</key>
101 <uuid>b497f9c0-b3ba-41a3-9c3c-f943bf6c5f08</uuid>
102 <key>asset</key>
103 <uuid>62c1f804-57e4-4af8-a43f-7b46bd442c75</uuid>
104 </map>
105 <map>
106 <key>point</key>
107 <integer>30</integer>
108 <key>item</key>
109 <uuid>4ebc9791-d7e4-4acf-8b1c-34ae471428a1</uuid>
110 <key>asset</key>
111 <uuid>8a6a4219-db7d-4171-a335-7c7bbd084af1</uuid>
112 </map>
113 </array>
114 </map>
115 </llsd>

Hypergrid Story One

Sample NPC Card

Category: NPC
By : Ferd Frederix
Created: 2015-11-24 Edited: 2015-11-23
Worlds: OpenSim


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 <llsd>
3 <map>
4 <key>serial</key>
5 <integer>0</integer>
6 <key>height</key>
7 <real>1.6885325908660889</real>
8 <key>wearables</key>
9 <array>
10 <array>
11 <map>
12 <key>item</key>
13 <uuid>98bc81c9-7ff5-40df-924f-9d17eac6ede0</uuid>
14 <key>asset</key>
15 <uuid>66c41e39-38f9-f75a-024e-585989bfab73</uuid>
16 </map>
17 </array>
18 <array>
19 <map>
20 <key>item</key>
21 <uuid>162d13a2-f3bb-42d2-910f-330b8eb7f902</uuid>
22 <key>asset</key>
23 <uuid>77c41e39-38f9-f75a-024e-585989bbabbb</uuid>
24 </map>
25 </array>
26 <array>
27 <map>
28 <key>item</key>
29 <uuid>bd8d42c6-f40f-4906-879c-aae4cfe5f33d</uuid>
30 <key>asset</key>
31 <uuid>d342e6c0-b9d2-11dc-95ff-0800200c9a66</uuid>
32 </map>
33 </array>
34 <array>
35 <map>
36 <key>item</key>
37 <uuid>436a7dea-3484-42b3-812b-7d307b353d4f</uuid>
38 <key>asset</key>
39 <uuid>4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7</uuid>
40 </map>
41 </array>
42 <array>
43 <map>
44 <key>item</key>
45 <uuid>2afd4704-daae-4c78-8f7b-a79d7c1514d9</uuid>
46 <key>asset</key>
47 <uuid>00000000-38f9-1111-024e-222222111110</uuid>
48 </map>
49 </array>
50 <array>
51 <map>
52 <key>item</key>
53 <uuid>f937460d-207b-4e82-b6c0-7789afc0aebc</uuid>
54 <key>asset</key>
55 <uuid>00000000-38f9-1111-024e-222222111120</uuid>
56 </map>
57 </array>
58 <array />
59 <array />
60 <array />
61 <array />
62 <array />
63 <array />
64 <array />
65 <array />
66 <array />
67 </array>
68 <key>textures</key>
69 <array>
70 <uuid>46697265-7374-6f72-6d00-000000000000</uuid>
71 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
72 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
73 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
74 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
75 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
76 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
77 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
78 <uuid>84711871-c585-4be0-8ec5-0d8998769be0</uuid>
79 <uuid>cbd23982-104f-4719-9366-feda92ce5d12</uuid>
80 <uuid>47ec3452-f2f5-4d25-9b00-5b9a3867c1ab</uuid>
81 <uuid>9de5ef41-40a3-4997-a006-153188aecca7</uuid>
82 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
83 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
84 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
85 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
86 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
87 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
88 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
89 <uuid>c228d1cf-4b5d-4ba8-84f4-899a0796aa97</uuid>
90 <uuid>9dfd63c3-f823-49ef-90dd-313fbd040ab6</uuid>
91 </array>
92 <key>visualparams</key>
93 <binary encoding="base64">IT1VFzp/P1U/KgBVPyRVX5k/IgA/bViEP4hRVWeIfwDLAAB/AAAAAAB/AAD/f3J/Yz9/jH9/AAAAvwBoAAAAAAAAAAAAkdiFAH8Af6oAAH9/bVV/fz9VKmTY1szMzDMZWUzMAH8AAJBVf4R/VQB/f39/f387f1V/f2ovT39/zAKNQgAAf38AAAAAfwCfAACyfyRVg39/f5lfAIxKG39/ANbMxgAAPx5/pdHGf3+ZzDMz////zAD//////////////wD//////wB/f/8ZZP////9UAAAAM4T///8AAAAAAAAzABkXMwAAAAAZFzMAAAAAGRczABkXMwAZFzMAfw==</binary>
94 <key>attachments</key>
95 <array />
96 </map>
97 </llsd>

Hypergrid Story One

Sample sequencer script for NPC animator. It sequences multiple NPCs in order thru a scenarios
each 'things' entry is the NPC number, a (float) time to take between sending commands ( 0 is not allowed, but a small number is() ///and a @command that is sent to the NPC.

Category: NPC
By : Ferd Frederix
Created: 2015-11-24 Edited: 2015-11-23
Worlds: OpenSim


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 // Rev: 2 fixes the Linux bug for collisions.
3 //
4 // Rev: 3 Neo Cortex: modified to become a standalone sequencer for Scene one
5 //
6 // Rev: 4 Aine Caoimhe: added support for custom appearance change slave scripts for finale sequence with 2 new commands:
7 // @dumpkeys must be called when all NPCs have been rezzed (ie when npcList has been populated with their keys)
8 // this relays the key data to the slave scripts which are numbered from 01 to 12
9 // @slaveap=target|appearance_notecard_name where:
10 // target 1 = namaka (for final one)
11 // target 2 = mirror namakas (for final one)
12 // target 3 = all namaka (for all the other ones for her)
13 // target -1 = dylan (for the final one)
14 // target -2 = mirror dylans (for the final one)
15 // target -3 = all dylans (for all the ones for him)
16 // in both of the above commands you can use any non-zero npc number but it's ignored so I'd just use 1 each time
17 // it will respect a time delay value if you set one
18 // example:
19 // after all NPCs have been rezzed you need to call (but you only need to do it once):
20 // things += [1,0,"@dumpkeys"];
21 // then to have all of the dylans change to appearance notecard "dylan scene 2" with no delay after it you would do:
22 // things += [1,0,"@slaveap=-3|dylan scene 2"];
23
24 string myStoryNotecard = "!Story";
25
26 integer debug = FALSE;
27 integer LSLEditor = FALSE; // set to to TRUE to working in LSLEditor, FALSE for in-world.
28 integer iTitleText = TRUE; // set to TRUE to see debug info in text above the controller
29
30 integer SENSE = FALSE; // sensor for an avatar
31 float RATE = 5; // every 5 seconds
32 float RANGE = 2; // a very short range as this goes into a ring around the avatar
33 integer COLLIDE = TRUE; // if they collide, trigger the sequence
34
35 integer isRunning = FALSE; // used to stop collision from firing twice
36
37 list npcList = [ (key) "00000000-0000-0000-0000-000000000000", "empty npc0", // this one is ignored
38 (key) "00000000-0000-0000-0000-000000000000", "empty npc1",
39 (key) "00000000-0000-0000-0000-000000000000", "empty npc2",
40 (key) "00000000-0000-0000-0000-000000000000", "empty npc3",
41 (key) "00000000-0000-0000-0000-000000000000", "empty npc4",
42 (key) "00000000-0000-0000-0000-000000000000", "empty npc5",
43 (key) "00000000-0000-0000-0000-000000000000", "empty npc6",
44 (key) "00000000-0000-0000-0000-000000000000", "empty npc7",
45 (key) "00000000-0000-0000-0000-000000000000", "empty npc8",
46 (key) "00000000-0000-0000-0000-000000000000", "empty npc9",
47 (key) "00000000-0000-0000-0000-000000000000", "empty npc10",
48 (key) "00000000-0000-0000-0000-000000000000", "empty npc11",
49 (key) "00000000-0000-0000-0000-000000000000", "empty npc12"];
50
51 list myObjects = [];
52 list myObjectKeys = [];
53 integer myObjectsInitialized = FALSE;
54
55
56 string npcAction = "";
57 string npcParams = "";
58 key npcKey = "";
59 integer NPCOptions = OS_NPC_CREATOR_OWNED; // only the owner of this box can control this NPC.
60
61 key oldCollider; //remember who collided last
62 key newCollider;
63
64 // CODE follows
65
66 // For rezzing in
67 RezIn()
68 {
69 things = [1,5,"@stop"];
70 things += [2,5,"@stop"];
71 things += [3,10,"@stop"];
72 Speak();
73 }
74
75 DoIt()
76 {
77 things = myStory;
78 isRunning = TRUE;
80 llSleep(0.1);
81 }
82
83
84 list things ;
85 list myStory;
86
87 // DEBUG(string) will chat a string or display it as hovertext if debug == TRUE
88 DEBUG(string str) {
89 if(debug && ! LSLEditor)
90 llOwnerSay( str); // Send the owner debug info
91 if(debug && LSLEditor)
92 llSay(0, str); // Send to the Console in LSLEDitor
93 if(iTitleText) {
94 llSetText(str,<1.0,1.0,1.0>,1.0); // show hovertext
95
96 }
97 }
98
99 list ListStridedUpdate(list dest, list src, integer start, integer end, integer stride) {
100 return llListReplaceList(dest, src, start * stride, ((end + 1) * stride) - 1 );
101 }
102
103 spawn(integer who,string msg) {
104 DEBUG("spawning " + msg);
105 list data = llParseString2List(msg, ["|"], []);
106 //DEBUG((string) data);
107 list npcName = llParseString2List(llList2String(data,0), [" "], []);
108 npcKey = osNpcCreate(llList2String(npcName, 0), llList2String(npcName, 1), llList2Vector(data,1), llList2String(data, 2), NPCOptions);
109 npcList=ListStridedUpdate(npcList,[npcKey,npcName],who,who,2);
110 //DEBUG("npcList " + (string) npcList);
111 }
112
113 delete(integer who) {
114 DEBUG(llList2String(npcList,who*2+1) + " is removed");
115 osNpcRemove (llList2Key(npcList,who*2));
116 npcList=ListStridedUpdate(npcList,[(key) "00000000-0000-0000-0000-000000000000","removed NPC"],who,who,2);
117 //llSay(0, "npcList " + (string) npcList);
118 }
119
120 say(integer who,string msg) {
121 DEBUG(llList2String(npcList,who*2+1) + " says " + msg);
122 osNpcSay(llList2Key(npcList,who*2),0, msg);
123 }
124
125 sit(integer who,string msg) {
126 DEBUG(llList2String(npcList,who*2+1) + " sits on " + (string) msg);
127 // look up object named "msg" in myObjects, get key from myObjectsKeys, make "who" NPC sit on it
128 osNpcSit(llList2Key(npcList,who*2), llList2Key(myObjectKeys,llListFindList(myObjects,[msg])), OS_NPC_SIT_NOW);
129 }
130
131 touchit(integer who,string msg) {
132 DEBUG(llList2String(npcList,who*2+1) + " touches " + (string) msg);
133 // look up object named "msg" in myObjects, get key from myObjectsKeys, make "who" NPC touch it
134 osNpcTouch(llList2Key(npcList,who*2),llList2Key(myObjectKeys,llListFindList(myObjects,[msg])), LINK_THIS);
135 }
136
137 stand(integer who) {
138 DEBUG(llList2String(npcList,who*2+1) + " stands");
139 osNpcStand(llList2Key(npcList,who*2));
140 list anToStop=llGetAnimationList(llList2Key(npcList,who*2));
141 integer stop=llGetListLength(anToStop);
142 while(--stop>-1) { osAvatarStopAnimation(llList2Key(npcList,who*2),llList2Key(anToStop,stop)); }
143 osNpcPlayAnimation(llList2Key(npcList,who*2),"Stand");
144 }
145
146 walk(integer who,vector pos) {
147 DEBUG(llList2String(npcList,who*2+1) + " walks to " + (string) pos);
148 osNpcMoveToTarget(llList2Key(npcList,who*2),pos,OS_NPC_NO_FLY);
149 osNpcPlayAnimation(llList2Key(npcList,who*2),"Walk");
150 }
151
152 animate(integer who, string ani) {
153 DEBUG(llList2String(npcList,who*2+1) + " plays " + (string) ani);
154 osNpcPlayAnimation(llList2Key(npcList,who*2),ani);
155 }
156
157 appearance(integer who, string app) {
158 DEBUG(llList2String(npcList,who*2+1) + " changes appearance to " + (string) app);
159 osNpcLoadAppearance(llList2Key(npcList,who*2),app);
160 }
161
162 rotate(integer who,float rot) {
163 DEBUG(llList2String(npcList,who*2+1) + " rotates " + (string) rot);
164 osNpcSetRot(llList2Key(npcList,who*2),llEuler2Rot(<0,0,rot> * DEG_TO_RAD));
165 }
166
167 // <<<< Added by Aine
168 dumpKeys() {
169 llMessageLinked(LINK_THIS,0,"NPC_UUID_LIST",llDumpList2String(llList2ListStrided(npcList,0,-1,2),"|"));
170 }
171 slaveap(string com) {
172 list parse=llParseString2List(com,["|"],[]);
173 llMessageLinked(LINK_THIS,llList2Integer(parse,0),"NPC_CHANGE_APPEARANCE",llList2String(parse,1));
174 }
175 // <<<< End added by Aine
176 Speak() {
177
178 integer npc = llList2Integer(things,0);
179 float time = llList2Float(things,1);
180 string msg = llList2String(things,2);
181 DEBUG("npc:" + (string) npc + " time:" + (string) time + " Msg:" + msg);
182 if(npc) {
183 things = llDeleteSubList(things,0,2);
184 // llMessageLinked(npc,0, msg,""); // <<<<< Aine: I don't see any need for having this here still since this script is handling it
185 list data = llParseString2List(msg, ["="], []);
186 npcAction = llToLower(llStringTrim(llList2String(data, 0), STRING_TRIM));
187 DEBUG("Action:" + npcAction);
188 npcParams = llStringTrim(llList2String(data, 1), STRING_TRIM);
189 DEBUG("Params:" + npcParams);
190 if(npcAction == "@say") {
191 say(npc,npcParams);
192 } else if(npcAction == "@spawn") {
193 spawn(npc,npcParams);
194 } else if(npcAction == "@delete") {
195 delete(npc);
196 } else if(npcAction == "@sit") {
197 sit(npc,npcParams);
198 } else if(npcAction == "@touch") {
199 touchit(npc,npcParams);
200 } else if(npcAction == "@stand") {
201 stand(npc);
202 } else if(npcAction == "@walk") {
203 walk(npc,npcParams);
204 } else if(npcAction == "@animate") {
205 animate(npc,npcParams);
206 } else if(npcAction == "@appearance") {
207 appearance(npc,npcParams);
208 } else if(npcAction == "@rotate") {
209 rotate(npc,npcParams);
210 // >>>> Added by Aine
211 } else if(npcAction == "@dumpkeys") {
212 dumpKeys();
213 } else if(npcAction == "@slaveap") {
214 slaveap(npcParams);
215 } // >>>> end of add by Aine
216 if(time > 0) {
217 llSetTimerEvent(time);
218 } else {
219 llOwnerSay("Whooops, time = 0!");
220 DEBUG("npc:" + (string) npc + " time:" + (string) time + " Msg:" + msg);
222 }
223 } else {
224 DEBUG("Done");
225 isRunning = FALSE;
226 Reset();
228 if(SENSE)
229 llSensorRepeat("","",AGENT,RANGE,PI,RATE);
230 }
231 }
232
233 Reset()
234 {
235 llSetStatus(STATUS_PHANTOM, FALSE); // Rev 2
237 llSleep(0.1);
239 }
240
241 default
242 {
244 {
245 DEBUG("entering state default");
246
247 if(! myObjectsInitialized){
248 state initial;
249 }
250
251 llSetText("",<1,1,1>,1.0);
252 Reset();
254 if(SENSE)
255 llSensorRepeat("","",AGENT,RANGE,PI,RATE);
256 }
257
258 sensor(integer n) {
259 DEBUG("Bumped");
260 if(! osIsNpc(llDetectedKey(0))) {
261 DEBUG("Sensed avatar");
263 RezIn();
264 }
265 }
266
267 timer()
268 {
269 Speak();
270 }
271
273 newCollider = llKey2Name(llDetectedKey(0));
274 DEBUG("Collided with " + llKey2Name(llDetectedKey(0)));
275
277 {
278 if( newCollider != oldCollider) {
279 DoIt();
280 oldCollider = llKey2Name(llDetectedKey(0));
281 Speak();
282 }
283 }
284 }
285
286 collision_end(integer num_detected) {
287 DEBUG(llDetectedName(0) + " has stopped colliding with me!");
288 if(! isRunning && (newCollider == oldCollider) ) {
289 oldCollider = NULL_KEY;
290 }
291 }
292
294 DEBUG("Touched by " + llKey2Name(llDetectedKey(0)));
295 if(isRunning) {
296 //insert restart code here
297 }
298 if(! osIsNpc(llDetectedKey(0))) {
299 DoIt();
300 Speak();
301 }
302 }
303
304
305
307 {
309 }
310
311 changed(integer what)
312 {
314 {
316 }
317 }
318 }
319
320 state initial
321 {
323 {
324 DEBUG("entering state initial");
325 myStory = [];
326 list myStoryLines = llParseString2List(osGetNotecard(myStoryNotecard), ["\n"], []);
327 DEBUG("text = " + (string) myStoryLines);
328 DEBUG("lines = " + (string) llGetListLength(myStoryLines));
329 integer i;
330 for (i=0; i<llGetListLength(myStoryLines); i++) {
331 string myStoryLine = llList2String(myStoryLines,i);
332 integer npc = (integer) llGetSubString(myStoryLine,0,llSubStringIndex(myStoryLine,","));
333 string rest = llGetSubString(myStoryLine,llSubStringIndex(myStoryLine,",")+1,-1);
334 float time = llGetSubString(rest,0,llSubStringIndex(rest,","));
335 string msg = llGetSubString(rest,llSubStringIndex(rest,",")+2,-2);
336 //now parse for sit and touch events to find the names of the objects needed
337 list data = llParseString2List(msg, ["="], []);
338 npcAction = llToLower(llStringTrim(llList2String(data, 0), STRING_TRIM));
339 DEBUG("Action:" + npcAction);
340 npcParams = llStringTrim(llList2String(data, 1), STRING_TRIM);
341 DEBUG("Params:" + npcParams);
342 if(npcAction == "@sit") {
343 myObjects += npcParams;
344 } else if(npcAction == "@touch") {
345 myObjects += npcParams;
346 }
347 DEBUG("npc: " + (string) npc + " time: " + (string) time + " msg: " + msg);
348 myStory += [npc, time, msg];
349 }
350 DEBUG("Story read, initializing objects: " + llDumpList2String(myObjects," "));
351
352 if(llGetListLength(myObjects) == 0) {
353 DEBUG("myObjects is empty upon entering state initial");
354 myObjectsInitialized = TRUE;
355 state default;
356 }
357 llSensor(llList2String(myObjects,0),"",ACTIVE|PASSIVE,96,PI);
358 DEBUG("initially looking for: " + llList2String(myObjects,0));
359 }
360
361 //sensor is used to scan surrounding for named prims
362 sensor(integer num) {
363 myObjectKeys = myObjectKeys + llDetectedKey(0);
364 DEBUG("myObjectKeys: " + llDumpList2String(myObjectKeys," "));
365
366 myObjects = llDeleteSubList(myObjects,0,0);
367 if(llGetListLength(myObjects) == 0) {
368 myObjectsInitialized = TRUE;
369 state default;
370 } else {
371 llSensor(llList2String(myObjects,0),"",ACTIVE|PASSIVE,96,PI);
372 DEBUG("now looking for: " + llList2String(myObjects,0));
373 }
374 }
375 no_sensor(){
376 DEBUG ("no target prim located");
377 }
378 }

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