diff options
Diffstat (limited to '')
-rw-r--r-- | bin/assets/ScriptsAssetSet/KanEd-Test14.lsl | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/bin/assets/ScriptsAssetSet/KanEd-Test14.lsl b/bin/assets/ScriptsAssetSet/KanEd-Test14.lsl new file mode 100644 index 0000000..2c60035 --- /dev/null +++ b/bin/assets/ScriptsAssetSet/KanEd-Test14.lsl | |||
@@ -0,0 +1,70 @@ | |||
1 | integer createdObjectCounter; | ||
2 | integer linkedObjectCounter; | ||
3 | |||
4 | default | ||
5 | { | ||
6 | state_entry() | ||
7 | { | ||
8 | llSay( 0, "Hello, Avatar!"); | ||
9 | linkedObjectCounter = 0; // zero the linked object counter. | ||
10 | } | ||
11 | |||
12 | touch_start(integer total_number) | ||
13 | { | ||
14 | if( createdObjectCounter <= 0 ) // nothing has yet been linked, | ||
15 | { // begin object creation sequence... | ||
16 | // ask for permissions now, since it will be too late later. | ||
17 | llRequestPermissions( llGetOwner(), PERMISSION_CHANGE_LINKS ); | ||
18 | } | ||
19 | else // just do whatever should be done upon touch without | ||
20 | { // creating new objects to link. | ||
21 | // insert commands here to respond to a touch. | ||
22 | } | ||
23 | } | ||
24 | |||
25 | run_time_permissions( integer permissions_granted ) | ||
26 | { | ||
27 | if( permissions_granted == PERMISSION_CHANGE_LINKS ) | ||
28 | { // create 2 objects. | ||
29 | llRezObject("Object1", llGetPos() + < 1, 0, 2 >, | ||
30 | ZERO_VECTOR, ZERO_ROTATION, 42); | ||
31 | createdObjectCounter = createdObjectCounter + 1; | ||
32 | |||
33 | llRezObject("Object1", llGetPos() + < -1, 0, 2 >, | ||
34 | ZERO_VECTOR, ZERO_ROTATION, 42); | ||
35 | createdObjectCounter = createdObjectCounter + 1; | ||
36 | |||
37 | } | ||
38 | else | ||
39 | { | ||
40 | llOwnerSay( "Didn't get permission to change links." ); | ||
41 | return; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | object_rez( key child_id ) | ||
46 | { | ||
47 | llOwnerSay( "rez happened and produced object with key " + | ||
48 | (string)child_id ); | ||
49 | |||
50 | // link as parent to the just created child. | ||
51 | llCreateLink( child_id, TRUE ); | ||
52 | |||
53 | // if all child objects have been created then the script can | ||
54 | // continue to work as a linked set of objects. | ||
55 | linkedObjectCounter++; | ||
56 | if( linkedObjectCounter >= 2 ) | ||
57 | { | ||
58 | // Change all child objects in the set to red (including parent). | ||
59 | llSetLinkColor( LINK_ALL_CHILDREN, < 1, 0, 0 >, ALL_SIDES ); | ||
60 | |||
61 | // Make child object "2" half-tranparent. | ||
62 | llSetLinkAlpha( 2, .5, ALL_SIDES ); | ||
63 | |||
64 | // Insert commands here to manage subsequent activity of the | ||
65 | // linkset, like this command to rotate the result: | ||
66 | // llTargetOmega( < 0, 1, 1 >, .2 * PI, 1.0 ); | ||
67 | } | ||
68 | } | ||
69 | } | ||
70 | |||