From ea2a9fd6e83768e76021873f21bd0f883c98a5af Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 27 May 2014 04:47:32 +1000 Subject: Part one of changing the test sim to match the new specs. --- media/Test%20sim/index.omg | 2 + ...%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0.omg | 32 ++ .../.MENUITEMS | 211 ++++++++ .../.POSITIONS | 24 + .../.PROPS.example | 1 + .../.SEQUENCES.example | 48 ++ .../.readme | 287 +++++++++++ .../index.omg | 20 + .../~ball/index.omg | 1 + .../~ball/~ball.lsl | 161 +++++++ .../~memory.lsl | 378 +++++++++++++++ .../~menu.lsl | 529 +++++++++++++++++++++ .../~menucfg.lsl | 296 ++++++++++++ .../~pos.lsl | 108 +++++ .../~pose.lsl | 222 +++++++++ .../~poser 1.lsl | 200 ++++++++ .../~poser 2.lsl | 200 ++++++++ .../~poser 3.lsl | 200 ++++++++ .../~poser 4.lsl | 200 ++++++++ .../~poser 5.lsl | 200 ++++++++ .../~poser.lsl | 200 ++++++++ .../~props.lsl | 397 ++++++++++++++++ .../~run.lsl | 194 ++++++++ media/Test%20sim/objects/test.lsl | 14 + 24 files changed, 4125 insertions(+) create mode 100644 media/Test%20sim/index.omg create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0.omg create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.MENUITEMS create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.POSITIONS create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.PROPS.example create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.SEQUENCES.example create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.readme create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/index.omg create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/index.omg create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/~ball.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~memory.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menu.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menucfg.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pos.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pose.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 1.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 2.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 3.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 4.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 5.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~props.lsl create mode 100644 media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~run.lsl create mode 100644 media/Test%20sim/objects/test.lsl (limited to 'media/Test%20sim') diff --git a/media/Test%20sim/index.omg b/media/Test%20sim/index.omg new file mode 100644 index 0000000..afb422a --- /dev/null +++ b/media/Test%20sim/index.omg @@ -0,0 +1,2 @@ +<125.432899,128.229706,3500.5> <0.5,5.,5.> <0.,270.,180.> objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/index.omg + diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0.omg b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0.omg new file mode 100644 index 0000000..5e2df27 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0.omg @@ -0,0 +1,32 @@ +Stuffs = +{ + UUID = '5cb927d5-1304-4f1a-9947-308251ef2df0', + name = "onefang's test bed", + description = 'Just a pretend bed with MLP scripts for testing SledjHamr.', + owner = '12345678-1234-4321-abcd-0123456789ab', + details = + { + Mesh = + { + fileName = 'cube.lua', + materials = {'normal_lego.png'}, + parts = + { + Mesh = + { + fileName = 'sonic.md2', +-- pos = {1.23, 4.56, 789.0}, +-- rot = { , , , ,}, + materials = {'sonic.png'}, + }, + Mesh = + { + fileName = 'earth.lua', +-- pos = {1.23, 4.56, 789.0}, +-- rot = { , , , ,}, + materials = {'EarthDiffuse.png'}, + }, + }, + }, + }, +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.MENUITEMS b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.MENUITEMS new file mode 100644 index 0000000..3ea96ee --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.MENUITEMS @@ -0,0 +1,211 @@ +POSE stand | stand | stand | stand //pose before starting and when stopping +POSE default | sit_ground | sit_ground | sit_ground //default pose when no animation entered + +MENUORDER // use new (sane) menu button order -- same as in files. Omit this for MLP compatibility. +// NORELOAD // inhibit reload on rez -- use for worn item, but "Menu Reset" if you make a copy! + + +MENU MAIN MENU | ALL +TOMENU Relax +TOMENU Hugs +TOMENU Dances +TOMENU Lick girl +TOMENU Lick boy +TOMENU Stand sex +TOMENU Girl on top +TOMENU Boy on top +TOMENU Side by side +TOMENU - // 10 (total) blank spaces for modular configs. Unused entries are automatically deleted. +STOP //remove poseballs +TOMENU Options >> // options menu + + +MENU Dances | ALL | BLUE | PINK +TOMENU Slow dances +BACK + + +MENU Slow dances | ALL | BLUE | PINK +SWAP +BACK + + +MENU Relax | ALL | BLUE | PINK +POSE pillow-sit | sit_ground | sit_ground +//POSE sit 1 | sitting chair f07 | sitting ground f08 +//POSE sit 2 | sitting ground f02 | sitting ground f03 +POSE sit2 | sit_ground | sit_ground +//POSE sit 3 | lovermale14 | lovefemale14 +//POSE sit 4 | lovefemale20b|flay6 +//POSE sit 5 | f_yabyum3 | sitting ground f05 +//POSE sit 6 | sitting ground f01 | sitting ground f04 +//POSE sit 7 | sitting couch f07 | sitting couch f06 +POSE standing | stand | stand +//SOUND ☊guitar | mood4aday +TOMENU Meditation +TOMENU 6-way +SWAP +BACK + + +MENU Meditation | ALL | BLUE | PINK +//POSE Birth | m2_birth | f2_birth +//POSE Birth 1 | m2_birth | f2_birth +//POSE Pray| praykneeing2 | praykneeing2 1 +//POSE Meditate | med f4 | med f4 1 +//POSE Meditate 1 | m_meditation | f_meditation +//POSE YabYum | R lovemale19d | R lovefemale19a +SWAP +BACK + + +MENU 6-way | ALL | BLUE | PINK | GREEN | RED | BLUE2 | PINK2 +POSE default | sit_ground | sit_ground | sit_ground | sit_ground +POSE 6way-1 | jP-sit-m-01-filt | jP-sit-f-03-filt | jP-sit-m-02-filt | jP-sit-f-04-filt | jP-sit-m-03-filt | jP-sit-f-05-filt +POSE 6way-2 | jP-sit-m-03-filt | jP-sit-f-05-filt | jP-sit-m-02-filt | jP-sit-f-04-filt | jP-sit-m-01-filt | jP-sit-f-03-filt +SWAP +BACK + + +MENU Hugs | ALL | BLUE | PINK +TOMENU Sit hugs +TOMENU Stand hugs +TOMENU Lay hugs +BACK + + +MENU Stand hugs | ALL | BLUE | PINK +POSE Big kiss | long-kiss-masculine | kiss +POSE Hug | HUG | HUG +//POSE Lovers 5 | lovermale5 | lovefemale5a +//POSE Lovers 14 | lovermale14 | lovefemale14 +//POSE Hug | hug-feminine | hug-masculine +//POSE Lovers 1 | lovermale1 | lovefemale1 +//POSE Lovers 2 | lovermale2 | lovefemale2 +SWAP +BACK + + +MENU Sit hugs | ALL | BLUE | PINK +//POSE Relax | flay6 | flay18 +//POSE Lovers 20 | lovermale20 | lovefemale20b +//POSE Lovers 23 | mslmale23a | mslfemale23b +//POSE Lovers 29 | mslmale29 | mslfemale29 +//POSE Lovers 3 | lovermale3b | lovefemale3b +//POSE Lovers 4 | lovermale4 | lovefemale4 +//POSE Lovers 7 | lovemale7e | lovefemale7 +//POSE Chat | sit on ground m retime 90 M pr2 | sit on ground F v2 retime 90 F +//POSE Kiss | Ground_Kiss_M | Ground_Kiss_F +POSE Cradle her | cpose10 v5 M | cpose10 v6 F +SWAP +BACK + + +MENU Lay hugs | ALL | BLUE | PINK +//POSE Embrace | Laying_Arm_Across_M | Laying_Arm_Across_F +//POSE Gaze | LS 2 static M | LS 2 static F +//POSE Lay | laying_arm_across_f | laying_arm_across_m +//POSE Lay kiss | Laying_Pinned_Kiss_M | Laying_Pinned_Kiss_F +//POSE Lay on side | cpose3v4 m | cpose3v4 f +//POSE Lovers 1a | csmale1 | csfemale1a +POSE Make out | laying_makeout_m | laying_makeout_f +//POSE Neck | Laying_Neck_Kiss_M | Laying_Neck_Kiss_F +POSE Pinned | laying_pinned_m | laying_pinned_f +//POSE Prop | Laying_Propped_Arm_M | Laying_Propped_Arm_F +//POSE Reflect | couchfidget 1 | couchlay2 f2 +//POSE Rest | lusirestkr5 | massage receiver +//POSE Side | Laying_Side_M | Laying_Side_F +//POSE Spoon | Laying_Spoon_M | Laying_Spoon_F +POSE Snuggle him | couple pose 7 v4 M | couple pose 7 v4 F +SWAP +BACK + + + +MENU Lick girl | ALL | BLUE | PINK +//POSE 69 | 69_M | 69_F +//POSE Lick me | ASK_k_43_M_(BA_bundle) | ASK_k_43_F_(BA_bundle) +POSE Taste | rimm | rimf +POSE Lick her | 1licker | 1lickeee +SWAP +BACK + + +MENU Lick boy | ALL | BLUE | PINK +//POSE 69 | 69_M | 69_F +//POSE BlowJob 1 | BJ_M | BJ_F +SWAP +BACK + + +MENU Boy on top | ALL | BLUE | PINK +//POSE Behind | Chair_M | Chair_F +POSE Deckchair | Deckchair position-m | Deckchair position-f +POSE Eagle | Spread Eagle-m | Spread Eagle-f +//POSE Missionary | Missionary_M | Missionary_F +//POSE So hard! | Kaly_Kam58 M_3_ADV | Kaly_Kam58 F_1_ADV +SWAP +BACK + + +MENU Girl on top | ALL | BLUE | PINK +POSE Butterfly | Butterfly position-m | Butterfly position-f +//POSE Cowgirl | Rub_M | Lay_F +POSE Cowgirl 2 | Cowgirl-m | Cowgirl-f +//POSE Ride 1 | Ride_M | Ride_F +//POSE Ride 2 | RideB_M | RideB_F +//POSE Ride 3 | Ground_M | Ground_F +//POSE Ride me 1 | ASK_k_43bis_M_(BA_bundle) | ASK_k_43_F_(BA_bundle) +SWAP +BACK + + +MENU Side by side | ALL | BLUE | PINK +POSE Side Entry | Side Entry Missionary-m | Side Entry Missionary-f +POSE Spoon 2 | Spoons Position-m | Spoons Position-f +SWAP +BACK + + +MENU Stand sex | ALL | BLUE | PINK +//POSE Doggy 1| Doggy_M | Doggy_F +POSE Doggy Style | Doggy Style-m | Doggy Style-f +POSE Leapfrog | Leapfrog Position-m | Leapfrog Position-f +//POSE Lifted | Table_M | Table_F +//POSE Post 1 | Wall_M | Wall_F +//POSE Post 2 | Wall2_M | Wall2_F +POSE Standing Assfuck | Take from behind standing-m | Take from behind standing-f +SWAP +BACK + + + +MENU Options >> | OWNER //this menu can be accessed by the OWNER only (other options: GROUP / ALL) +SHOW Show +HIDE Hide +ADJUST Adjust Pos //changes poseballs into transparant beams easy to select for moving +Z+1 //adjust Z = height offset in cm - use any integer to set the step size +Z+10 +SAVE Save Pos //saves the poseball positions of the currently selected pose into memory +Z-1 //adjust Z = height offset (so you don't have to adjust the positions of +Z-10 // each individual pose for different bodies/places) +DUMP Dump Pos //lists all positions stored in memory, copy/paste into .POSITIONS for backup +TOMENU ShutDown >> +BACK +LINKMSG Save Prop | 0,-4,1,SAVEPROP // save position/rotation for a prop +LINKMSG Dump Props | 0,-4,1,DUMPPROPS // dump all prop configs +REDO Redo Menu | ON +CHAT Chat Info | ON //switches chat info ON/OFF +INVISIBLE Invisible //make the main object invisible/visible (usefull if it's worn) +BALLUSERS Ball Users | ALL //switches who can sit on the poseballs (ALL/GROUP) +MENUUSERS Menu Users | ALL //switches who access main menu (ALL/GROUP/OWNER) +BACK + + +MENU ShutDown >> | OWNER +RELOAD Pos Reset // use after changing *.POSITIONS* or *.PROPS* files +CHECK ConfigCheck // check config consistency. NOTE: does a Pos Reset when done! +RESET Menu Reset // use after changing *.MENUITEMS* files +RESTART Restart +OFF ShutDown +BACK diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.POSITIONS b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.POSITIONS new file mode 100644 index 0000000..0d55a63 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.POSITIONS @@ -0,0 +1,24 @@ +[10:01] : {default} <-.7,.7,0.> <-90.,0.,-180.> <.7,.7,0.> <-90.,0.,-45.> <0.,.7,.7> <-90.,0.,-90.> <0.,.7,-.7> <-90.,0.,90.> <.7,.7,-.7> <-90.,0.,45.> <-.7,.7,.7> <-90.,0.,-135.> +[10:01] : {stand} <-.7,.7,0.> <-90.,0.,-180.> <.7,.7,0.> <-90.,0.,-45.> <0.,.7,.7> <-90.,0.,-90.> <0.,.7,-.7> <-90.,0.,90.> <.7,.7,-.7> <-90.,0.,45.> <-.7,.7,.7> <-90.,0.,-135.> +[10:01] : {sit2} <-0.355,0.660,-0.584> <-97.0,0.0,-90.0> <0.508,0.700,-0.579> <-95.5,0.0,90.0> +[10:01] : {pillow-sit} <-0.355,0.660,-0.584> <-97.0,0.0,-90.0> <0.508,0.700,-0.579> <-95.5,0.0,90.0> +[10:01] : {standing} <-0.700,1.009,0.000> <-90.0,0.0,0.0> <0.700,1.009,0.000> <-90.0,0.0,-180.0> +[10:01] : {6way-1} <-0.700,0.700,0.000> <-90.0,0.0,90.0> <0.700,0.700,0.000> <-90.0,0.0,90.0> <-1.111,0.675,0.000> <-90.0,0.0,90.0> <0.000,0.696,0.000> <-90.0,0.0,90.0> <1.058,0.665,0.000> <-90.0,0.0,90.0> <1.305,0.658,0.000> <-90.0,0.0,90.0> +[10:01] : {6way-2} <-0.700,0.700,0.000> <-90.0,0.0,-180.0> <0.700,0.700,0.000> <-90.0,0.0,-45.0> <0.000,0.700,0.700> <-90.0,0.0,-90.0> <0.000,0.700,-0.700> <-90.0,0.0,90.0> <0.698,0.699,-0.675> <-90.0,0.0,45.0> <-0.701,0.699,0.702> <-90.0,0.0,-135.0> +[10:01] : {Butterfly} <0.081,0.086,0.065> <178.0,0.0,0.0> <-0.096,0.064,0.203> <178.0,0.0,0.0> +[10:01] : {Cowgirl 2} <0.372,0.037,0.078> <2.6,-89.0,0.3> <0.163,0.041,0.180> <2.6,-89.0,0.3> +[10:01] : {Deckchair} <0.085,-0.015,0.292> <0.0,-89.0,-0.7> <0.305,-0.005,0.272> <-180.0,-89.0,-179.3> +[10:01] : {Doggy Style} <-0.204,0.021,0.607> <0.9,-87.0,0.9> <-0.11,0.005,0.379> <0.0,-87.0,0.0> +[10:01] : {Eagle} <0.118,-0.051,0.475> <180.0,-85.0,-179.3> <0.375,-0.083,0.414> <180.0,-88.0,-179.3> +[10:01] : {Leapfrog} <-0.203,-0.002,0.437> <0.0,-90.0,0.0> <-0.08,-0.014,0.241> <0.0,-90.0,0.0> +[10:01] : {Side Entry} <-0.173,0.081,0.511> <0.0,-85.0,0.7> <-0.108,0.238,0.546> <84.9,-13.9,89.5> +[10:01] : {Spoon 2} <0.241,0.247,0.337> <180.0,-84.4,-179.3> <0.195,0.453,0.368> <-144.7,-83.1,-143.8> +[10:01] : {Standing Assfuck} <-0.814,0.163,0.258> <-179.0,-76.0,0.0> <-0.741,0.174,0.012> <-179.0,-73.0,0.0> +[10:01] : {Big kiss} <-0.656,-0.058,0.029> <0.0,-86.6,0.0> <-0.829,0.047,0.452> <19.7,-82.9,-170.5> +[10:01] : {Make out} <-0.638,0.003,0.39> <73.6,-87.9,78.5> <-0.565,-0.841,0.205> <-65.1,-88.4,-65.5> +[10:01] : {Taste} <-0.679,0.012,0.201> <147.9,-87.4,147.6> <-1.004,-0.035,-0.542> <159.5,-82.6,-18.2> +[10:01] : {Lick her} <-0.599,-0.02,0.812> <-123.7,-86.4,146.4> <-0.46,-0.032,-0.16> <-179.8,-86.4,-78.7> +[10:01] : {Cradle her} <-0.273,0.009,0.000> <0.0,-88.0,0.0> <-0.405,0.046,0.098> <0.0,-86.0,0.0> +[10:01] : {Snuggle him} <-0.205,-0.246,0.091> <-84.2,-87.6,-87.7> <-0.27,-0.063,-0.034> <-93.6,-87.6,176.3> +[10:01] : {Pinned} <-0.664,-0.008,0.098> <-90.7,-86.9,-91.6> <-0.816,-0.739,-0.052> <-171.0,-78.5,-169.2> +[10:01] : {Hug} <-0.859,-0.078,-0.082> <-173.9,-82.9,-170.9> <-0.471,0.000,0.272> <53.9,-88.3,-129.1> \ No newline at end of file diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.PROPS.example b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.PROPS.example new file mode 100644 index 0000000..e76c9bf --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.PROPS.example @@ -0,0 +1 @@ +| pillow-sit | pillow | <0.000,0.266,-0.656>/<0.000,-90.000,15.981> \ No newline at end of file diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.SEQUENCES.example b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.SEQUENCES.example new file mode 100644 index 0000000..fcc1318 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.SEQUENCES.example @@ -0,0 +1,48 @@ +/ Sequence config for MLPV2.3 +/ lines beginning with slash are comments + +/ Global commands (these are commented out) +/ Use any number of these by deleting the slash at the beginning +/ debug | 1 | sequence start/stop +/ debug | 2 | echo each command as executed +/ debug | 4 | avatar hop on/off +/ debug | -1 | all debugging + +/ Sequence Commands: +/ ======= +/ SEQUENCE | seqence-name +/ MENU | menu-name | set number & colors of balls +/ POSE | pose-name | chat-chan | chat-message | start a pose (chan & message are optional; message is whispered). +/ AVWAIT | 0 1 2 3 | chat-message-if-waiting | pause the sequence until the balls listed are sat on (0 1 2 3 in this example) +/ SAY | chat-chan | chat-message | say the given text on the given chat chan +/ WHISPER | chat-chan | chat-message | whisper the given text on the given chat chan +/ WAIT | wait-seconds | pause before executing next command +/ LABEL | label-name | set a target for GOTO +/ GOTO | label-name | go to a label, to loop the bottom of a sequence +/ REPEAT | repeat the whole sequence + +/ Chat-messages can include the first names of participants using /0 for avatar on first ball, /1 for av on 2nd ball, etc. +/ (See the names of the ball objects.) + +SEQUENCE | Tour1 +MENU | Example... +POSE | standing +AVWAIT | 0 | Waiting for someone to sit on blue ball +WHISPER | 0 | /0 and /1 stand together +WAIT | 10 +POSE | pillow-sit | 0 | /0 and /1 sit with a comfy pillow +WAIT | 10 +POSE | sit2 | 0 | The pillow disappears +WAIT | 10 +REPEAT + +SEQUENCE | tour2 +MENU | Example... +POSE | standing | 0 | The two of you stand +WAIT | 10 +LABEL | here +POSE | pillow-sit | 0 | /0 and /1 sit with a pillow +WAIT | 10 +POSE | sit2 | 0 | Where did the pillow go? +WAIT | 10 +GOTO | here diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.readme b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.readme new file mode 100644 index 0000000..182545b --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/.readme @@ -0,0 +1,287 @@ +MLPV2 Version 2.3, by Learjeff Innis, based on +MLP - MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) + +OpenSim port by Jez Ember. This should be fully functional, and works around various scope changes and bugs in OS LSL. Don't take this back to SL - pick up the regular release there. + +The BSD Licence allows anybody to use the source code, in any manner they wish, providing that they provide the copyright notice above on further distributions. +So it's totally free, however if you like it, I would be very happy if you donate any L$. If you're using significant parts of this code in commercial products, I would appreciate if you donate me at least L$1 for each sold product (preferably more :). And it's nice if you could send me a copy of each commercial product, incl. updates (as I do get a lot of questions from buyers of commercial products made with the MLP, also please indicate who to contact, not me :) +I won't give support, however I'll make an exception for end-users that donated L$1000 or more (for commercial support, custom versions, contact me, however my time is limited). +To donate, go to my profile (Search - People - Miffy Fluffy) and use the "Pay..." button, thanks! +You can also find the link to the latest version here. + +Please feel free to donate to Learjeff Innis for the MLPV2 enhancements. My thanks to Miffy Fluffy for the original! Find MLPV2 scripts for L$1 at http://XStreetSL.com . + +FEATURES: +- Put all your poseball animations into one object (50 pairs or even more should be no problem). +- Create submenus for each category of poses, for instance: "Solo, Boy-Girl, Girl-Girl, Dance, 3some, 4some" +- Shows 1, 2, 3, or 4 poseballs depending on the submenu you select +- Positions can be adjusted and saved into memory (backup is easy: select Memory Dump and copy-paste into notecard) +- Portable, can be worn and used everywhere +- Option to adjust height offset (Z) of all poses at once (for different persons/locations). +- 15 poseball colors: + PINK, BLUE, PINK2, BLUE2, GREEN, MAGENTA, RED, ORANGE, WHITE, BLACK, YELLOW, CYAN, RED2, TEAL, GREEN2 + +OPERATION: +- Click the MLP object to switch it on +- When everything has loaded click again for the menu +- Select a submenu containing poses, and select a pose. Poseballs will appear. +- Sit on your poseball (Right-click - LOVE) +- Accept the popup asking permission to animate your avatar. (Might be behind the MLP menu, click ">>>" to see.) +- To disable expressions, use Page Down key. To re-enable them, use Page Up. This only affects you and not people on other poseballs. Expressions are re-enabled by default when anyone else sits on the poseball. +- To remove the balls, select 'STOP'. + + +TO ADJUST POSITIONS: +You can adjust the poses to fit your own avatar and those you share MLP with. +- Select a pose you want to adjust and sit on the balls. +- Go back to the main menu, select "Options - Adjust Pos". This changes the balls into transparant beams. +- Right-click a beam, select Edit and adjust the position (Shift-click to select more than one). +- Position the balls anywhere within 10m from the MLP object. +- "Save Pos" stores the position into memory. +- Important! Back it up; see below. + +TO MAKE A BACKUP: +Saved positions are stored in memory but are not permanent. They are lost on script error (See "Script run-time error / Stack-Heap Collision" below). They are also lost on shutdown/startup, or "Pos Reset". To back the positions up more permanently you have to copy them into the .POSITIONS notecard: +- Select "Mem Dump" +- Copy the complete dump (from Chat-History) +- Paste it into the .POSITIONS notecard (just replace everything, you don't need to edit/format anything). +- Delete any other *.POSITIONS* files. + +Note: After changing any *.POSITIONS* files, use the "Pos Reset" command to verify your changes, if desired. This also helps to avoid losing changes due to Stac-Heap collisions. + +TO ADJUST HEIGHT OFFSET (Z): +Select "Height Adj" and click the "Z"-buttons, this will adjust the height for all poses. +Note: the offset height is stored in the Object Description, so any descriptions will be replaced. + +TO ADD POSES: +Copy all animations into the MLP object (if you want to use existing poseballs, open them to rip their animations). Note: you can use any object as MLP, just copy the MLP contents in the object of your choice. +Open the .MENUITEMS and add the animations: +POSE name | animation1 | animation2 ... +The changes will become active after MLP is (re)started. Use the "Menu Reset" command after changing *.MENUITEMS* files. + +To give an expression to an animation, add one of the following suffixes to the anim name in the POSE line. + (Just add it to the POSE config line, don't change the anim name.) + + Suffix / expression + * open mouth + ::1 open mouth + ::2 surprise + ::3 tongue out + ::4 smile + ::5 toothsmile + ::6 wink + ::7 cry + ::8 kiss + ::9 laugh + ::10 disdain + ::11 repulsed + ::12 anger + ::13 bored + ::14 sad + ::15 embarrassed + ::16 frown + ::17 shrug + ::18 afraid + ::19 worry + ::20 sleeping (combination of disdain and smile, closest I could find) + +To make the expression happen periodically rather than constantly, add another extension and the period (in seconds). + +For example, to use MyAnim with open mouth every 5.5 seconds: + + POSE Mypose | MyAnim::1::5.5 + +TO ADD SOUNDS (buttons to play sounds), in a menu (just like a POSE button), add a line like this: + + SOUND She moans | female-moan + +where "She moans" will be the button label, and "female-moan" is the animation to play, which must be in object inventory. +For sounds in menus with poses (rather than in a menu specifically for sounds) I recommend you begin the pose name with "☊" (which looks a bit like headphones, the best I could find for the purpose). This serves as a clue to the user that the button plays a sound. + +TO CREATE ANIMATION SETS (menus) +Create .MENUITEMS.xxx and .POSITIONS.xxx files (where xxx is whatever you want) and put the corresponding menu configs and poses in them. This way you can deliver a bed with folders of add-on menus so the customer can choose what types of anims they want to add to the menu. Note that you get at most 12 top menu choices. The scripts read the .POSITIONS files in alphabetical order (and .POSITIONS must be first). The menus are assembled in the usual SL ass-backwards-by-three manner. + +This also allows you to sell furniture with "enhancement packs", which are simply collections of .MENUITEMS.xxx, .POSITIONS.xxx, and the associated animations for the customer to drop into the furniture. Customers can easily select furniture appearance and pose bundles independently! + +Note for those who are adding animation sets to MLP V1.2 configurations: For this feature to work, there must be "TOMENU -" entries in the main menu. These are very easy to add to an existing configuration, just delete all "TOMENU" lines in the main menu and replace them with "TOMENU -" lines. Also, add a "MENUORDER" to the .MENUITEMS file. Now, all MENU configs that don't have a corresponding "TOMENU" entry will be put in the main menu, replacing a blank one. Unused blank ones are deleted automatically. See the .MENUITEMS file from the MLPV2 release for more info. + +ACCESS TO THE MAIN MENU: +The owner is the only one who can start/restart/shutdown, in all cases. +- if "Options - MenuUser" is set to OWNER: the owner is the only one who can access the menus +- if "Options - MenuUser" is set to ALL: anyone can access the MAIN MENU +- if "Options - MenuUser" is set to GROUP: members of the same Group as the MLP object can access the MAIN MENU (the MLP Group can set by right-clicking MLP and selecting Edit, More >> General tab - Group: Set) +Note: even if "MenuUser" is set to ALL or GROUP, individual SUBMENUS can still be blocked (you can define access for each submenu in .MENUITEMS, see examples in .MENUITEMS). + +POSEBALL ACCESS: +- if "Options - BallUsers" is set to ALL: anyone can sit on the ball +- if "Options - BallUsers" is set to GROUP: only groupmembers can sit on a poseball. The balls will check if the person who tries to sit on the ball belongs to the same Group as the ~ball object (to set the Group of the ball, take a new copy of the MLP with your preferred Group set active on you. You could also take the ~ball out of the MLP, into the world, right-click, Edit, More >> General tab - Group: Set, thereafter take the edited ~ball into your Inventory (note: do this within a minute or so, because balls commit suicide after a while when taken into the world), delete the old ~ball in the MLP, and drag the new ~ball from your Inventory to the MLP). + +PORTABLE USE: +Attach the object to the HUD, you can use it's default shape and color for clickable bar on one of the edges of your screen (to move HUD position: Right-click - Edit), you can edit color/transparancy/size/position. +Adjust the height offset (Z). Note: the balls will appear relative to the initial MLP position (to reset where the balls appear, press STOP to remove the balls. and reselect a submenu to rez them again). + +================================================ + +FAQ for END USERS: +- Why do I hover, sitting, after sitting on a poseball? +Be sure to answer "Yes" to the popup that asks permission to animate your avatar. This is often buried under the MLP main menu, so click the ">>>" to cycle through menus. This is SL behavior and there's no way to fix it, other than turning "remenu" off. + +- Will my animations be lost if I lose a poseball? +No. The animations are not placed the balls, they remain in the main MLP object. Don't worry about the poseballs, they are copies of the one in the MLP object. A balls will commit suicide if left behind somewhere (the MLP object needs to be within 20m). + +- Sometimes notecards or scripts won't open for editing, why? +If the MLP contains many animations, access to it's contents can be slow, try again after a few seconds. + +- "Script run-time error / Stack-Heap Collision"? +Right-click/Edit the object, and use SL menu: "Tools -> Reset Scripts in Selection" to reset. +Any saved positions that were not backed up in .POSITIONS files are lost, so if your furniture has lots of poses (over 50) and you save positions, be sure to back up regularly. Use OPTIONS -> Pos Reset after changing .POSITIONS* files. + +FAQ for those who edit *.MENUITEMS files: + +- "Script run-time error / Stack-Heap Collision"? +After a restart, this is a clue that there are too many items in *.MENUITEMS* or *.POSITIONS* files. Trim the menu, or pray for Mono to arrive soon. + +- My new menu appears on the main page, rather than as a submenu where I configured it. Why? +Most likely, you named it differently in the MENU line versus the TOMENU line. When MPL sees a MENU line, it looks for the same name in a TOMENU line. If it doesn't find it, it replaces any "TOMENU -" entries it finds, generally on the main menu. + + +================================================ +2.3l: fixed prim/script ownership, fixed ball listening on old channels, fixed prop jumping when saved twice +2.3k: fixed startup race condition (stopping before reading MENUITEMS), fixed sequence labels not found +2.3j: height menu bug fix (probably broken since 2.3's reorient menu added) +2.3i: bug fix (remenu broken in 2.3h) +2.3h: sequences: rez balls on sequence start +2.3g: reset fixes: +- kill balls on reset in ~menu startup +- don't say "click to start" until ready, in ~run +================================================ + +CHANGES in MLPV2 Version 2.3: + +- Supports sounds + +- Supports up to 6 avatars (poseballs) + +- Sequences (tours) -- set up a menu button that plays a sequence of poses and chats. You configure the sequences in a new .SEQUENCE type of notecard. More info on that here: + + ? + +- When rezzed, balls are now named ~ball0 .. ~ball5, to support easy sitting for bot clients (used for machinima, not camping!) The object name in inventory has not changed. + +- "Adjust Pos" is now a toggle. Try it and see! Avs can hop on and off and balls return to the 'adjusting' shape. You can also use STOP to return to normal mode. + +- EZ-Adust! Now, when you're in adjust mode and you change poses, it saves the current pose before swithcing to new pose. To abandon changes, quit adjust mode, STOP, or just re-select the current pose. + +- Tools pack: + - "Reorient" menu for more easily adapting an existing pose set to a new furniture item + - script to check anim permissions + - script to check for unused animations + - Three different example xcite adaptor scripts (requires Xcite! Partner script from Xcite) + - AutoZhao adaptor script + - touch passer moved here, since it's never required in the MLP prim + +================================================ + +CHANGES in MLPV2 Version 2.2 (unreleased other than to MLPV2 group) + +- Added LMs when avs sit or unsit, to make it possible to add support for things like xcite and cuffs without modifying MLP scripts. Read more here: + + ? + +- Cleaner chat on DUMP (omits object name) + +================================================ + +CHANGES in MLPV2 Version 2.1: + +- Props! Rez an object per pose. Object is deleted when changing to new pose, or after 3 minutes if bed is deleted. + +- 15 ball colors supported! + +- AUTOBACK - automatically inserts BACK before MORE--> button (optional, off by default) + +- Bug fix for AUTOMORE on main menus with too many buttons. AUTOMORE no longer supported for main menu. Might be fixed some day. + +- Bug fix for AUTOMORE menues with more than one extra page. + +- Expression control code removed -- didn't work out. MLPV2 no longer takes controls. + +Of course, still compatible with all MLP and MLPV2.0 scripts. + +================================================ + +CHANGES in MLPV2, Version 2.0: + +- Now supports Solo, 3some, and 4some menus. + +- Memory optimized: now holds over 70 couples poses. + +- Expressions supported (20 expressions, constant or periodic). See "TO ADD POSES" above. + +- Extended menus. (Automatic "More-->" button for menus with more than 12 buttons.) + +- Menu buttons now appear in menus in the same order as in the configuration + (but only if the new MENUORDER config item appears -- otherwise order is same as before, for backwards compatibility). + +- Modular configuration: reads all *.MENUITEMS* and *.POSITIONS* files, in sort order (same as in object contents). + MENU config lines with no corresponding TOMENU lines get added to the main menu (replacing a blank "TOMENU -" line). + This allows makers to easily provide add-on packs, each being folder containing .MENUITEMS*, .POSITIONS*, and animations files. + Customer simply drops the folder in and resets. + +- Backwards-compatible with MLP V1.2 configurations. + +- Ball timeouts have been disabled. This should make MLPV2 a little more efficient. + However, if you move a bed with balls rezzed, you'll need to delete the balls manually. + +- Set poseball's floating text and pie menu sit text by changing its description. + Also, if the ball's description begins with an asterisk ("*"), the poseball is phantom. + After changing ball's description, STOP to delete any balls and then select any pose. + +- New LM button type, to pass LMs to other scripts/prims. + This allows adding features to furniture, with buttons in the MLP menus, without changing any MLP scripts. + +- Warning for duplicate entries in .POSITIONS* files. + +- Configuration consistency checker: try "ConfigCheck" in Shutdown menu + NOTE: this will reload .POSITIONS.* files, so backup any saved positions first! + It will find buttons with no positions and vice versa. + +- AutoZhao support + +- Restart menu reorganized: + Use "Pos Reset" button after changing *.POSITIONS* files. + Use "Menu Reset" button after changing *.MENUITEMS* files. + Use "Restart" button to restart all. This used to do only a menu reset. + +- MLP bug fix: if you rez a copy, it uses the same channel as the original, and on MLP V1.2 you'd get crosstalk. + The menu script is now reset on rez. This does not reset positions; saved positions are not lost. + +- MLP bug fix: Avoid reanimating a non-sitting avatar! This happened in these cases that I'm aware of: + A) Avatar is posed and STOP button is hit and then a new pose is selected. The avatar (no longer sitting) would get animated. + B) Same as above, but instead of STOP button, avatar teleports or relogs + + + +CHANGES IN MLP V1.2: +- now checks if the balls are rezzed, it will rez new balls after a ball has disappeared unexpectedly for some reason (after a few minutes) +- ownership change is detected (thanks to Kokoro Fasching) +- added STAND button (now different from STOP button), to avoid confusion. STAND will always set the default stand pose. STOP will always remove the balls. +- added GROUP access option to MAIN MENU, in the Options menu - 'MenuUser' you can select between OWNER/GROUP/ALL (previous users need to adjust their .MENUITEMS notecard, USERS has become MENUUSERS with the new options). +- added GROUP access option for each individual SUBMENU, in .MENUITEMS you can define the access restriction for each submenu: OWNER/GROUP/ALL. +- added GROUP access option for the poseballs, In the Options menu - 'BallUsers' you can select between GROUP/ALL. +- If you select the menu while it has been used by someone else within the last minute, you're asked if you want to continue. (In previous versions the owner did get a chat message if any user operated the menu, this has been removed. To add this feature again: uncomment line #51 in ~menu.) +- note: menu's and poses can not have the same name anymore, users of previous versions should change the name of the 'Shut Down' button to something else (f.i: ShutDown!) if they also have a menu with the same name. + +CHANGES IN MLP V1.11: +- fixed a mistake I made which caused the balls to dissappear within 60 seconds. + +CHANGES IN MLP V1.1: +- adjusted sit height on the balls, so the balls will remain visible with most objects +- altough not really necessary, I've added the possibility to SHOW/HIDE the balls via the menu (you can add a SHOW and/or HIDE button somewhere in the .MENUITEMS notecard) +- improved menuacces: selections from previous menudialogs will be disregarded (avoids problems with multiple users too) +- reduced load: no timers are running anymore when no balls are rezzed + + +Please report any bugs, or improvements in efficiency without losing readability of the code (In many instances I've chosen readabilty over speed or size because I think it's reasonable to expect that the compiler will improve in the future). If you want to read the code start reading the comments in ~run for an overview. The source code used in ~menu is partly based on the Menu Engine by Zonax Delorean (BSD License), thanks. I included some free poses as examples, thanks to their makers. Thanks to Purrcat Miranda for testing with me :) Thanks to other creative people in SL too, and thanks for any donations. Have fun! + +MLP - MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) \ No newline at end of file diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/index.omg b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/index.omg new file mode 100644 index 0000000..a2dcaad --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/index.omg @@ -0,0 +1,20 @@ +nc .MENUITEMS +nc .POSITIONS +nc .PROPS.example +nc .SEQUENCES.example +nc .readme +obj ~ball +lsl 344fe8d3-97c9-4fec-ab70-a121266a6539 ~memory +lsl 025b80de-b8de-4571-b699-190bf906c134 ~menucfg +lsl a22de921-3ccd-4005-9ecc-ef8bb1201b7c ~menu +lsl 41e4b1ad-3153-4d8a-8c0a-42bb79345dce ~pose +lsl 04dae926-3663-477d-bcac-ff38ef3fd34d ~poser 1 +lsl 0813b7fb-0641-4831-9531-654da1361ae5 ~poser 2 +lsl 2fc4e9bb-087f-4e1a-b019-fce70d715151 ~poser 3 +lsl a7fa563e-b699-48e2-b27f-7cd3737e5702 ~poser 4 +lsl a3bb1355-bdbb-4c25-8907-437add217f14 ~poser 5 +lsl 3b0abc52-f892-4846-97ae-c4e7b159c644 ~poser +lsl 9e03bb0c-c48e-4855-8e33-91519bed560e ~pos +lsl 1a06486b-9e63-4a4c-ad65-7572cda834bd ~props +lsl c2119303-2a2d-4685-b9e6-6a07797225f4 ~run + diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/index.omg b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/index.omg new file mode 100644 index 0000000..ea9d81b --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/index.omg @@ -0,0 +1 @@ +lsl 0cfaeafe-ac53-4575-af89-0b79a39522d2 ~ball diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/~ball.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/~ball.lsl new file mode 100644 index 0000000..ff5cca3 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~ball/~ball.lsl @@ -0,0 +1,161 @@ +// MLPV2 Version 2.3 by Learjeff Innis. Based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +// To make ball phantom, put "*" as the first character in the ball's description +// (The ball in MLP object's inventory should be non-phantom.) +// The rest of the description, if any, is used for the sit pie menu and floating text. +// To make this take effect, use STOP to unrez the balls, and then select any pose. + +integer Chan; +integer Group; +integer visible = TRUE; +integer Adjusting; +key Avatar; +string Name; +integer Handle; + +// 15 color support, thanks to Liz Silverstein +// Color is passed as a string by object chat (from menu via poser*) + +list colors = [ <0.0,0.0,0.0>, // 0 = HIDE + <0.835,0.345,0.482>, // 1 = PINK + <0.353,0.518,0.827>, // 2 = BLUE + <0.635,0.145,0.282>, // 3 = PINK2 - Dark pink + <0.153,0.318,0.627>, // 4 = BLUE2 - Dark blue + <0.128,0.500,0.128>, // 5 = GREEN + <1.000,0.000,1.000>, // 6 = MAGENTA + <1.000,0.000,0.000>, // 7 = RED + <1.000,0.500,0.000>, // 8 = ORANGE + <1.000,1.000,1.000>, // 9 = WHITE + <0.0,0.0,0.0>, // 10 = BLACK + <1.0,1.0,0.0>, // 11 = YELLOW + <0.0,0.8,0.8>, // 12 = CYAN + <0.5,0.0,0.0>, // 13 = RED2 + <0.0,0.5,0.5>, // 14 = TEAL + <0.0,0.25,0.25>]; // 15 = GREEN2 + + +render() { + if (!visible || (Avatar != NULL_KEY && !Adjusting)) { + // hidden + llSetScale(<0.01,0.01,0.01>); + llSetAlpha(0.0, ALL_SIDES); + llSetText("",<1.0,1.0,1.0>,1.0); + } else if (Avatar != NULL_KEY && Adjusting) { + // sitting and adjusting + llSetAlpha(0.2,ALL_SIDES); + llSetText("Adjust",<1.0,1.0,1.0>,1.0); + llSetScale(<0.1,0.1,5.0>); + } else { + // shown + llSetAlpha(1.0, ALL_SIDES); + llSetScale(<0.2,0.2,0.2>); + if (Adjusting) { + llSetText("Adjust",<1.0,1.0,1.0>,1.0); + } else { + llSetText(Name,<1.0,1.0,1.0>,1.0); + } + } +} + +show() { + visible = TRUE; + render(); +} + +hide() { + visible = FALSE; + render(); +} + +default { + on_rez(integer channel) { + Name = llGetObjectDesc(); + if (Name == "" || Name == "(No Description)") { + Name = "LOVE"; + } else { + if (llSubStringIndex(Name, "*") == 0) { + llSetPrimitiveParams([PRIM_PHANTOM, TRUE]); + Name = llGetSubString(Name, 1, -1); + } + if (Name == "none") { + Name = ""; + } + } + llSitTarget(<0.0,0.0,-0.1>,ZERO_ROTATION); + if (Name != "") { + llSetSitText(Name); + } + Avatar = NULL_KEY; + Chan = channel; + Group = 0; + + if (Chan != 0) { + // register listen and start timer, unless ball was dragged from inv + llListenRemove(Handle); + Handle = llListen(Chan,"",NULL_KEY,""); + llSetTimerEvent(600.0); + } + } + + changed(integer change) { + if (change != CHANGED_LINK) return; + Avatar = llAvatarOnSitTarget(); + if (Group) { + if (Avatar != NULL_KEY && !llSameGroup(Avatar)) { + llUnSit(Avatar); + llWhisper(0,"no permission to use poseball"); + return; + } + } + llSay(Chan+8,(string)Avatar); //requests perm, sets animation + render(); + // if (visible & Avatar == NULL_KEY) show(); else hide(); + } + + listen(integer channel, string name, key object, string str) { + integer ix; + ix = llSubStringIndex(str,">"); + if (ix != -1) { + llSetRot((rotation)llGetSubString(str,ix+1,-1)); + llSetPos((vector)llGetSubString(str,0,ix)); + } else if (str == "0") { //HIDE + hide(); + } else if (str == "SHOW") { //SHOW + show(); + } else if (str == "ADJUST|1") { + Adjusting = TRUE; + render(); + } else if (str == "ADJUST|0") { + Adjusting = FALSE; + render(); + } else if (str == "SAVE") { + llSay(Chan+16,(string)llGetPos()+(string)llGetRot()); + } else if (str == "GROUP") { + Group = 1; + } else if (str == "ALL") { + Group = 0; + } else if (str == "DIE") { + llSay(Chan+8, (string)NULL_KEY); //msg to poser (don't reanimate after STOP) + llDie(); + } else if (str == "LIVE") { + llSetTimerEvent(600.0); + } else { + list ldata = llParseString2List(str, ["|"], []); + integer colorIx = (integer) llList2String(ldata,0); + string ballIx = llList2String(ldata,1); + Adjusting = (integer) llList2String(ldata,2); + if ((colorIx > 0) && (colorIx < 16)) { // this must be a color setting + llSetColor(llList2Vector(colors, colorIx),ALL_SIDES); //pull the color out of the list + render(); + llSetObjectName("~ball" + ballIx); + } + } + } + + timer() { //not heard "LIVE" from menu for a while: suicide + llDie(); + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~memory.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~memory.lsl new file mode 100644 index 0000000..17f777d --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~memory.lsl @@ -0,0 +1,378 @@ +//MPLV2 Version 2.2 by Learjeff Innis, based on +//MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +// v2.2 - rotate all poses, cleaner dump + +integer Checking = FALSE; // whether doing consistency check + +integer line; +integer PosCount; +list Poses; // list of pose names + +// indexed by same index as Poses, entry contains text string of pos/rot pairs, one for each ball in pose + +// list Positions; + +list Positions0; +list Positions1; +list Positions2; +list Positions3; + +vector Pos1; +vector Pos2; +vector Pos3; +vector Pos4; +vector Pos5; +vector Pos6; +vector Rot1; +vector Rot2; +vector Rot3; +vector Rot4; +vector Rot5; +vector Rot6; +integer Ballcount; + +// Replacement for llListFindList which is currently broken in OSLSL +integer myListFind(list a, string b) { + integer x; + integer l=llGetListLength(a); + + for(x=0; x>2); + } else if ((ix & 3) == 1) { + return llList2String(Positions1, ix>>2); + } else if ((ix & 3) == 2) { + return llList2String(Positions2, ix>>2); + } + return llList2String(Positions3, ix>>2); +} + +store_pose(string data, integer ix) { + if ((ix & 3) == 0) { + Positions0 = llListReplaceList(Positions0,[ data ],ix>>2,ix>>2); + } else if ((ix & 3) == 1) { + Positions1 = llListReplaceList(Positions1,[ data ],ix>>2,ix>>2); + } else if ((ix & 3) == 2) { + Positions2 = llListReplaceList(Positions2,[ data ],ix>>2,ix>>2); + } else if ((ix & 3) == 3) { + Positions3 = llListReplaceList(Positions3,[ data ],ix>>2,ix>>2); + } +} + + +save_pose(string name, string data) { + integer ix = myListFind(Poses, name); + if (ix == -1) { + add_pose(name, data); + } else { + store_pose(data, ix); + } +} + +add_pose(string name, string data) { + integer ix = myListFind(Poses, name); + if (ix != -1) { + llOwnerSay("===> WARNING: Multiple .POSITIONS* entries for '" + name + "'"); + } else { + Poses += name; + ix = ++PosCount; + } + store_pose(data, ix-1); +} + +check_pose(string name) { + integer ix; + + // if this is the last pose, report results + if (name == "CHECK2") { + string nameA; + for (ix = 0; ix < llGetListLength(Poses); ++ix) { + nameA = llList2String(Poses, ix); + if (get_pose_data(nameA) != "") { + if (nameA != "default" && nameA != "stand") { + llOwnerSay("No .MENUITEMS* entry for '" + nameA + "'."); + } + } + } + llOwnerSay("Checks complete, resetting."); + llResetScript(); + } + + ix = myListFind(Poses, name); + if (ix == -1) { + llOwnerSay("No .POSITIONS* entry for '" + name + "'."); + return; + } + save_pose(name, ""); +} + + +string vround(vector vec) { + return ("<"+round(vec.x, 3)+","+round(vec.y, 3)+","+round(vec.z, 3)+">"); +} + +string round(float number, integer places) { + float shifted; + integer rounded; + string s; + shifted = number * llPow(10.0,(float)places); + rounded = llRound(shifted); + s = (string)((float)rounded / llPow(10.0,(float)places)); + rounded = llSubStringIndex(s, "."); + if (-1 != rounded) + s = llGetSubString(s,0,llSubStringIndex(s, ".")+places); + else + { + s += ".00000000"; + s = llGetSubString(s,0,llSubStringIndex(s, ".")+places); + } + return s; +} + +dashes() { + llOwnerSay("_______________________________________________________________________________"); + llOwnerSay(""); +} + + +// Globals for reading card config +integer ConfigLineIndex; +list ConfigCards; // list of names of config cards +string ConfigCardName; // name of card being read +integer ConfigCardIndex; // index of next card to read +key ConfigQueryId; + +integer next_card() +{ + if (ConfigCardIndex >= llGetListLength(ConfigCards)) { + ConfigCards = []; + return (FALSE); + } + + ConfigLineIndex = 0; + ConfigCardName = llList2String(ConfigCards, ConfigCardIndex); + ConfigCardIndex++; + ConfigQueryId = llGetNotecardLine(ConfigCardName, ConfigLineIndex); + llOwnerSay("Reading " + ConfigCardName); + return (TRUE); +} + + +default { + state_entry() { + string item; + ConfigCards = []; + integer n = llGetInventoryNumber(INVENTORY_NOTECARD); + while (n-- > 0) { + item = llGetInventoryName(INVENTORY_NOTECARD, n); + if (llSubStringIndex(item, ".POSITIONS") != -1) { + ConfigCards += item; + } + } + + ConfigCardIndex = 0; + ConfigCards = llListSort(ConfigCards, 1, TRUE); + next_card(); + } + + dataserver(key query_id, string data) { + if (query_id != ConfigQueryId) { + return; + } + if (data == EOF) { + if (next_card()) { + return; + } + state on; + } + if (llGetSubString(data,0,0) != "/") { // skip comments + integer ix = llSubStringIndex(data, "{"); //split name from positions, remove junk + integer jx = llSubStringIndex(data, "} <"); + if (ix != -1 && jx != -1) { + add_pose(llGetSubString(data, ix+1, jx-1), llGetSubString(data, jx+2, -1)); + } + } + ++ConfigLineIndex; + ConfigQueryId = llGetNotecardLine(ConfigCardName, ConfigLineIndex); //read next line of positions notecard + } + + state_exit() { + if (PosCount < 1) { + add_pose("stand", "<-0.7,0.0,0.9> <0.0,0.0,0.0> <0.7,0.0,0.9> <0.0,0.0,-180.0>"); + } + if (PosCount < 2) { + add_pose("default", "<-0.7,0.0,0.7> <0.0,0.0,0.0> <0.7,0.0,0.7> <0.0,0.0,-180.0>"); + } + + // do one save to indicate actual amount of available memory + string position = llList2String(Positions1, 0); + Positions1 = llListReplaceList(Positions1, [position],0,0); + + if (llGetInventoryType("~props") == INVENTORY_SCRIPT) { + llSetScriptState("~props", TRUE); + llResetOtherScript("~props"); + llSleep(1.0); // give props a chance to run -- doesn't really matter if not enough + } + } +} + + +state on { + state_entry() { + llMessageLinked(LINK_THIS, 2, "OK", (key)""); //msg to menu, in case it's waiting for loading + announce(); + } + + link_message(integer from, integer num, string str, key dkey) { + if (str == "PRIMTOUCH" || num < 0) { + return; + } + + if (num == 0 && str == "POSEB") { + string name = (string)dkey; + if (name == "CHECK1") { + Checking = TRUE; + } else if (Checking) { + check_pose((string)dkey); + } else { + llMessageLinked(LINK_THIS, 0, "POSEPOS", (key)get_pose_data((string)dkey)); // to ~pos + } + return; + } + + if (num != 1) { + return; + } + + if (str == "OK?") { //question from menu, before loading menu + llMessageLinked(from, 2, "OK", (key)""); //answer to menu + } else if (str == "DUMP") { + dashes(); + llOwnerSay("Copy to .POSITIONS; delete any other *.POSITIONS* cards"); + dashes(); + string name = llGetObjectName(); + llSetObjectName(""); + + integer ix; + for (ix = 0; ix < PosCount; ++ix) { + string nameA = llList2String(Poses, ix); + llOwnerSay("{" + nameA + "} " + get_pose_data(nameA)); + } + + llSetObjectName(name); + dashes(); + } else if (llSubStringIndex(str, "REORIENT=") == 0) { + // Reorient command (LINKMENU command from .MENUITEMS file) + // str format: REORIENT=OFF= or REORIENT=ROT= (in degrees) + list parms = llParseString2List(str, ["="], []); + vector amount = (vector)llList2String(parms, 2); + llWhisper(0, "Adjusting Poses, please wait"); + + if (llList2String(parms, 1) == "OFF") { + adjust_all(TRUE, amount); + } else { + adjust_all(FALSE, amount); + } + llMessageLinked(LINK_THIS, 0, "AGAIN", (key)""); + llWhisper(0, "Pose adjustment complete"); + } else { + if (llGetSubString((string)dkey, 0, 0) == "<") { //SAVE + save_pose(str, (string)dkey); + announce(); + } + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menu.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menu.lsl new file mode 100644 index 0000000..e733e96 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menu.lsl @@ -0,0 +1,529 @@ +// MLPV2 Version 2.3, by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// 15-color balls by Lizz Silverstar +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +// 2.3: sequences +// 6 avs +// Adjusting state + +integer MAX_BALLS = 6; + +string Version = "MLPV2.5"; + +integer b; +integer b0; +integer ballusers; +list BallColors; +integer ch; +integer chat = 1; +integer group; +integer i; +integer menu; +integer menuusers; +integer redo = 1; +integer swap; +integer visible; +integer BallCount; +integer SaneMenuOrder; +integer ReloadOnRez; + +integer Adjusting; +string LastPose; + +integer BallsNeeded; + +float alpha; +string cmd; +string pose; +string Posemsg; // for 'AGAIN' +key owner; +key user; +key user0; +list buttons; +list buttonindex; +list commands; +list menus; +list balls; +list users; + +list SoundNames; +list Sounds; +list LMButtons; +list LMParms; +list MenuStack = [0]; // indices to previous menus, for "BACK" command + +integer MenuPage; // which page of current menu we're on, 0 for first + +// Replacement for llListFindList which is currently broken in OSLSL +integer myListFind(list a, string b) { + integer x; + integer l=llGetListLength(a); + + for(x=0; x> ix*4; + BallColors += (list)bc; + if (bc) { + BallsNeeded += 1; + } + mask = mask << 4; + } + + if (inhibit_showing) { + return; + } + + b0 = llList2Integer(buttonindex, menu); //position of first button for this (sub)menu + b = llList2Integer(buttonindex, menu+1); //position of first button for next (sub)menu + + b0 += MenuPage * 12; + if (b - b0 > 12) { + b = b0 + 12; + } + + list buttons1; + buttons1 = llList2List(buttons, b0, b - 1); + if (SaneMenuOrder) { + buttons1 = + llList2List(buttons1, -3, -1) + + llList2List(buttons1, -6, -4) + + llList2List(buttons1, -9, -7) + + llList2List(buttons1, -12, -10); + } + llDialog(user, Version + ":- " + llList2String(menus,menu), buttons1, ch - 1); + llResetTime(); +} + +say(string str) { + if (menuusers) llWhisper(0,str); + else llOwnerSay(str); +} + +killBalls() { + integer ix; + for (ix = 0; ix < MAX_BALLS; ++ix) { + llSay(ch + ix, "DIE"); //msg to balls + } + BallCount = 0; + llSetTimerEvent(0.0); +} + +setBalls(string cmd) { + integer ix; + for (ix = 0; ix < BallCount; ++ix) { + llSay(ch + ix, cmd); //msg to balls + } +} + + +rezBalls() { + integer current = BallCount; + + if (BallsNeeded == BallCount) return; + + if (BallCount == 0) { + killBalls(); // for reinitialization, if old balls are around + } + + while (BallCount > BallsNeeded) { + --BallCount; + llSay(ch + BallCount, "DIE"); + } + + while (BallCount < BallsNeeded) { + llRezObject("~ball",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,ch+BallCount); + ++BallCount; + } + + // Only do this if there were no balls + if (! current) { + llMessageLinked(LINK_THIS,0,"REPOS",(key)""); //msg to pos + } + + llSetTimerEvent(30.0); +} + + + +sendStand() { + llMessageLinked(LINK_THIS,0,"POSE","0,"+(string)BallCount); //msg to pos/pose + llMessageLinked(LINK_THIS,0,"POSEB", "stand"); +} + +touched(integer same_group) { + if (user0 == owner || (menuusers == 1 && same_group) || menuusers == 2) { //0=owner 1=group 2=all + if (user0 != user) { + if (llGetTime() < 60.0 && user != (key)"") { + continMenu(""); + return; + } + user = user0; + group = same_group; + } + mainMenu(); + } +} + + +// return TRUE if caller should do menu +integer handle_cmd(string button, integer sequenced) { + b = myListFind(buttons, button); //find position of cmd + string cmd = llList2String(commands,b); //get command + + if (cmd == "TOMENU") { + integer newmenu = myListFind(menus, button); //find submenu + if (newmenu == -1) return FALSE; + if (sequenced) { + integer oldmenu = menu; + menu = newmenu; + doMenu(TRUE); + setup_pose(); + menu = oldmenu; + return FALSE; + } + i = llList2Integer(users, newmenu); + if (user == owner || (i == 1 && group) || i == 2) { //0=owner 1=group 2=all + MenuStack = (list)menu + MenuStack; + MenuPage = 0; + menu = newmenu; + doMenu(sequenced); + return FALSE; + } + if (i == 1) unauth(button, "group"); + else unauth(button, "owner"); + return FALSE; + } else if (cmd == "BACK") { + if (MenuPage) { + --MenuPage; + doMenu(sequenced); + return FALSE; + } + menu = llList2Integer(MenuStack,0); + MenuStack = llList2List(MenuStack,1,-1); + doMenu(sequenced); + return FALSE; + } else if (cmd == "MORE") { + ++MenuPage; + doMenu(sequenced); + return FALSE; + } else if (cmd == "CHECK") { + check_poses(); + } else if ((integer)cmd > 0) { //POSE + if (Adjusting && button != pose) { + llMessageLinked(LINK_THIS,0,"SAVE",pose); //msg to pos/pose + llSleep(5.); + } + setup_pose(); + Posemsg = cmd + "," + (string) BallCount; + llMessageLinked(LINK_THIS,0,"POSE", Posemsg); //msg to pose + llMessageLinked(LINK_THIS,0,"POSEB", (key)button); //msg to memory + if (chat) say(button); + pose = button; + } else if (cmd == "SWAP") { + swap += 1; + llMessageLinked(LINK_THIS,0,"SWAP",(key)((string)swap)); //msg to pos/pose + } else if (cmd == "STAND") { + sendStand(); //msg to pos/pose + if (chat) say(button); + pose = "stand"; + } else if (cmd == "STOP") { + if (chat) say(button); + stop(); + return FALSE; + } else if (cmd == "ADJUST") { + Adjusting = ! Adjusting; + setBalls("ADJUST|" + (string)Adjusting); + } else if (cmd == "HIDE") { + setBalls("0"); + } else if (cmd == "SHOW") { + setBalls("SHOW"); + } else if (cmd == "DUMP") { + llMessageLinked(LINK_THIS,1,"DUMP",(key)""); + } else if (cmd == "INVISIBLE") { + visible = !visible; + llSetAlpha((float)visible*alpha, ALL_SIDES); + } else if (cmd == "REDO") { + redo = !redo; + if (redo) say(button+" ON"); else say(button+" OFF"); + } else if (cmd == "CHAT") { + chat = !chat; + if (chat) say(button+" ON"); else say(button+" OFF"); + } else if (cmd == "BALLUSERS") { + ballusers = !ballusers; + if (ballusers) { + llOwnerSay(button+" GROUP"); + setBalls("GROUP"); + } else { + llOwnerSay(button+" ALL"); + setBalls("ALL"); + } + } else if (cmd == "MENUUSERS") { + if (user == owner) { + if (!menuusers) { + menuusers = 1; + llOwnerSay(button+" GROUP"); + } else if (menuusers == 1) { + menuusers = 2; + llOwnerSay(button+" ALL"); + } else if (menuusers == 2) { + menuusers = 0; + llOwnerSay(button+" OWNER"); + } + } else unauth(button, "owner"); + } else if (cmd == "RESET" || cmd == "RELOAD" || cmd == "RESTART") { + stop(); + if (chat) say(button); + if (cmd == "RESET") { + llResetScript(); + } else { + llResetOtherScript("~memory"); + if (cmd == "RESTART") { + llResetScript(); + } + } + } else if (cmd == "OFF") { + sendStand(); //msg to pos/pose + stop(); + if (user == owner) { + llOwnerSay(button); + llResetOtherScript("~run"); + llResetScript(); + } + unauth(button, "owner"); + return FALSE; + } else if (llGetSubString(cmd, 0, 0) == "Z" || (cmd == "SAVE")) { //SAVE or Z-adjust + llSay(0,"Z"); + llMessageLinked(LINK_THIS,0,cmd,pose); //msg to pos/pose + doMenu(sequenced); + return FALSE; + } else if (cmd == "LINKMSG") { + // menu button to send LM to a non-MLPV2 script + integer ix = myListFind(LMButtons, button); + if (ix != -1) { + list lmparms = llCSV2List(llList2String(LMParms, ix)); + llMessageLinked( + llList2Integer(lmparms, 1), // destination link# + llList2Integer(lmparms, 2), // 'num' arg + llList2String(lmparms, 3), // 'str' arg + user0); // key arg + if (llList2Integer(lmparms,0)) { // inhibit remenu? + return FALSE; // yes, bug out + } + } + } else if (cmd == "SOUND") { + integer ix = myListFind(SoundNames, button); + if (ix >= 0) { + llPlaySound(llList2String(Sounds, ix), 1.); + } + } + return TRUE; +} + +default { + state_entry() { + ch = channel(); + killBalls(); + llSleep(2.0); // give ~run a chance to shut us down + llResetOtherScript("~menucfg"); + llResetOtherScript("~pos"); + llResetOtherScript("~pose"); + llResetOtherScript("~poser"); + llResetOtherScript("~poser 1"); + llResetOtherScript("~poser 2"); + llResetOtherScript("~poser 3"); + llResetOtherScript("~poser 4"); + llResetOtherScript("~poser 5"); +// alpha = llGetAlpha(0); //store object transparancy (alpha) + if (alpha < 0.1) alpha = 0.5; else visible = 1; //if invisible store a visible alpha + } + + link_message(integer from, integer num, string str, key id) { +// if (from != llGetLinkNumber()) { return; } + if (num >= 0) { return;} + + // LMs from ~memory, passing configuration + if (num == -1) { + buttons = llCSV2List(str); + } else if (num == -2) { + commands = llCSV2List(str); + } else if (num == -3) { + menus = llCSV2List(str); + } else if (num == -4) { + buttonindex = llCSV2List(str); + } else if (num == -5) { + balls = llCSV2List(str); + } else if (num == -6) { + users = llCSV2List(str); + } else if (num == -7) { + LMButtons = llCSV2List(str); + } else if (num == -8) { + LMParms = llParseStringKeepNulls(str, ["|"], []); + } else if (num == -9) { + SoundNames = llCSV2List(str); + } else if (num == -10) { + Sounds = llCSV2List(str); + } else if (num == -20) { + list args = llCSV2List(str); + redo = llList2Integer(args,0); + chat = llList2Integer(args,1); + ballusers = llList2Integer(args,2); + menuusers = llList2Integer(args,3); + SaneMenuOrder = llList2Integer(args,4); + ReloadOnRez = llList2Integer(args,5); + + state on; + } + } + + state_exit() { + llOwnerSay("("+llGetScriptName()+": "+(string)llGetFreeMemory()+" bytes free)"); + llWhisper(0, Version + ": READY"); + } +} + +state re_on { + state_entry() { + state on; + } +} + +state on { + state_entry() { + ch = channel(); + owner = llGetOwner(); + llListen(ch - 1, "", NULL_KEY, ""); //listen for pressed buttons + // llWhisper(0, "Channel: " + (string)ch); + } + + on_rez(integer arg) { + if (ReloadOnRez) { + llResetScript(); + } + BallCount = 0; + llSetTimerEvent(0.0); + state re_on; + } + + touch_start(integer tcount) { + user0 = llDetectedKey(0); + touched(llDetectedGroup(0)); + } + + listen(integer channel, string name, key id, string button) { + if (id != user) { + if (button == "Yes") { + user = id; + group = llSameGroup(user0); + mainMenu(); + } else if (button != "Cancel") { + continMenu("Selection cancelled because "); + } + return; + } + if (handle_cmd(button, FALSE) && redo) doMenu(FALSE); + } + + + link_message(integer from, integer num, string str, key id) { + if (str == "PRIMTOUCH") { + user0 = id; + touched(num); + return; + } + if (num == 0 && str == "AGAIN") { + llMessageLinked(LINK_THIS,0,"POSE", Posemsg); //msg to pose + llMessageLinked(LINK_THIS,0,"POSEB", (key)pose); //msg to memory + return; + } + if (num == -12002) { + handle_cmd(str, TRUE); + return; + } + } + + timer() { + setBalls("LIVE"); //msg to balls: stay alive + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menucfg.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menucfg.lsl new file mode 100644 index 0000000..03e1b0f --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~menucfg.lsl @@ -0,0 +1,296 @@ +// MLPV2 Version 2.2, by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// 15-color balls by Lizz Silverstar +// autoback, multi-contin menu fixed +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer MAX_BALLS = 6; + +// Multicolor ball patch by Lizz Silverstar +// The colors var used to store the color values is a 32 bit integer (0x00000000) +// This is broken up into 8 nibbles of which we will currently use the lower 4 nibbles +// the first ball color is in the lower 4 bits, the second in the next 4 bits, etc +// Masks and shifting are used to store and extract the data. +// 4 bits gives us 15 colors. 0 = no ball, 1-15 = color +// these index values are then used by the ~ball code to set the correct color +// 1st ball mask is 0x0000000F, no shift +// 2nd ball mask is 0x000000F0, shift of 4 +// 3rd ball mask is 0x00000F00, shift of 8 +// 4th ball mask is 0x0000F000, shift of 12 + +list Colornames = [ + "HIDE", "PINK", "BLUE", "PINK2", + "BLUE2", "GREEN", "MAGENTA", "RED", + "ORANGE", "WHITE", "BLACK", "YELLOW", + "CYAN", "RED2", "TEAL", "GREEN2"]; + + +integer PoseIx; + +integer CurButtonIx; // index of current button +integer b0; // index of current button from start of current menu + +integer AutoBack; +integer chat = TRUE; +integer redo = TRUE; +integer menuusers; +integer group; +integer ballusers; +integer SaneMenuOrder; +integer ReloadOnRez = FALSE; + +string cmd; +string pose; +string pose0; + +list buttons; +list buttonindex; +list commands; +list menus; +list balls; +list users; + +list SoundNames; +list Sounds; +list LMButtons; +list LMParms; + + +// Globals for reading card config +integer ConfigLineIndex; +list ConfigCards; // list of names of config cards +string ConfigCardName; // name of card being read +integer ConfigCardIndex; // index of next card to read +key ConfigQueryId; + +// Replacement for llListFindList which is currently broken in OSLSL +integer myListFind(list a, string b) { + integer x; + integer l=llGetListLength(a); + + for(x=0; x= llGetListLength(ConfigCards)) { + ConfigCards = []; + return (FALSE); + } + + ConfigLineIndex = 0; + ConfigCardName = llList2String(ConfigCards, ConfigCardIndex); + ConfigCardIndex++; + ConfigQueryId = llGetNotecardLine(ConfigCardName, ConfigLineIndex); + llOwnerSay("Reading " + ConfigCardName); + return (TRUE); +} + +default { + state_entry() { + // ch = (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim + llMessageLinked(LINK_THIS,1,"OK?",(key)""); //msg to memory: ask if ready + } + link_message(integer from, integer num, string str, key id) { + if (num == 2 && str == "OK") state load; //memory ready + } +} + + +state load { + state_entry() { + string item; + ConfigCards = []; + integer n = llGetInventoryNumber(INVENTORY_NOTECARD); + while (n-- > 0) { + item = llGetInventoryName(INVENTORY_NOTECARD, n); + if (llSubStringIndex(item, ".MENUITEMS") != -1) { + ConfigCards += item; + } + } + + ConfigCardIndex = 0; + ConfigCards = llListSort(ConfigCards, 1, TRUE); + next_card(); + } + + dataserver(key query_id, string data) { + if (query_id != ConfigQueryId) { + return; + } + if (data == EOF) { + if (next_card()) { + return; + } + state on; + } + + integer ix = llSubStringIndex(data,"//"); //remove comments + if (ix != -1) { + if (ix == 0) data = ""; + else data = llGetSubString(data, 0, ix - 1); + } + + data = llStringTrim(data, STRING_TRIM_TAIL); + if (data != "") { + ix = llSubStringIndex(data," "); + cmd = data; + if (ix != -1) { //split command from data + cmd = llGetSubString(data, 0, ix - 1); + data = llGetSubString(data, ix+1, -1); + } + list ldata = llParseStringKeepNulls(data,[" | "," | "," | "," | "," |","| ","|"],[]); + string arg1 = llList2String(ldata, 0); + // llSay(0, cmd + ":" + data); + if (cmd == "MENU") { + integer auth; + + if (PoseIx < 2) { + llOwnerSay("warning: first two items in .MENUITEMS must be: POSE stand / POSE default"); + } + llOwnerSay("loading '"+arg1+"' menu"); + + if (llList2String(ldata, 1) == "GROUP") auth = 1; //access to submenus + else if (llList2String(ldata, 1) != "OWNER") auth = 2; //0=owner 1=group 2=all + + integer colors; + string ball_color; + integer colorIx; + integer ixB; + for (ixB=0; ixB < MAX_BALLS; ++ixB) { // for each possible ball + ball_color = llList2String(ldata, ixB + 2); // get next color name from config + + colorIx = myListFind(Colornames, ball_color); + + if (colorIx != -1) { + colors += (colorIx << (4 * ixB)); // 4 = bits per color (16 colors) + } + } + + menus += (list) arg1; + balls += (list) colors; + buttonindex += (list) CurButtonIx; + users += (list) auth; + +// if (llListFindList(buttons, (list)arg1) == -1) { + + if (myListFind(buttons, arg1) == -1) { + + integer jx = myListFind(buttons, "-"); + + if (jx != -1) { + buttons = llListReplaceList(buttons, (list)arg1, jx, jx); + // "TOMENU" is already in commands list from the 'TOMENU -' + } else if (CurButtonIx > 2) { + llOwnerSay("No unused 'TOMENU -' for " + arg1); + } + } + + b0 = 0; + } else if (cmd == "AUTOBACK") { + AutoBack = (arg1 != "0"); + } else if (cmd == "NORELOAD") { + ReloadOnRez = (arg1 != "0"); // whether to reload menu on rez + } else if (cmd == "MENUORDER") { + SaneMenuOrder = (arg1 != "0"); // keep menu buttons in same order as in file + } else { + + // automatic menu extension (don't do for main menu) + if (b0 == 12 && llGetListLength(menus) > 1) { + // Add a "more" button before last item + integer ixA = -1; + if (AutoBack) { + ixA = -2; + // Add a "BACK" button + buttons = llListInsertList(buttons, (list)"BACK", ixA); + commands = llListInsertList(commands, (list)"BACK", ixA); + ++CurButtonIx; + } + buttons = llListInsertList(buttons, (list)"More-->", ixA); + commands = llListInsertList(commands, (list)"MORE", ixA); + ++CurButtonIx; + b0 = -ixA; + } + if (cmd == "POSE") { + llMessageLinked(LINK_THIS,9+PoseIx,data, (key)""); + if (!PoseIx) pose0 = arg1; + cmd = (string)PoseIx; + ++PoseIx; + } else if (cmd == "REDO") { + if (llList2String(ldata, 1) != "OFF") redo = 1; + } else if (cmd == "CHAT") { + if (llList2String(ldata, 1) != "OFF") chat = 1; + } else if (cmd == "BALLUSERS") { + if (llList2String(ldata, 1) == "GROUP") ballusers = 1; + } else if (cmd == "MENUUSERS") { + if (llList2String(ldata, 1) == "GROUP") menuusers = 1; + else if (llList2String(ldata, 1) != "OWNER") menuusers = 2; + } else if (cmd == "LINKMSG") { + LMButtons += arg1; + LMParms += llList2String(ldata, 1); + } else if (cmd == "SOUND") { + SoundNames += (list) arg1; + Sounds += (list) llList2String(ldata, 1); + } + commands += (list) cmd; + buttons += (list) arg1; + ++CurButtonIx; + ++b0; + } + } + ++ConfigLineIndex; + ConfigQueryId = llGetNotecardLine(ConfigCardName, ConfigLineIndex); //read next line of menuitems notecard + } + state_exit() { + buttonindex += (list) CurButtonIx; //enter last buttonindex + commands += (list) ""; //empty command for undefined buttons (-1) + + integer ix; + integer count; + while ((ix = myListFind(buttons, "-")) != -1) { + ++count; + buttons = llDeleteSubList(buttons, ix, ix); + commands = llDeleteSubList(commands, ix, ix); + } + if (count) { + for (ix = 1; ix < llGetListLength(buttonindex); ++ix) { + buttonindex = llListReplaceList(buttonindex, + (list)(llList2Integer(buttonindex, ix) - count), ix, ix); + } + } + // llMessageLinked(LINK_THIS,1,"LOADED",(string)PoseIx); //msg to memory + llMessageLinked(LINK_THIS,9+PoseIx,"LOADED",(key)""); //msg to pose + } +} + +state on { + state_entry() { + llMessageLinked(LINK_THIS, -3, llList2CSV(menus), (key)""); menus = []; + llMessageLinked(LINK_THIS, -4, llList2CSV(buttonindex), (key)""); buttonindex = []; + llMessageLinked(LINK_THIS, -5, llList2CSV(balls), (key)""); balls = []; + llMessageLinked(LINK_THIS, -6, llList2CSV(users), (key)""); users = []; + llMessageLinked(LINK_THIS, -7, llList2CSV(LMButtons), (key)""); LMButtons = []; + + llMessageLinked(LINK_THIS, -8, llDumpList2String(LMParms, "|"), (key)""); LMParms = []; + + llMessageLinked(LINK_THIS, -9, llList2CSV(SoundNames), (key)""); SoundNames = []; + llMessageLinked(LINK_THIS, -10, llList2CSV(Sounds), (key)""); Sounds = []; + + llMessageLinked(LINK_THIS, -2, llList2CSV(commands), (key)""); commands = []; + llMessageLinked(LINK_THIS, -1, llList2CSV(buttons), (key)""); buttons = []; + + + // finally, scalars (signals 'done' as well) + llMessageLinked(LINK_THIS, -20, + llList2CSV([ redo, chat, ballusers, menuusers, SaneMenuOrder, ReloadOnRez ]), (key)""); + + llOwnerSay((string)CurButtonIx+" menuitems loaded ("+llGetScriptName()+": "+(string)llGetFreeMemory()+" bytes free)"); + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pos.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pos.lsl new file mode 100644 index 0000000..3b93b64 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pos.lsl @@ -0,0 +1,108 @@ +// MLPV2 Version 2.3j, by Learjeff Innis, based on +//MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected and one by Tatjana Kidd. + +integer MAX_BALLS = 6; + +integer ch; +integer swap; +integer BallCount; + +string pr1; +string pr2; + +integer Zoffset; + +vector RefPos; +rotation RefRot; + +getRefPos() { //reference position + RefPos = llGetPos(); + RefRot = llGetRot(); + Zoffset = (integer)llGetObjectDesc(); + RefPos.z += (float) Zoffset / 100.; +} + +list Pdata; + +getPosNew(string pdata) { + Pdata = llParseString2List(pdata, [" "],[]); +} + +setPos() { + pr1 = (string)((vector)llList2String(Pdata, 0) * RefRot + RefPos); + pr2 = (string)((vector)llList2String(Pdata, 2) * RefRot + RefPos); + pr1 += (string)(llEuler2Rot((vector)llList2String(Pdata, 1) * DEG_TO_RAD) * RefRot); + pr2 += (string)(llEuler2Rot((vector)llList2String(Pdata, 3) * DEG_TO_RAD) * RefRot); + if (BallCount > 1) { + llSay(ch+swap,pr1); //msg to ball1/2 + llSay(ch+!swap,pr2); + } else { + llSay(ch,pr1); //msg to ball1/2 + } + + integer ix; + for (ix = 2; ix < BallCount; ++ix) { + llSay(ch + ix, (string)((vector)llList2String(Pdata, 2*ix) * RefRot + RefPos) + + (string)(llEuler2Rot((vector)llList2String(Pdata, 2*ix + 1) * DEG_TO_RAD) * RefRot)); + } +} + +getChan() { + ch = (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + state_entry() { + getRefPos(); + getChan(); + } + + on_rez(integer arg) { + getRefPos(); + getChan(); + } + + link_message(integer from, integer num, string cmd, key pkey) { + if (cmd == "PRIMTOUCH"){ + return; + } + + if (num == 1 && cmd == "STOP") { + swap = 0; + return; + } + + if (num) return; + + if (cmd == "POSE") { + list parms = llCSV2List((string)pkey); + BallCount = llList2Integer(parms,1); + return; + } else if (cmd == "POSEPOS") { + // p = (integer)((string)pkey + getPosNew((string)pkey); + setPos(); + } else if (cmd == "SWAP") { + swap = (integer)((string)pkey) & 1; + llSay(ch+swap,pr1); //msg to ball1/2 + llSay(ch+!swap,pr2); + } else if (cmd == "REPOS") { + getRefPos(); + } else if (llGetSubString(cmd, 0, 0) == "Z") { + // Changed by Tatjana to make it work :) + integer change; + if (llGetSubString(cmd,1,1) == "+") change = (integer)llGetSubString(cmd,2,10); + else change = (integer)llGetSubString(cmd,1,10); + // End Tatjana changing (Penny helped, of course!) + Zoffset += change; + RefPos.z += (float)change/100.; + setPos(); + llOwnerSay("Height Adjustment: change by " + (string) change + "cm, new offset: " + (string)Zoffset + "cm"); + llSetObjectDesc((string)Zoffset); + } else if (cmd == "GETREFPOS") { + llMessageLinked(LINK_THIS,8,(string)RefPos,(string)RefRot); //send reference position to pose + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pose.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pose.lsl new file mode 100644 index 0000000..26ab5ff --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~pose.lsl @@ -0,0 +1,222 @@ +// MLPV2 Version 2.3, by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer MAX_AVS = 6; + +integer a; +integer ch; +integer i; +integer swap; +string an1; +string an2; +string an3; +string an4; +string an5; +string an6; +string pose; + +list PRs; // pos/rot pairs for Save + +list anims; // strided list of anims, indexed by pose*6 +vector pos; +rotation rot; +integer BallCount; // number of balls +integer UpdateCount; // number of balls we've heard from, for save + +string prStr(string str) { + i = llSubStringIndex(str,">"); + vector p = ((vector)llGetSubString(str,0,i) - pos) / rot; + vector r = llRot2Euler((rotation)llGetSubString(str,i+1,-1) / rot)*RAD_TO_DEG; + return "<"+round(p.x, 3)+","+round(p.y, 3)+","+round(p.z, 3)+"> <"+round(r.x, 1)+","+round(r.y, 1)+","+round(r.z, 1)+">"; +} + +string round(float number, integer places) { + float shifted; + integer rounded; + string s; + shifted = number * llPow(10.0,(float)places); + rounded = llRound(shifted); + s = (string)((float)rounded / llPow(10.0,(float)places)); + rounded = llSubStringIndex(s, "."); + if (-1 != rounded) + s = llGetSubString(s,0,llSubStringIndex(s, ".")+places); + else + { + s += ".00000000"; + s = llGetSubString(s,0,llSubStringIndex(s, ".")+places); + } + return s; +} + +check_anim(string aname) { + if (aname == "") { + return; + } + if ( aname != "PINK" + && aname != "BLUE" + && aname != "stand" + && aname != "sit_ground") { + + // ignore expression suffix of "*" or "::nnn" + if (llGetSubString(aname, -1, -1) == "*") { + aname = llGetSubString(aname, 0, -2); + } else { + integer ix = llSubStringIndex(aname, "::"); + if (ix != -1) { + aname = llGetSubString(aname, 0, ix-1); + } + } + + if (llGetInventoryType(aname) != INVENTORY_ANIMATION) { + llSay(0,"animation '" + + aname + + "' not in inventory (ok for build-in animations, otherwise check)"); + } + } +} + +getChan() { + ch = (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + + link_message(integer from, integer num, string data, key id) { + if (num != 9+a) return; + + if (data == "LOADED") state on; + + list ldata = llParseString2List(data,[" | "," | "," | "," | "," |","| ","|"],[]); + + an1 = llList2String(ldata,1); + an2 = llList2String(ldata,2); + an3 = llList2String(ldata,3); + an4 = llList2String(ldata,4); + an5 = llList2String(ldata,5); + an6 = llList2String(ldata,6); + + if (a>1) { + check_anim(an1); + check_anim(an2); + check_anim(an3); + check_anim(an4); + check_anim(an5); + check_anim(an6); + } else if (a) { //pose1: set default + if (an1 == "") an1 = "sit_ground"; + if (an2 == "") an2 = "sit_ground"; + if (an3 == "") an3 = "sit_ground"; + if (an4 == "") an4 = "sit_ground"; + if (an5 == "") an5 = "sit_ground"; + if (an6 == "") an6 = "sit_ground"; + } else { //pose0: set stand + if (an1 == "") an1 = "stand"; + if (an2 == "") an2 = "stand"; + if (an3 == "") an3 = "stand"; + if (an4 == "") an4 = "stand"; + if (an5 == "") an5 = "stand"; + if (an6 == "") an6 = "stand"; + } + anims += [ an1, an2, an3, an4, an5, an6 ]; + ++a; + } + state_exit() { + llOwnerSay((string)a+" poses loaded ("+llGetScriptName()+": "+(string)llGetFreeMemory()+" bytes free)"); + } +} + + +state on { + state_entry() { + getChan(); + } + + on_rez(integer arg) { + getChan(); + } + + link_message(integer from, integer num, string cmd, key akey) { + if (cmd == "PRIMTOUCH"){ + return; + } + if (num) return; + if (cmd == "POSE") { + list parms = llCSV2List((string)akey); + BallCount = llList2Integer(parms,1); + a = llList2Integer(parms,0) * 6; + an1 = llList2String(anims, a); + an2 = llList2String(anims, a+1); + an3 = llList2String(anims, a+2); + an4 = llList2String(anims, a+3); + an5 = llList2String(anims, a+4); + an6 = llList2String(anims, a+5); + } else if (cmd == "SWAP") { + swap = !swap; + } else if (cmd == "SAVE") { + pose = (string)akey; + state save; + } else return; + llMessageLinked(LINK_THIS,ch+swap, an1,(key)""); //msg to poser 1/2 + llMessageLinked(LINK_THIS,ch+!swap,an2,(key)""); + llMessageLinked(LINK_THIS,ch+2, an3,(key)""); //msg to poser 3 + llMessageLinked(LINK_THIS,ch+3, an4,(key)""); //msg to poser 4 + llMessageLinked(LINK_THIS,ch+4, an5,(key)""); //msg to poser 4 + llMessageLinked(LINK_THIS,ch+5, an6,(key)""); //msg to poser 4 + } +} + +state save { + state_entry() { + llMessageLinked(LINK_THIS,0,"GETREFPOS",""); //msg to pos: ask ref position + integer ix; + PRs = [ "", "", "", "", "", "" ]; + + for (ix = 0; ix < MAX_AVS; ++ix) { + llListen(ch+16+ix, "", NULL_KEY, ""); + llSay(ch+ix,"SAVE"); //msg to balls + } + llSetTimerEvent(3); + UpdateCount = 0; + } + + + listen(integer channel, string name, key id, string pr) { + channel -= (ch + 16); + + if (channel == 0) { + channel = channel + swap; + } else if (channel == 1) { + channel = channel - swap; + } + + PRs = llListReplaceList(PRs, (list)pr, channel, channel); + + if (++UpdateCount == BallCount) { + pr = ""; + integer ix; + for (ix = 0; ix < BallCount; ++ix) { + pr += prStr(llList2String(PRs, ix)) + " "; + } + + llOwnerSay("{"+pose+"} "+pr); + llMessageLinked(LINK_THIS,1,pose,pr); //write to memory + state on; + } + } + link_message(integer from, integer num, string posstr, key rotkey) { + if (posstr == "PRIMTOUCH"){ + return; + } + if (num != 8) return; + pos = (vector)posstr; //revtrieve reference position from pos + rot = (rotation)((string)rotkey); + } + timer() { + state on; + } + state_exit() { + llSetTimerEvent(0); + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 1.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 1.lsl new file mode 100644 index 0000000..fc976c4 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 1.lsl @@ -0,0 +1,200 @@ +// MPLV2 2.3 by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer ch; +string animation = "stand"; +key avatar; + +integer ExprEnabled = TRUE; +string Expression; +float ExprTimer; + +integer BallNum; + +list Expressions = [ + "" + , "express_open_mouth" // 1 + , "express_surprise_emote" // 2 + , "express_tongue_out" // 3 + , "express_smile" // 4 + , "express_toothsmile" // 5 + , "express_wink_emote" // 6 + , "express_cry_emote" // 7 + , "express_kiss" // 8 + , "express_laugh_emote" // 9 + , "express_disdain" // 10 + , "express_repulsed_emote" // 11 + , "express_anger_emote" // 12 + , "express_bored_emote" // 13 + , "express_sad_emote" // 14 + , "express_embarrassed_emote" // 15 + , "express_frown" // 16 + , "express_shrug_emote" // 17 + , "express_afraid_emote" // 18 + , "express_worry_emote" // 19 + , "SLEEP" // 20 +]; + + +stopAnim() { + key id = llGetPermissionsKey(); + list anims = llGetAnimationList(id); + integer ix; + for (ix = 0; ix < llGetListLength(anims); ++ix) { + string anim = llList2String(anims, ix); + if (anim != "") { + llStopAnimation(anim); + } + } + llSetTimerEvent(0.0); +} + +startAnim(string anim) { + if (Expression != "") { + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else { + llStartAnimation(Expression); + } + if (ExprEnabled) { + llSetTimerEvent(ExprTimer); + } + } else { + stopAnim(); + } + if (anim != "") { + llStartAnimation(anim); + } +} + +// Animation names with a "*" suffix get open mouth +// Those with a suffix of "::" followed by a number +// get the expression associated with that number. +// This can optionally be followed by another "::" delim, +// with a timer value following. +// Return the anim name without the suffix. +string getExpression(string anim) { + if (llGetSubString(anim,-1,-1) == "*") { + Expression = llList2String(Expressions, 1); + ExprTimer = 0.5; + return llGetSubString(anim, 0, -2); + } + integer ix = llSubStringIndex(anim, "::"); + if (ix == -1) { + Expression = ""; + ExprTimer = 0.5; + return anim; + } + + list parms = llParseString2List(anim, ["::"], []); + anim = llList2String(parms, 0); + integer exprIx = (integer) llList2String(parms, 1); + Expression = llList2String(Expressions, exprIx); + ExprTimer = (float) llList2String(parms,2); + + if (ExprTimer <= 0.0) { + ExprTimer = 0.5; + } + + return anim; +} + +getChan() { + BallNum = (integer) llGetSubString(llGetScriptName(),-1,-1); //offset from script name suffix + ch = BallNum + + (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + state_entry() { + state s_on; + } +} + +state s_on { + state_entry() { + getChan(); + llListen(ch+8,"",NULL_KEY,""); + } + + on_rez(integer arg) { + state default; + } + + link_message(integer from, integer num, string an, key id) { //an animation is set + if (an == "PRIMTOUCH") { + return; + } + + if (num != ch) return; + an = getExpression(an); // get & save expression, and return unadorned anim + + if (avatar == llGetPermissionsKey() + && avatar != NULL_KEY + && animation != "") { + llStopAnimation(animation); + llMessageLinked(LINK_SET, -11002, (string)BallNum + "|" + an, avatar); + startAnim(an); + } + animation = an; + } + + timer() { // timer to keep mouth open + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else if (Expression != "") { + llStartAnimation(Expression); + } + } + + listen(integer channel, string name, key id, string str) { + if (str == "ALIVE" || str == "DIE") { + llMessageLinked(LINK_THIS,2,str,""); //send msg from ball to menu + if (str == "DIE") { + avatar = NULL_KEY; + llSetTimerEvent(0.0); + } + return; + } + + avatar = (key) str; //avatar (sit) or NULL_KEY (stand up) + if (avatar == NULL_KEY) { + if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11001, (string)BallNum, llGetPermissionsKey()); + } + // llReleaseControls(); + return; + } + + if (avatar != llGetPermissionsKey() + || ! (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { + ExprEnabled = TRUE; + llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); + } else { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } + } + + run_time_permissions(integer perm) { + if (avatar != llGetPermissionsKey()) { + llWhisper(DEBUG_CHANNEL, "avatar != perm key"); + return; + } + + if (perm & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } else { + llMessageLinked(LINK_SET, -11001, (string)BallNum, avatar); + llSetTimerEvent(0.0); + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 2.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 2.lsl new file mode 100644 index 0000000..fc976c4 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 2.lsl @@ -0,0 +1,200 @@ +// MPLV2 2.3 by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer ch; +string animation = "stand"; +key avatar; + +integer ExprEnabled = TRUE; +string Expression; +float ExprTimer; + +integer BallNum; + +list Expressions = [ + "" + , "express_open_mouth" // 1 + , "express_surprise_emote" // 2 + , "express_tongue_out" // 3 + , "express_smile" // 4 + , "express_toothsmile" // 5 + , "express_wink_emote" // 6 + , "express_cry_emote" // 7 + , "express_kiss" // 8 + , "express_laugh_emote" // 9 + , "express_disdain" // 10 + , "express_repulsed_emote" // 11 + , "express_anger_emote" // 12 + , "express_bored_emote" // 13 + , "express_sad_emote" // 14 + , "express_embarrassed_emote" // 15 + , "express_frown" // 16 + , "express_shrug_emote" // 17 + , "express_afraid_emote" // 18 + , "express_worry_emote" // 19 + , "SLEEP" // 20 +]; + + +stopAnim() { + key id = llGetPermissionsKey(); + list anims = llGetAnimationList(id); + integer ix; + for (ix = 0; ix < llGetListLength(anims); ++ix) { + string anim = llList2String(anims, ix); + if (anim != "") { + llStopAnimation(anim); + } + } + llSetTimerEvent(0.0); +} + +startAnim(string anim) { + if (Expression != "") { + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else { + llStartAnimation(Expression); + } + if (ExprEnabled) { + llSetTimerEvent(ExprTimer); + } + } else { + stopAnim(); + } + if (anim != "") { + llStartAnimation(anim); + } +} + +// Animation names with a "*" suffix get open mouth +// Those with a suffix of "::" followed by a number +// get the expression associated with that number. +// This can optionally be followed by another "::" delim, +// with a timer value following. +// Return the anim name without the suffix. +string getExpression(string anim) { + if (llGetSubString(anim,-1,-1) == "*") { + Expression = llList2String(Expressions, 1); + ExprTimer = 0.5; + return llGetSubString(anim, 0, -2); + } + integer ix = llSubStringIndex(anim, "::"); + if (ix == -1) { + Expression = ""; + ExprTimer = 0.5; + return anim; + } + + list parms = llParseString2List(anim, ["::"], []); + anim = llList2String(parms, 0); + integer exprIx = (integer) llList2String(parms, 1); + Expression = llList2String(Expressions, exprIx); + ExprTimer = (float) llList2String(parms,2); + + if (ExprTimer <= 0.0) { + ExprTimer = 0.5; + } + + return anim; +} + +getChan() { + BallNum = (integer) llGetSubString(llGetScriptName(),-1,-1); //offset from script name suffix + ch = BallNum + + (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + state_entry() { + state s_on; + } +} + +state s_on { + state_entry() { + getChan(); + llListen(ch+8,"",NULL_KEY,""); + } + + on_rez(integer arg) { + state default; + } + + link_message(integer from, integer num, string an, key id) { //an animation is set + if (an == "PRIMTOUCH") { + return; + } + + if (num != ch) return; + an = getExpression(an); // get & save expression, and return unadorned anim + + if (avatar == llGetPermissionsKey() + && avatar != NULL_KEY + && animation != "") { + llStopAnimation(animation); + llMessageLinked(LINK_SET, -11002, (string)BallNum + "|" + an, avatar); + startAnim(an); + } + animation = an; + } + + timer() { // timer to keep mouth open + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else if (Expression != "") { + llStartAnimation(Expression); + } + } + + listen(integer channel, string name, key id, string str) { + if (str == "ALIVE" || str == "DIE") { + llMessageLinked(LINK_THIS,2,str,""); //send msg from ball to menu + if (str == "DIE") { + avatar = NULL_KEY; + llSetTimerEvent(0.0); + } + return; + } + + avatar = (key) str; //avatar (sit) or NULL_KEY (stand up) + if (avatar == NULL_KEY) { + if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11001, (string)BallNum, llGetPermissionsKey()); + } + // llReleaseControls(); + return; + } + + if (avatar != llGetPermissionsKey() + || ! (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { + ExprEnabled = TRUE; + llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); + } else { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } + } + + run_time_permissions(integer perm) { + if (avatar != llGetPermissionsKey()) { + llWhisper(DEBUG_CHANNEL, "avatar != perm key"); + return; + } + + if (perm & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } else { + llMessageLinked(LINK_SET, -11001, (string)BallNum, avatar); + llSetTimerEvent(0.0); + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 3.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 3.lsl new file mode 100644 index 0000000..fc976c4 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 3.lsl @@ -0,0 +1,200 @@ +// MPLV2 2.3 by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer ch; +string animation = "stand"; +key avatar; + +integer ExprEnabled = TRUE; +string Expression; +float ExprTimer; + +integer BallNum; + +list Expressions = [ + "" + , "express_open_mouth" // 1 + , "express_surprise_emote" // 2 + , "express_tongue_out" // 3 + , "express_smile" // 4 + , "express_toothsmile" // 5 + , "express_wink_emote" // 6 + , "express_cry_emote" // 7 + , "express_kiss" // 8 + , "express_laugh_emote" // 9 + , "express_disdain" // 10 + , "express_repulsed_emote" // 11 + , "express_anger_emote" // 12 + , "express_bored_emote" // 13 + , "express_sad_emote" // 14 + , "express_embarrassed_emote" // 15 + , "express_frown" // 16 + , "express_shrug_emote" // 17 + , "express_afraid_emote" // 18 + , "express_worry_emote" // 19 + , "SLEEP" // 20 +]; + + +stopAnim() { + key id = llGetPermissionsKey(); + list anims = llGetAnimationList(id); + integer ix; + for (ix = 0; ix < llGetListLength(anims); ++ix) { + string anim = llList2String(anims, ix); + if (anim != "") { + llStopAnimation(anim); + } + } + llSetTimerEvent(0.0); +} + +startAnim(string anim) { + if (Expression != "") { + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else { + llStartAnimation(Expression); + } + if (ExprEnabled) { + llSetTimerEvent(ExprTimer); + } + } else { + stopAnim(); + } + if (anim != "") { + llStartAnimation(anim); + } +} + +// Animation names with a "*" suffix get open mouth +// Those with a suffix of "::" followed by a number +// get the expression associated with that number. +// This can optionally be followed by another "::" delim, +// with a timer value following. +// Return the anim name without the suffix. +string getExpression(string anim) { + if (llGetSubString(anim,-1,-1) == "*") { + Expression = llList2String(Expressions, 1); + ExprTimer = 0.5; + return llGetSubString(anim, 0, -2); + } + integer ix = llSubStringIndex(anim, "::"); + if (ix == -1) { + Expression = ""; + ExprTimer = 0.5; + return anim; + } + + list parms = llParseString2List(anim, ["::"], []); + anim = llList2String(parms, 0); + integer exprIx = (integer) llList2String(parms, 1); + Expression = llList2String(Expressions, exprIx); + ExprTimer = (float) llList2String(parms,2); + + if (ExprTimer <= 0.0) { + ExprTimer = 0.5; + } + + return anim; +} + +getChan() { + BallNum = (integer) llGetSubString(llGetScriptName(),-1,-1); //offset from script name suffix + ch = BallNum + + (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + state_entry() { + state s_on; + } +} + +state s_on { + state_entry() { + getChan(); + llListen(ch+8,"",NULL_KEY,""); + } + + on_rez(integer arg) { + state default; + } + + link_message(integer from, integer num, string an, key id) { //an animation is set + if (an == "PRIMTOUCH") { + return; + } + + if (num != ch) return; + an = getExpression(an); // get & save expression, and return unadorned anim + + if (avatar == llGetPermissionsKey() + && avatar != NULL_KEY + && animation != "") { + llStopAnimation(animation); + llMessageLinked(LINK_SET, -11002, (string)BallNum + "|" + an, avatar); + startAnim(an); + } + animation = an; + } + + timer() { // timer to keep mouth open + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else if (Expression != "") { + llStartAnimation(Expression); + } + } + + listen(integer channel, string name, key id, string str) { + if (str == "ALIVE" || str == "DIE") { + llMessageLinked(LINK_THIS,2,str,""); //send msg from ball to menu + if (str == "DIE") { + avatar = NULL_KEY; + llSetTimerEvent(0.0); + } + return; + } + + avatar = (key) str; //avatar (sit) or NULL_KEY (stand up) + if (avatar == NULL_KEY) { + if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11001, (string)BallNum, llGetPermissionsKey()); + } + // llReleaseControls(); + return; + } + + if (avatar != llGetPermissionsKey() + || ! (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { + ExprEnabled = TRUE; + llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); + } else { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } + } + + run_time_permissions(integer perm) { + if (avatar != llGetPermissionsKey()) { + llWhisper(DEBUG_CHANNEL, "avatar != perm key"); + return; + } + + if (perm & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } else { + llMessageLinked(LINK_SET, -11001, (string)BallNum, avatar); + llSetTimerEvent(0.0); + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 4.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 4.lsl new file mode 100644 index 0000000..fc976c4 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 4.lsl @@ -0,0 +1,200 @@ +// MPLV2 2.3 by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer ch; +string animation = "stand"; +key avatar; + +integer ExprEnabled = TRUE; +string Expression; +float ExprTimer; + +integer BallNum; + +list Expressions = [ + "" + , "express_open_mouth" // 1 + , "express_surprise_emote" // 2 + , "express_tongue_out" // 3 + , "express_smile" // 4 + , "express_toothsmile" // 5 + , "express_wink_emote" // 6 + , "express_cry_emote" // 7 + , "express_kiss" // 8 + , "express_laugh_emote" // 9 + , "express_disdain" // 10 + , "express_repulsed_emote" // 11 + , "express_anger_emote" // 12 + , "express_bored_emote" // 13 + , "express_sad_emote" // 14 + , "express_embarrassed_emote" // 15 + , "express_frown" // 16 + , "express_shrug_emote" // 17 + , "express_afraid_emote" // 18 + , "express_worry_emote" // 19 + , "SLEEP" // 20 +]; + + +stopAnim() { + key id = llGetPermissionsKey(); + list anims = llGetAnimationList(id); + integer ix; + for (ix = 0; ix < llGetListLength(anims); ++ix) { + string anim = llList2String(anims, ix); + if (anim != "") { + llStopAnimation(anim); + } + } + llSetTimerEvent(0.0); +} + +startAnim(string anim) { + if (Expression != "") { + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else { + llStartAnimation(Expression); + } + if (ExprEnabled) { + llSetTimerEvent(ExprTimer); + } + } else { + stopAnim(); + } + if (anim != "") { + llStartAnimation(anim); + } +} + +// Animation names with a "*" suffix get open mouth +// Those with a suffix of "::" followed by a number +// get the expression associated with that number. +// This can optionally be followed by another "::" delim, +// with a timer value following. +// Return the anim name without the suffix. +string getExpression(string anim) { + if (llGetSubString(anim,-1,-1) == "*") { + Expression = llList2String(Expressions, 1); + ExprTimer = 0.5; + return llGetSubString(anim, 0, -2); + } + integer ix = llSubStringIndex(anim, "::"); + if (ix == -1) { + Expression = ""; + ExprTimer = 0.5; + return anim; + } + + list parms = llParseString2List(anim, ["::"], []); + anim = llList2String(parms, 0); + integer exprIx = (integer) llList2String(parms, 1); + Expression = llList2String(Expressions, exprIx); + ExprTimer = (float) llList2String(parms,2); + + if (ExprTimer <= 0.0) { + ExprTimer = 0.5; + } + + return anim; +} + +getChan() { + BallNum = (integer) llGetSubString(llGetScriptName(),-1,-1); //offset from script name suffix + ch = BallNum + + (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + state_entry() { + state s_on; + } +} + +state s_on { + state_entry() { + getChan(); + llListen(ch+8,"",NULL_KEY,""); + } + + on_rez(integer arg) { + state default; + } + + link_message(integer from, integer num, string an, key id) { //an animation is set + if (an == "PRIMTOUCH") { + return; + } + + if (num != ch) return; + an = getExpression(an); // get & save expression, and return unadorned anim + + if (avatar == llGetPermissionsKey() + && avatar != NULL_KEY + && animation != "") { + llStopAnimation(animation); + llMessageLinked(LINK_SET, -11002, (string)BallNum + "|" + an, avatar); + startAnim(an); + } + animation = an; + } + + timer() { // timer to keep mouth open + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else if (Expression != "") { + llStartAnimation(Expression); + } + } + + listen(integer channel, string name, key id, string str) { + if (str == "ALIVE" || str == "DIE") { + llMessageLinked(LINK_THIS,2,str,""); //send msg from ball to menu + if (str == "DIE") { + avatar = NULL_KEY; + llSetTimerEvent(0.0); + } + return; + } + + avatar = (key) str; //avatar (sit) or NULL_KEY (stand up) + if (avatar == NULL_KEY) { + if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11001, (string)BallNum, llGetPermissionsKey()); + } + // llReleaseControls(); + return; + } + + if (avatar != llGetPermissionsKey() + || ! (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { + ExprEnabled = TRUE; + llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); + } else { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } + } + + run_time_permissions(integer perm) { + if (avatar != llGetPermissionsKey()) { + llWhisper(DEBUG_CHANNEL, "avatar != perm key"); + return; + } + + if (perm & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } else { + llMessageLinked(LINK_SET, -11001, (string)BallNum, avatar); + llSetTimerEvent(0.0); + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 5.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 5.lsl new file mode 100644 index 0000000..fc976c4 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser 5.lsl @@ -0,0 +1,200 @@ +// MPLV2 2.3 by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer ch; +string animation = "stand"; +key avatar; + +integer ExprEnabled = TRUE; +string Expression; +float ExprTimer; + +integer BallNum; + +list Expressions = [ + "" + , "express_open_mouth" // 1 + , "express_surprise_emote" // 2 + , "express_tongue_out" // 3 + , "express_smile" // 4 + , "express_toothsmile" // 5 + , "express_wink_emote" // 6 + , "express_cry_emote" // 7 + , "express_kiss" // 8 + , "express_laugh_emote" // 9 + , "express_disdain" // 10 + , "express_repulsed_emote" // 11 + , "express_anger_emote" // 12 + , "express_bored_emote" // 13 + , "express_sad_emote" // 14 + , "express_embarrassed_emote" // 15 + , "express_frown" // 16 + , "express_shrug_emote" // 17 + , "express_afraid_emote" // 18 + , "express_worry_emote" // 19 + , "SLEEP" // 20 +]; + + +stopAnim() { + key id = llGetPermissionsKey(); + list anims = llGetAnimationList(id); + integer ix; + for (ix = 0; ix < llGetListLength(anims); ++ix) { + string anim = llList2String(anims, ix); + if (anim != "") { + llStopAnimation(anim); + } + } + llSetTimerEvent(0.0); +} + +startAnim(string anim) { + if (Expression != "") { + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else { + llStartAnimation(Expression); + } + if (ExprEnabled) { + llSetTimerEvent(ExprTimer); + } + } else { + stopAnim(); + } + if (anim != "") { + llStartAnimation(anim); + } +} + +// Animation names with a "*" suffix get open mouth +// Those with a suffix of "::" followed by a number +// get the expression associated with that number. +// This can optionally be followed by another "::" delim, +// with a timer value following. +// Return the anim name without the suffix. +string getExpression(string anim) { + if (llGetSubString(anim,-1,-1) == "*") { + Expression = llList2String(Expressions, 1); + ExprTimer = 0.5; + return llGetSubString(anim, 0, -2); + } + integer ix = llSubStringIndex(anim, "::"); + if (ix == -1) { + Expression = ""; + ExprTimer = 0.5; + return anim; + } + + list parms = llParseString2List(anim, ["::"], []); + anim = llList2String(parms, 0); + integer exprIx = (integer) llList2String(parms, 1); + Expression = llList2String(Expressions, exprIx); + ExprTimer = (float) llList2String(parms,2); + + if (ExprTimer <= 0.0) { + ExprTimer = 0.5; + } + + return anim; +} + +getChan() { + BallNum = (integer) llGetSubString(llGetScriptName(),-1,-1); //offset from script name suffix + ch = BallNum + + (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + state_entry() { + state s_on; + } +} + +state s_on { + state_entry() { + getChan(); + llListen(ch+8,"",NULL_KEY,""); + } + + on_rez(integer arg) { + state default; + } + + link_message(integer from, integer num, string an, key id) { //an animation is set + if (an == "PRIMTOUCH") { + return; + } + + if (num != ch) return; + an = getExpression(an); // get & save expression, and return unadorned anim + + if (avatar == llGetPermissionsKey() + && avatar != NULL_KEY + && animation != "") { + llStopAnimation(animation); + llMessageLinked(LINK_SET, -11002, (string)BallNum + "|" + an, avatar); + startAnim(an); + } + animation = an; + } + + timer() { // timer to keep mouth open + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else if (Expression != "") { + llStartAnimation(Expression); + } + } + + listen(integer channel, string name, key id, string str) { + if (str == "ALIVE" || str == "DIE") { + llMessageLinked(LINK_THIS,2,str,""); //send msg from ball to menu + if (str == "DIE") { + avatar = NULL_KEY; + llSetTimerEvent(0.0); + } + return; + } + + avatar = (key) str; //avatar (sit) or NULL_KEY (stand up) + if (avatar == NULL_KEY) { + if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11001, (string)BallNum, llGetPermissionsKey()); + } + // llReleaseControls(); + return; + } + + if (avatar != llGetPermissionsKey() + || ! (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { + ExprEnabled = TRUE; + llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); + } else { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } + } + + run_time_permissions(integer perm) { + if (avatar != llGetPermissionsKey()) { + llWhisper(DEBUG_CHANNEL, "avatar != perm key"); + return; + } + + if (perm & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } else { + llMessageLinked(LINK_SET, -11001, (string)BallNum, avatar); + llSetTimerEvent(0.0); + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser.lsl new file mode 100644 index 0000000..fc976c4 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~poser.lsl @@ -0,0 +1,200 @@ +// MPLV2 2.3 by Learjeff Innis, based on +// MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer ch; +string animation = "stand"; +key avatar; + +integer ExprEnabled = TRUE; +string Expression; +float ExprTimer; + +integer BallNum; + +list Expressions = [ + "" + , "express_open_mouth" // 1 + , "express_surprise_emote" // 2 + , "express_tongue_out" // 3 + , "express_smile" // 4 + , "express_toothsmile" // 5 + , "express_wink_emote" // 6 + , "express_cry_emote" // 7 + , "express_kiss" // 8 + , "express_laugh_emote" // 9 + , "express_disdain" // 10 + , "express_repulsed_emote" // 11 + , "express_anger_emote" // 12 + , "express_bored_emote" // 13 + , "express_sad_emote" // 14 + , "express_embarrassed_emote" // 15 + , "express_frown" // 16 + , "express_shrug_emote" // 17 + , "express_afraid_emote" // 18 + , "express_worry_emote" // 19 + , "SLEEP" // 20 +]; + + +stopAnim() { + key id = llGetPermissionsKey(); + list anims = llGetAnimationList(id); + integer ix; + for (ix = 0; ix < llGetListLength(anims); ++ix) { + string anim = llList2String(anims, ix); + if (anim != "") { + llStopAnimation(anim); + } + } + llSetTimerEvent(0.0); +} + +startAnim(string anim) { + if (Expression != "") { + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else { + llStartAnimation(Expression); + } + if (ExprEnabled) { + llSetTimerEvent(ExprTimer); + } + } else { + stopAnim(); + } + if (anim != "") { + llStartAnimation(anim); + } +} + +// Animation names with a "*" suffix get open mouth +// Those with a suffix of "::" followed by a number +// get the expression associated with that number. +// This can optionally be followed by another "::" delim, +// with a timer value following. +// Return the anim name without the suffix. +string getExpression(string anim) { + if (llGetSubString(anim,-1,-1) == "*") { + Expression = llList2String(Expressions, 1); + ExprTimer = 0.5; + return llGetSubString(anim, 0, -2); + } + integer ix = llSubStringIndex(anim, "::"); + if (ix == -1) { + Expression = ""; + ExprTimer = 0.5; + return anim; + } + + list parms = llParseString2List(anim, ["::"], []); + anim = llList2String(parms, 0); + integer exprIx = (integer) llList2String(parms, 1); + Expression = llList2String(Expressions, exprIx); + ExprTimer = (float) llList2String(parms,2); + + if (ExprTimer <= 0.0) { + ExprTimer = 0.5; + } + + return anim; +} + +getChan() { + BallNum = (integer) llGetSubString(llGetScriptName(),-1,-1); //offset from script name suffix + ch = BallNum + + (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim +} + +default { + state_entry() { + state s_on; + } +} + +state s_on { + state_entry() { + getChan(); + llListen(ch+8,"",NULL_KEY,""); + } + + on_rez(integer arg) { + state default; + } + + link_message(integer from, integer num, string an, key id) { //an animation is set + if (an == "PRIMTOUCH") { + return; + } + + if (num != ch) return; + an = getExpression(an); // get & save expression, and return unadorned anim + + if (avatar == llGetPermissionsKey() + && avatar != NULL_KEY + && animation != "") { + llStopAnimation(animation); + llMessageLinked(LINK_SET, -11002, (string)BallNum + "|" + an, avatar); + startAnim(an); + } + animation = an; + } + + timer() { // timer to keep mouth open + if (Expression == "SLEEP") { + llStartAnimation("express_disdain"); + llStartAnimation("express_smile"); + } else if (Expression != "") { + llStartAnimation(Expression); + } + } + + listen(integer channel, string name, key id, string str) { + if (str == "ALIVE" || str == "DIE") { + llMessageLinked(LINK_THIS,2,str,""); //send msg from ball to menu + if (str == "DIE") { + avatar = NULL_KEY; + llSetTimerEvent(0.0); + } + return; + } + + avatar = (key) str; //avatar (sit) or NULL_KEY (stand up) + if (avatar == NULL_KEY) { + if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11001, (string)BallNum, llGetPermissionsKey()); + } + // llReleaseControls(); + return; + } + + if (avatar != llGetPermissionsKey() + || ! (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { + ExprEnabled = TRUE; + llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); + } else { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } + } + + run_time_permissions(integer perm) { + if (avatar != llGetPermissionsKey()) { + llWhisper(DEBUG_CHANNEL, "avatar != perm key"); + return; + } + + if (perm & PERMISSION_TRIGGER_ANIMATION) { + stopAnim(); + llMessageLinked(LINK_SET, -11000, (string)BallNum + "|" + animation, avatar); + startAnim(animation); + } else { + llMessageLinked(LINK_SET, -11001, (string)BallNum, avatar); + llSetTimerEvent(0.0); + } + } +} diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~props.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~props.lsl new file mode 100644 index 0000000..a731d77 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~props.lsl @@ -0,0 +1,397 @@ +//Imported by X-Avatar.de +//MPLV2 Version 2.3 by Learjeff Innis, based on +//MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) + + +// v2.2 - rotate all props + +// This script handles props (object rezzed for a given pose) + +integer Checking = FALSE; // whether doing consistency check + +integer Line; +integer PoseCount; +list Poses; // name of each pose with a prop +list Positions; // position of prop, indexed as Poses +list Props; // name of each prop object, indexed as Poses + +string Pose; // current pose name + +integer ChatChan; // chan for talking to object + +init() +{ + ChatChan = - 1 - (integer)llFrand(-DEBUG_CHANNEL); + getRefPos(); +} + +vector RefPos; +rotation RefRot; + +getRefPos() { //reference position + RefPos = llGetPos(); + RefRot = llGetRot(); + integer z = (integer)llGetObjectDesc(); + RefPos.z += (float)z/100.0; +} + +string plural(string singular, string plural, integer count) { + if (count != 1) { + return plural; + } + return singular; +} + +announce() +{ + llOwnerSay((string)PoseCount + + plural(" pose", " poses", PoseCount) + + " with props (" + + llGetScriptName() + + ": " + + (string)llGetFreeMemory() + + " bytes free)"); +} + +string adjust(integer doOffset, vector pos, vector erot, vector amt) { + if (doOffset) { + pos += amt/100.; + return (vround(pos) + "/" + vround(erot)); + } + rotation amount = llEuler2Rot(amt * DEG_TO_RAD); + erot *= DEG_TO_RAD; + + rotation oldrot = llEuler2Rot(erot); + rotation newrot = oldrot / amount; + + erot = llRot2Euler(newrot) * RAD_TO_DEG; + pos = pos / amount; + return(vround(pos) + "/" + vround(erot)); +} + + +adjust_all(integer doOffset, vector amt) { + integer ix; + integer bx; + string data; + list ldata; + vector pos; + vector erot; + + + for (ix = 0; ix < llGetListLength(Poses); ++ix) { + data = llList2String(Positions, ix); + ldata = llParseString2List(data, ["/"], []); + pos = (vector)llList2String(ldata, 0); + erot = (vector)llList2String(ldata, 1); + + data = adjust(doOffset, pos, erot, amt); + Positions = llListReplaceList(Positions, (list)data, ix, ix); + } + llOwnerSay("Prop rotation complete"); +} + + + +string roundData(string data) { + list ldata = llParseString2List(data, ["/"], []); + return (vround((vector)llList2String(ldata, 0)) + "/" + vround((vector)llList2String(ldata, 1))); +} + +// round a vector's components and return as vector value string +string vround(vector vec) { + return ("<"+round(vec.x, 3)+","+round(vec.y, 3)+","+round(vec.z, 3)+">"); +} + +string round(float number, integer places) { + float shifted; + integer rounded; + string s; + shifted = number * llPow(10.0,(float)places); + rounded = llRound(shifted); + s = (string)((float)rounded / llPow(10.0,(float)places)); + s = llGetSubString(s,0,llSubStringIndex(s, ".")+places); + return s; +} + + +add_prop(string pose, string prop, string data) { + if (llListFindList(Props, (list)pose) != -1) { + llOwnerSay("Multiple *.PROPS* entries for pose '" + pose + "'"); + } + if (llGetInventoryType(prop) != INVENTORY_OBJECT) { + llOwnerSay("Warning: can't find prop '" + prop + "' in inventory"); + } + Poses = (list) pose; + Props = (list) prop; + Positions = (list) roundData(data); + ++PoseCount; +} + +string get_pose_data(string pose) +{ + integer ix = llListFindList(Poses, (list)pose); + + if (ix == -1) { + return ""; + } + + return llList2String(Positions, ix); +} + +save_prop(string pose, string prop, string data) { + integer ix = llListFindList(Poses, [pose]); + if (ix == -1) { + // llSay(0, "new pose"); + add_prop(pose, prop, data); // don't expect this to happen + return; + } + + // if the prop object name doesn't match, ignore it -- assume it's noise + if (llList2String(Props, ix) != prop) { + return; + } + + // Data is the change in position since we rezzed it, in global coords + // Convert delta to local axes + + list ldata = llParseString2List(data, ["/"], []); + vector pos = (vector) llList2String(ldata, 0); + rotation rot = (rotation)llList2String(ldata, 1); + + pos = pos / RefRot; + vector erot = llRot2Euler(rot/RefRot) * RAD_TO_DEG; + + // Now add to saved data (since it was a delta) + ldata = llParseStringKeepNulls(llList2String(Positions, ix), ["/"], []); + vector oldpos = (vector)llList2String(ldata, 0); + + pos += oldpos; + data = vround(pos) + "/" + vround(erot); + + Props = llListReplaceList(Props, (list)prop, ix, ix); + Positions = llListReplaceList(Positions, (list)data, ix, ix); + + string name = llGetObjectName(); + llSetObjectName(""); + llOwnerSay("| " + pose + " | " + prop + " | " + data); + llSetObjectName(name); +} + +rez_prop(string pose) { + llSay(ChatChan, "DIE"); + integer ix = -1; //(integer)llListFindList(Poses, [pose]); + integer ggt =0; + for (ggt=0; ggt < llGetListLength(Poses); ggt++) + { + if (llList2String(Poses,ggt) == pose) + { + ix = ggt; + ggt = llGetListLength(Poses); + } + } + if (ix == -1) + { + Pose = ""; + llSetTimerEvent(0.0); + return; + } + string prop = llList2String(Props, ix); + string data = llList2String(Positions, ix); + list ldata = llParseString2List(data, ["/"], []); + vector pos = (vector)llList2String(ldata, 0); + vector erot = (vector)llList2String(ldata, 1); + + pos = pos * RefRot + RefPos; + rotation rot = llEuler2Rot(erot*DEG_TO_RAD) * RefRot; + + // llSay(0, "rezzing '" + prop + "' at " + (string) pos); + llRezAtRoot(prop, pos, <0.,0.,0.>, rot, ChatChan); + llSetTimerEvent(60.0); + Pose = pose; +} + + +dashes() { + llOwnerSay("_______________________________________________________________________________"); + llOwnerSay(""); +} + + +// Globals for reading card config +integer ConfigLineIndex; +list ConfigCards; // list of names of config cards +string ConfigCardName; // name of card being read +integer ConfigCardIndex; // index of next card to read +key ConfigQueryId; + +integer next_card() +{ + if (ConfigCardIndex >= llGetListLength(ConfigCards)) { + ConfigCards = []; + return (FALSE); + } + + ConfigLineIndex = 0; + ConfigCardName = llList2String(ConfigCards, ConfigCardIndex); + ConfigCardIndex++; + ConfigQueryId = llGetNotecardLine(ConfigCardName, ConfigLineIndex); + llOwnerSay("Reading " + ConfigCardName); + return (TRUE); +} + + +default { + state_entry() { + llSleep(0.25); // give ~run a chance to shut us down + string item; + ConfigCards = []; + integer n = llGetInventoryNumber(INVENTORY_NOTECARD); + while (n-- > 0) { + item = llGetInventoryName(INVENTORY_NOTECARD, n); + if (llSubStringIndex(item, ".PROPS") != -1) { + ConfigCards = (list) item; + } + } + + ConfigCardIndex = 0; + ConfigCards = llListSort(ConfigCards, 1, TRUE); + next_card(); + } + + dataserver(key query_id, string data2) { + if (query_id != ConfigQueryId) { + return; + } + if (data2 == EOF) { + if (next_card()) { + return; + } + state on; + } + + string data3 = llStringTrim(data2, STRING_TRIM); + if (llGetSubString(data3,0,0) != "/" && llStringLength(data3)) { // skip comments and blank lines + + list ldata = llParseStringKeepNulls(data3, [" | "," | "," | "," | "," |","| ","|"], []); + if (llGetListLength(ldata) != 4) { + llOwnerSay(llGetScriptName() + ": error in " + ConfigCardName + ":" + (string)ConfigLineIndex + + " - need exactly 3 vertical bars - line ignored"); + } else { + string pose = llList2String(ldata, 1); + string prop = llList2String(ldata, 2); + string data = llStringTrim(llList2String(ldata, 3), STRING_TRIM); + if (data3 == "") { + data3 = "<0,0,1>/<0,0,0>"; + } + add_prop(pose, prop, data3); + } + } + ++ConfigLineIndex; + ConfigQueryId = llGetNotecardLine(ConfigCardName, ConfigLineIndex); //read next line of positions notecard + } + + state_exit() { + // do one save to indicate actual amount of available memory + string position = llList2String(Positions, 0); + Positions = llListReplaceList(Positions, [position],0,0); + + llMessageLinked(LINK_THIS, 2, "OK", (key)""); //msg to menu, in case it's waiting for loading + announce(); + } +} + +state re_on +{ + state_entry() { + state on; + } +} + +state on { + state_entry() { + init(); + llListen(ChatChan, "", NULL_KEY, ""); + } + + on_rez(integer arg) { + state re_on; + } + + listen(integer chan, string name, key id, string msg) { + // llSay(0, name + ": " + msg); + if (Pose == "") { + return; + } + save_prop(Pose, name, msg); + announce(); + } + + link_message(integer from, integer num, string str, key dkey) { + + if (str == "PRIMTOUCH" || num < 0) { + return; + } + + if (num == 0) { + if (str == "POSEB") { + rez_prop((string)dkey); + return; + } + if (str == "REPOS") { + getRefPos(); + return; + } + return; + } + + if (num != 1) { + return; + } + + if (str == "STOP") { + llSay(ChatChan, "DIE"); + Pose = ""; + llSetTimerEvent(0.0); + } + + if (str == "DUMPPROPS") { + dashes(); + llOwnerSay("Copy to .PROPS; delete any other *.PROPS* cards"); + dashes(); + string name = llGetObjectName(); + llSetObjectName(""); + + integer ix; + for (ix = 0; ix < PoseCount; ++ix) { + string pose = llList2String(Poses, ix); + string prop = llList2String(Props, ix); + llOwnerSay("| " + pose + " | " + prop + " | " + get_pose_data(pose)); + } + llSetObjectName(name); + dashes(); + } else if (llSubStringIndex(str, "REORIENT=") == 0) { + // Reorient command (LINKMENU command from .MENUITEMS file) + // str format: REORIENT=OFF= or REORIENT=ROT= (in degrees) + list parms = llParseString2List(str, ["="], []); + vector amount = (vector)llList2String(parms, 2); + llWhisper(0, "Adjusting props, please wait"); + + if (llList2String(parms, 1) == "OFF") { + adjust_all(TRUE, amount); + } else { + adjust_all(FALSE, amount); + } + llMessageLinked(LINK_THIS, 0, "AGAIN", (key)""); + llWhisper(0, "Prop adjustment complete"); + } else if (str == "SAVEPROP") { + llSay(ChatChan, "SAVE"); + } + } + + timer() { + llSay(ChatChan, "LIVE"); + } + +} + diff --git a/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~run.lsl b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~run.lsl new file mode 100644 index 0000000..2d56983 --- /dev/null +++ b/media/Test%20sim/objects/onefang%27s%20test%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/~run.lsl @@ -0,0 +1,194 @@ +//MLPV2 Version 2.3 - Learjeff Innis, from +//MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License) +//To donate, go to my profile (Search - People - Miffy Fluffy) and use the "Pay..." button, thanks! +//You can also find the link to the latest version here. +// OpenSim port by Jez Ember +// Meta 7 fixes by onefang Rejected + +integer MAX_AVS = 6; +integer ResetOnOwnerChange = FALSE; + +// DESCRIPTION OF THE SCRIPTS +// +// ~run: +// Default: sets other scripts to not running. +// When the object is touched it will start all scrips. +// +// ~memory: +// Here the positions are stored permanently. Information is still kept when the script is +// not running or when everything is placed in inventory. The information will be lost only +// when the ~memory script is reset. +// A backup can be made on the .POSITIONS notecard, when the memory is empty, it will start +// reading the .POSITIONS notecard automatically. +// +// ~menu: +// 1.loading: reads the .MENUITEMS notecard and builds the menu. +// When it reads a "POSE": - the animations are stored in ~pose +// - their matching positions are looked up in ~memory and stored +// in ~pos. +// 2.ready: +// When the object is touched: - shows the main menu +// - listens for menu selections. +// +// When a submenu is selected: - shows the submenu +// - when balls are defined for this submenu it will rez +// balls (if not already there) and set their colors. +// +// When a pose is selected: - ~pose will send the animations to ~pose1 and ~pose2, +// they will set the animations to the avatars +// - ~pos wil send the matching positions to each ball. +// +// When a position is saved: - ~pose will ask the balls for their position +// - the positions are saved in ~memory ("permanent") +// - the positions are updated in ~pos +// +// When "STOP" is selected: - will hide the balls +// - will stop the pose +// When "STOP" is selected again (or if no pose is started yet): +// - will remove the balls (derez/die) +// +// ~pos: +// - loads the positions from ~memory and stores them (until shutdown/restart) +// - sends positions for the selected pose to the balls +// +// ~pose: +// - loads the animations from the .MENUITEMS notecard and stores them (until shutdown/restart) +// - sends animations for the selected pose to ~pose1 and ~pose2 +// - when saving a position: will ask balls for their position and sends it to ~pos and ~memory +// (~pos would be a more logical place to handle this, but ~pose has more free memory). +// +// ~poser, ~poser 1, ~poser 2, ~poser 3 (one for each ball): +// - will ask permission to animate the avatar on ball +// - will set the animations to avatar +// +// ~ball +// - when balls are defined for a submenu (in .MENUITEMS), ~menu will rez copies of ~ball +// - each will receive a unique communication channel from ~menu +// - the color for each ball is set by ~menu +// - the position of each ball is set by ~pos +// - when an avatar selects to sit on a ball, the avatar info is sent to the appropriate; they +// will ask permission and set the animation directly to the avatar (not via the ball) +// - balls will commit suicide when they don't hear a "LIVE" message each minute (from ~menu). +// +// have fun! + +//Note: if you make a revised version, please mention something like this: +//"MLP - alternative version by ... .... - Revision 1 (based on MLP V1.2 by Miffy Fluffy) + +key Owner; + +list Scripts = [ + "~menucfg" + , "~pos" + , "~pose" + , "~poser" + , "~poser 1" + , "~poser 2" + , "~poser 3" + , "~poser 4" + , "~poser 5" + ]; + +list OptionalScripts = [ + "~props" + , "~sequencer" + ]; + +setRunning(integer st) { + integer ix; + list scripts = Scripts; + string script; + + for (ix = 0; ix < 100; ++ix) { + integer jx; + + // try to stop any remaining scripts in the list + for (jx = llGetListLength(scripts) - 1; jx >= 0; --jx) { + script = llList2String(scripts, jx); + if (llGetInventoryType(script) == INVENTORY_SCRIPT) { + llSetScriptState(script, st); + scripts = llDeleteSubList(scripts, jx, jx); + --jx; + } + } + + // got them all yet? + if (llGetListLength(scripts) == 0) { + // Yes -- handle key ones + llSetScriptState("~memory", st); + llSetScriptState("~menu", st); + if (st) { + llResetOtherScript("~memory"); + llResetOtherScript("~menu"); + } + + // start/stop optional scripts if present + for (jx = llGetListLength(OptionalScripts) - 1; jx >= 0; --jx) { + script = llList2String(OptionalScripts, jx); + if (llGetInventoryType(script) == INVENTORY_SCRIPT) { + llSetScriptState(script, st); + } + } + return; + } + + llSleep(0.1); + } + + llOwnerSay("missing scripts: " + llList2CSV(scripts)); +} + +setBalls(string cmd) { + integer ch = channel(); + integer ix; + + for (ix = 0; ix < MAX_AVS; ++ix) { + llSay(ch + ix, cmd); //msg to balls + } +} + +integer channel() { + return (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); +} + +default { + + state_entry() { + setBalls("DIE"); + Owner = llGetOwner(); + setRunning(FALSE); + llOwnerSay("OFF (touch to switch on)"); + } + + touch_start(integer i) { +llOwnerSay("SOMEONE TOUCHED ME!!!!"); + if (llDetectedKey(0) == llGetOwner()) state run; + } + + // Waits for another script to send a link message. + link_message(integer sender_num, integer num, string str, key id) { + if (str == "PRIMTOUCH" && id == llGetOwner()) { + state run; + } + } + + changed(integer change) { + if (change & CHANGED_OWNER && Owner != llGetOwner()) { + llResetScript(); + } + } +} + +state run { + state_entry() { +llOwnerSay("RUNNING NOW."); + setRunning(TRUE); + } + changed(integer change) { + if (ResetOnOwnerChange + && (change & CHANGED_OWNER) + && Owner != llGetOwner()) { + llResetScript(); + } + } +} diff --git a/media/Test%20sim/objects/test.lsl b/media/Test%20sim/objects/test.lsl new file mode 100644 index 0000000..6e1d915 --- /dev/null +++ b/media/Test%20sim/objects/test.lsl @@ -0,0 +1,14 @@ + +default +{ + state_entry() + { + llSay(0, /* */ 4 /* c */ + /* c0 */ 2 /* c1 */ * /* c2 */ 10 /* c3 */ + /* c4 */ + 3 /* c5 */ * /* c6 */ ( /* c7 */ 5 /* c8 */ + /* c9 */ 1 /* cA */ ) /* cB */) ; /* cE */ + // Some more arithmetic - + llSay(0, 1+1); + llSay(0, 20.5 + 20 + 1.5); + } +} + +// This is the end my friend. \ No newline at end of file -- cgit v1.1