diff --git a/Walk-On-the-moon/Walk-On-the-moon/Moon/Moon Home.lsl b/Walk-On-the-moon/Walk-On-the-moon/Moon/Moon Home.lsl new file mode 100644 index 00000000..1597fdef --- /dev/null +++ b/Walk-On-the-moon/Walk-On-the-moon/Moon/Moon Home.lsl @@ -0,0 +1,316 @@ +// :CATEGORY:World +// :NAME:Walk-On-the-moon +// :AUTHOR:Ferd Frederix +// :CREATED:2013-11-19 16:49:18 +// :ID:1003 +// :REV:2 +// :WORLD:Second Life, OPensim +// :DESCRIPTION: +// Sphere script for XS pets to walk on a planet or moon +// Optionall put this script in a sphere and put the Poseball script in a pose ball. +// XS pets using ther same secret key and channels can then walk and live on this little moon. + + +// Version 2 + +// original script by Xundra Snowpaw +// mods by Ferd Frederix +// revisions: +// 10-3-2011 Mod by Ferd to listen to HOME_CHANNEL, not -237918, the original src has no other reference to that channel. +// 11-16-2011 Use latest globals from GLobal Constants +// +// New BSD License: http://www.opensource.org/licenses/bsd-license.php +// Copyright (c) 2010, Xundra Snowpaw +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +//* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +//* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +//////////////////////////////////////////////////////////////////// + + + +/////////////////////////////////////////////// +// COPY FROM GLOBAL CONSTANTS FILE LOCATED IN Debug Folder +// INCLUDE THESE IN ALL SCRIPTS // +// XS_pet constants and names + +///// GLOBAL CONSTANTS extracted from original source ////// +// +// if you change any of these constants, change it everywhere and in a list in XS_Debug so it can print them +// +// 0.24 is the original Pet Quail +// 0.25 is the modified Pet Quail +// 0.26 is the Robot code, which is generic + +float VERSION = 0.28; +integer ENCRYPT = FALSE; +key YOUR_UUID = ""; // if you add a UUID for your avatar here, you can change it later + // and other alts or feruiends can edit and make these pets + // If you leave it blank, only the creator can work on them +string Animal = "Troubot"; // was 'Quail', must be the name of your animal +string Egg = "Nut and Bolt"; // was 'XS Egg', must be the name of your egg +string Crate = "Transport UFO"; // was XS-Cryocrate +string HomeObject = "Home Flag"; // was "XS Home Object +string sound = "robot_sound"; +string SECRET_PASSWORD = "top secret robot"; // must use one unique to any animal +integer SECRET_NUMBER = 99999; // any number thats a secret + +integer MaxAge = 7; // can get prggers in 7 days +integer UNITS_OF_FOOD = 168; // food bowl food +float secs_to_grow = 86400; // grow daily = 86400 + +// global listeners + +integer FOOD_CHANNEL = -999191; +integer ANIMAL_CHANNEL = -999192; +integer EGG_CHANNEL = -999193; +integer HOME_CHANNEL = -999194; +integer BOX_CHANNEL = -999195; +integer ACC_CHANNEL = -999196; +integer UPDATE_CHANNEL = -999197; +integer API_CHANNEL = -999198; + +// global prim animation linkmessages on channel 1 +// these are the prim animations played for each type of possible animation + +string ANI_STAND = "stand"; // default standing animation +string ANI_WALKL = "left"; // triggers Left foot and righrt arm walk animation +string ANI_WALKR = "right"; // triggers Right foot and left arm walk animation +string ANI_SLEEP = "sleep"; // Sleeping +string ANI_WAVE = "wave"; // Calling for sex, needs help with food, etc. + + + +// global link messages to control the animal +integer LINK_AGE_START = 800; // when quail is rezzed and secret_number, is sent by brain to breeder, eater and informatic get booted up +integer LINK_FOOD_CONSUME = 900; // from movement to brain when close to food, brain then consumes a random amount up to 10000 +integer LINK_FOODMINUS = 901; // xs_brain receives FOOD_CONSUME, decrement hunger (eat) +integer LINK_HUNGRY = 903; // sent by eater (string)hunger_amount, checks each hour +integer LINK_HAMOUNT = 904; // hunger_amount = (integer)str,m updates the hunger amount in scripts +integer LINK_SET_HOME = 910; // loc ^ dist +integer LINK_MOVER = 911; // tell mover to rest for str seconds +integer LINK_FOODIE_CLR = 920; // clear all food_bowl_keys and contents +integer LINK_FOODIE = 921; // send FOOD_LOCATION coordinates to movement +integer LINK_COLOR1 = 930; // colour1 +integer LINK_COLOR2 = 931; // colour2 +integer LINK_SEX = 932; // sex +integer LINK_SHINE = 933; // shine +integer LINK_GLOW = 934; // glow +integer LINK_GEN = 935; // generation +integer LINK_RESET_SIZE = 936; // reset size to 1 +integer LINK_MAGE = 940; // xs_brain sends, xs_ager consumes, adds str to age, if older than 7 days, will grow the animal +integer LINK_DAYTIME = 941; // xs_ager consumes, starts a timer of 86,400 seconds in xs_ager +integer LINK_GET_AGE = 942; // get age from xs_ager and sent it on channel 943 +integer LINK_PUT_AGE = 943; // print age from xs_ager +integer LINK_PACKAGE = 950; // look for a cryo_crate +integer LINK_SEEK_FEMALE = 960; // MALE_BREED_CALL +integer LINK_MALE_BREED_CALL = 961; // triggered by LINK_SEEK_FEMALE +integer LINK_SIGNAL_ELIGIBLE = 962; // sent by female when hears LINK_MALE_BREED_CALL +integer LINK_FEMALE_ELIGIBLE = 963; // sent when it hears in chat FEMALE_ELIGIBLE +integer LINK_CALL_MALE = 964; // if LINK_FEMALE_ELIGIBLE && looking_for_female +integer LINK_MALE_ON_THE_WAY = 965; // triggered by LINK_CALL_MALE +integer LINK_FEMALE_LOCATION = 966; // female location, sends coordinates of a female +integer LINK_RQST_BREED = 967; // sent when close enough to male/female +integer LINK_CALL_MALE_INFO = 968; // sent by xs_breeding, this line of code was in error in v.24 of xs_breeding see line 557 and 636 of xs_brain which make calls and also xs_breeding which receives LINK_MALE_INFO. +integer LINK_MALE_INFO = 969; +integer LINK_LAY_EGG = 970; // llRezObject("XS Egg" +integer LINK_BREED_FAIL = 971; // key = father, failed, timed out +integer LINK_PREGNANT = 972; // chick is preggers +integer LINK_SOUND_ON= 973; // sound is on +integer LINK_SOUND_OFF= 974; // sound is off +integer LINK_SLEEPING = 990; // close eyes +integer LINK_UNSLEEPING = 991; // open eyes +integer LINK_SOUND = 1001; // plays a sound if enabled +integer LINK_SPECIAL = 1010; // xs_special, is str = "Normal", removes script +integer LINK_PREGNANCY_TIME = 5000; // in seconds as str +integer LINK_SLEEP = 7999; // disable sleep by parameter +integer LINK_TIMER = 8000; // scan for food bowl about every 1800 seconds +integer LINK_DIE = 9999; // death + + +///////// end global Link constants //////// + + +///////////// END OF COPIED CODE //////////// + + +/////// DON'T CHANGE THE FOLLOWING! (Unless you know what you are doing!) + +integer XTEA_DELTA = 0x9E3779B9; // (sqrt(5) - 1) * 2^31 +integer xtea_num_rounds = 6; +list xtea_key = [0, 0, 0, 0]; + +integer hex2int(string hex) { + if(llGetSubString(hex,0,1) == "0x") + return (integer)hex; + if(llGetSubString(hex,0,0) == "x") + return (integer)("0"+hex); + return(integer)("0x"+hex); +} + + +// Convers any string to a 32 char MD5 string and then to a list of +// 4 * 32 bit integers = 128 bit Key. MD5 ensures always a specific +// 128 bit key is generated for any string passed. +list xtea_key_from_string( string str ) +{ + str = llMD5String(str,0); // Use Nonce = 0 + return [ hex2int(llGetSubString( str, 0, 7)), + hex2int(llGetSubString( str, 8, 15)), + hex2int(llGetSubString( str, 16, 23)), + hex2int(llGetSubString( str, 24, 31))]; +} + +// Encipher two integers and return the result as a 12-byte string +// containing two base64-encoded integers. +string xtea_encipher( integer v0, integer v1 ) +{ + integer num_rounds = xtea_num_rounds; + integer sum = 0; + do { + // LSL does not have unsigned integers, so when shifting right we + // have to mask out sign-extension bits. + v0 += (((v1 << 4) ^ ((v1 >> 5) & 0x07FFFFFF)) + v1) ^ (sum + llList2Integer(xtea_key, sum & 3)); + sum += XTEA_DELTA; + v1 += (((v0 << 4) ^ ((v0 >> 5) & 0x07FFFFFF)) + v0) ^ (sum + llList2Integer(xtea_key, (sum >> 11) & 3)); + + } while( num_rounds = ~-num_rounds ); + //return only first 6 chars to remove "=="'s and compact encrypted text. + return llGetSubString(llIntegerToBase64(v0),0,5) + + llGetSubString(llIntegerToBase64(v1),0,5); +} + +// Decipher two base64-encoded integers and return the FIRST 30 BITS of +// each as one 10-byte base64-encoded string. +string xtea_decipher( integer v0, integer v1 ) +{ + integer num_rounds = xtea_num_rounds; + integer sum = XTEA_DELTA*xtea_num_rounds; + do { + // LSL does not have unsigned integers, so when shifting right we + // have to mask out sign-extension bits. + v1 -= (((v0 << 4) ^ ((v0 >> 5) & 0x07FFFFFF)) + v0) ^ (sum + llList2Integer(xtea_key, (sum>>11) & 3)); + sum -= XTEA_DELTA; + v0 -= (((v1 << 4) ^ ((v1 >> 5) & 0x07FFFFFF)) + v1) ^ (sum + llList2Integer(xtea_key, sum & 3)); + } while ( num_rounds = ~-num_rounds ); + + return llGetSubString(llIntegerToBase64(v0), 0, 4) + + llGetSubString(llIntegerToBase64(v1), 0, 4); +} + +// Encrypt a full string using XTEA. +string xtea_encrypt_string( string str ) +{ + if (! ENCRYPT) + return str; + // encode string + str = llStringToBase64(str); + // remove trailing =s so we can do our own 0 padding + integer i = llSubStringIndex( str, "=" ); + if ( i != -1 ) + str = llDeleteSubString( str, i, -1 ); + + // we don't want to process padding, so get length before adding it + integer len = llStringLength(str); + + // zero pad + str += "AAAAAAAAAA="; + + string result; + i = 0; + + do { + // encipher 30 (5*6) bits at a time. + result += xtea_encipher(llBase64ToInteger(llGetSubString(str, i, i + 4) + "A="), llBase64ToInteger(llGetSubString(str, i+5, i + 9) + "A=")); + i+=10; + } while ( i < len ); + + return result; +} + +// Decrypt a full string using XTEA +string xtea_decrypt_string( string str ) { + if (! ENCRYPT) + return str; + integer len = llStringLength(str); + integer i=0; + string result; + //llOwnerSay(str); + do { + integer v0; + integer v1; + + v0 = llBase64ToInteger(llGetSubString(str, i, i + 5) + "=="); + i+= 6; + v1 = llBase64ToInteger(llGetSubString(str, i, i + 5) + "=="); + i+= 6; + + result += xtea_decipher(v0, v1); + } while ( i < len ); + + // Replace multiple trailing zeroes with a single one + + i = llStringLength(result) - 1; + while ( llGetSubString(result, i - 1, i) == "AA" ){ + result = llDeleteSubString(result, i, i); + i--; + } + i = llStringLength(result) - 1; + // while (llGetSubString(result, i, i + 1) == "A" ) { + // i--; + // } + result = llGetSubString(result, 0, i+1); + i = llStringLength(result); + integer mod = i%4; //Depending on encoded length diffrent appends are needed + if(mod == 1) result += "A=="; + else if(mod == 2 ) result += "=="; + else if(mod == 3) result += "="; + + return llBase64ToString(result); +} + +string base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +//tunables +integer world = TRUE; + +default +{ + state_entry() + { + xtea_key = xtea_key_from_string(SECRET_PASSWORD); + llListen(HOME_CHANNEL, "", "", "XSPET_PING_HOME"); // listen for a pet to say XSPET_PING_HOME - Mod by Ferd to listen to HOME_CHANNEL, not -237918 + + } + + touch_start(integer total_number) + { + if (llDetectedKey(0) == llGetOwner()) { + vector size = llGetScale(); + vector pos = llGetPos(); + if (!world) + pos.z = pos.z - size.z / 2; + + llRegionSay(ANIMAL_CHANNEL, xtea_encrypt_string("XSPET^HOME_LOCATION^" + (string)pos + "^" + llGetObjectDesc())); + } + llOwnerSay("Setting Home Location"); + } + + listen(integer channel, string name, key id, string msg) + { + vector size = llGetScale(); + vector pos = llGetPos(); + if (!world) + pos.z = pos.z - size.z / 2; + + llRegionSay(ANIMAL_CHANNEL, xtea_encrypt_string("XSPET^HOME_LOCATION^" + (string)pos + "^" + llGetObjectDesc())); + } +} + + + + diff --git a/Walk-On-the-moon/Walk-On-the-moon/Moon/Slow rotation.lsl b/Walk-On-the-moon/Walk-On-the-moon/Moon/Slow rotation.lsl new file mode 100644 index 00000000..8ed2e548 --- /dev/null +++ b/Walk-On-the-moon/Walk-On-the-moon/Moon/Slow rotation.lsl @@ -0,0 +1,20 @@ +// :CATEGORY:World +// :NAME:Walk-On-the-moon rotate +// :AUTHOR:Ferd Frederix +// :CREATED:2013-11-19 16:49:18 +// :ID:1003 +// :REV:2 +// :WORLD:Second Life, Opensim +// :DESCRIPTION: +// an optional script to slowly rotate the moon +// :CODE: + + +default +{ + state_entry() + { + llTargetOmega(<.5,0.0,0.0>*llGetRot(),0.1,0.01); + } + +} diff --git a/Walk-On-the-moon/Walk-On-the-moon/Moon/moon script.lsl b/Walk-On-the-moon/Walk-On-the-moon/Moon/moon script.lsl index 6f830ee4..9abb042b 100644 --- a/Walk-On-the-moon/Walk-On-the-moon/Moon/moon script.lsl +++ b/Walk-On-the-moon/Walk-On-the-moon/Moon/moon script.lsl @@ -1,26 +1,26 @@ -// :CATEGORY:World -// :NAME:Walk-On-the-moon +// :CATEGORY:Sphere World +// :NAME:Walk-On-The-Moon // :AUTHOR:Ferd Frederix -// :CREATED:2013-11-19 16:49:18 -// :EDITED:2013-11-19 16:49:18 +// :CREATED:2013-11-19 16:49:29 // :ID:1003 // :NUM:1543 -// :REV:1.1 +// :REV:2 // :WORLD:Second Life // :DESCRIPTION: // Sphere script for walking on a planet or moon -// put this in a sphere and put the other script in a pose ball. -// touch the sphere, then sit on the poae ball +// put these three scripts in a sphere and put the Poseball script in a pose ball. +// touch the sphere to train them, then sit on the pose ball. You can have multiple pose balls. + // :CODE: - - +// Sphere script for walking on a planet or moon // global listeners integer To_Pose_CHANNEL = 9879877; integer To_Planet_CHANNEL = 6583586; + Say() { vector size = llGetScale(); diff --git a/Walk-On-the-moon/Walk-On-the-moon/Poseball/avatar_stand.bvh b/Walk-On-the-moon/Walk-On-the-moon/Poseball/avatar_stand.bvh new file mode 100644 index 00000000..eb91d43e --- /dev/null +++ b/Walk-On-the-moon/Walk-On-the-moon/Poseball/avatar_stand.bvh @@ -0,0 +1,130 @@ +HIERARCHY +ROOT hip +{ + OFFSET 0.00 0.00 0.00 + CHANNELS 6 Xposition Yposition Zposition Xrotation Zrotation Yrotation + JOINT abdomen + { + OFFSET 0.000000 0.000000 0.000000 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT chest + { + OFFSET 0.000000 5.018152 -1.882228 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT neckDummy + { + OFFSET 0.000000 8.316447 0.784897 + CHANNELS 3 Xrotation Yrotation Zrotation + JOINT neck + { + OFFSET 0.000000 2.280413 -0.392801 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT head + { + OFFSET 0.000000 3.496879 0.529469 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT figureHair + { + OFFSET 0.000000 4.699570 0.720622 + CHANNELS 3 Zrotation Yrotation Xrotation + End Site + { + OFFSET 0.000000 -6.419331 0.000000 + } + } + } + } + } + JOINT lCollar + { + OFFSET 0.599237 8.316447 0.784897 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT lShldr + { + OFFSET 6.421198 0.010146 -0.332128 + CHANNELS 3 Zrotation Yrotation Xrotation + JOINT lForeArm + { + OFFSET 10.552783 0.025574 0.125508 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT lHand + { + OFFSET 11.035963 0.319619 0.041520 + CHANNELS 3 Zrotation Yrotation Xrotation + End Site + { + OFFSET 10.353753 0.000000 0.000000 + } + } + } + } + } + JOINT rCollar + { + OFFSET -0.599237 8.316447 0.784897 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT rShldr + { + OFFSET -6.421198 0.010146 -0.332128 + CHANNELS 3 Zrotation Yrotation Xrotation + JOINT rForeArm + { + OFFSET -10.552783 0.025574 0.125508 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT rHand + { + OFFSET -11.035963 0.319619 0.041520 + CHANNELS 3 Zrotation Yrotation Xrotation + End Site + { + OFFSET -10.353753 0.000000 0.000000 + } + } + } + } + } + } + } + JOINT lThigh + { + OFFSET 4.500466 -6.400484 -1.832696 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT lShin + { + OFFSET -1.359117 -18.918689 1.179887 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT lFoot + { + OFFSET -0.652380 -17.215186 -0.312137 + CHANNELS 3 Xrotation Yrotation Zrotation + End Site + { + OFFSET 0.000000 0.000000 10.353752 + } + } + } + } + JOINT rThigh + { + OFFSET -4.500466 -6.400484 -1.832696 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT rShin + { + OFFSET 1.359117 -18.918689 1.179887 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT rFoot + { + OFFSET 0.652380 -17.215186 -0.312137 + CHANNELS 3 Xrotation Yrotation Zrotation + End Site + { + OFFSET 0.000000 0.000000 10.353752 + } + } + } + } +} +MOTION +Frames: 1 +Frame Time: 1.000000 +2.898595 42.651405 -1.092219 1.614260 1.650030 -1.630150 0.020136 -1.168250 -2.362130 -4.611110 -3.230870 -5.893670 0.000000 0.000000 0.000000 -0.028617 0.811878 -0.155635 -2.958560 0.903542 -0.252972 0.000000 0.000000 0.000000 -2.279290 -5.924570 -1.065180 -68.580597 13.455016 17.332539 -8.855047 -8.918559 1.811211 11.044344 -4.575229 -14.817387 -1.052490 5.290610 9.980010 70.942596 12.030059 -1.386317 19.091511 13.727674 19.447748 -2.324264 0.808930 0.296090 -1.623250 5.011662 -13.449844 1.484355 -2.759394 -0.959640 -0.469020 21.000858 -0.284256 -11.679746 -6.390209 9.729076 8.974570 -0.723928 0.130789 3.625984 -10.811561 7.444040 diff --git a/Walk-On-the-moon/Walk-On-the-moon/Poseball/avatar_walk.bvh b/Walk-On-the-moon/Walk-On-the-moon/Poseball/avatar_walk.bvh new file mode 100644 index 00000000..30178beb --- /dev/null +++ b/Walk-On-the-moon/Walk-On-the-moon/Poseball/avatar_walk.bvh @@ -0,0 +1,133 @@ +HIERARCHY +ROOT hip +{ + OFFSET 0.000000 0.000000 0.000000 + CHANNELS 6 Xposition Yposition Zposition Xrotation Zrotation Yrotation + JOINT abdomen + { + OFFSET 0.000000 0.000000 0.000000 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT chest + { + OFFSET 0.000000 5.018152 -1.882228 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT neck + { + OFFSET 0.000000 2.280413 -0.3928010 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT head + { + OFFSET 0.000000 3.496879 0.5294690 + CHANNELS 3 Xrotation Zrotation Yrotation + End Site + { + OFFSET 0.000000 -6.419331 0.000000 + } + } + } + JOINT lCollar + { + OFFSET 0.5992370 8.316447 0.7848970 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT lShldr + { + OFFSET 6.421198 0.0101460 -0.3321280 + CHANNELS 3 Zrotation Yrotation Xrotation + JOINT lForeArm + { + OFFSET 10.55278 0.0255740 0.1255080 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT lHand + { + OFFSET 11.03596 0.3196190 0.0415200 + CHANNELS 3 Zrotation Yrotation Xrotation + End Site + { + OFFSET 10.35375 0.000000 0.000000 + } + } + } + } + } + JOINT rCollar + { + OFFSET -0.5992370 8.316447 0.7848970 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT rShldr + { + OFFSET -6.421198 0.0101460 -0.3321280 + CHANNELS 3 Zrotation Yrotation Xrotation + JOINT rForeArm + { + OFFSET -10.55278 0.0255740 0.1255080 + CHANNELS 3 Yrotation Zrotation Xrotation + JOINT rHand + { + OFFSET -11.03596 0.3196190 0.0415200 + CHANNELS 3 Zrotation Yrotation Xrotation + End Site + { + OFFSET -10.35375 0.000000 0.000000 + } + } + } + } + } + } + } + JOINT lThigh + { + OFFSET 4.500466 -6.400484 -1.832696 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT lShin + { + OFFSET -1.359117 -18.91869 1.179887 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT lFoot + { + OFFSET -0.6523800 -17.21519 -0.3121370 + CHANNELS 3 Xrotation Yrotation Zrotation + End Site + { + OFFSET 0.000000 0.000000 10.35375 + } + } + } + } + JOINT rThigh + { + OFFSET -4.500466 -6.400484 -1.832696 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT rShin + { + OFFSET 1.359117 -18.91869 1.179887 + CHANNELS 3 Xrotation Zrotation Yrotation + JOINT rFoot + { + OFFSET 0.6523800 -17.21519 -0.3121370 + CHANNELS 3 Xrotation Yrotation Zrotation + End Site + { + OFFSET 0.000000 0.000000 10.35375 + } + } + } + } +} +MOTION +Frames: 14 +Frame Time: 0.06666667 +-0.0257510 40.58662 2.968130 5.556919 0.000000 2.015870 -0.6797230 1.014860 -1.052490 2.752000 0.6388500 -7.299640 0.4079420 0.0122590 -0.1256210 5.754920 -1.457380 3.998490 -9.241052 -2.655120 -8.994716 -71.74033 -11.76199 4.746030 -31.60425 0.0011650 34.04590 -13.20947 -13.28238 0.0895360 -5.574724 0.4710180 -0.0036540 73.49715 -23.63777 -7.243340 8.720032 0.1163490 30.20142 6.934624 -2.351367 0.2714110 19.70864 0.2635370 -1.303549 16.37695 -5.436259 -0.5345360 4.496281 1.015851 1.747118 -34.91362 -1.222353 -5.287092 -2.923005 1.339154 -2.612716 22.63187 -2.693362 0.4416350 +-0.0427160 39.99832 2.968130 5.983611 0.1952380 2.305610 -0.9075000 1.659612 -0.8255570 3.170562 0.4139390 -6.538830 0.0427510 0.3591020 -0.2041640 4.601790 -1.017530 3.147050 -7.220732 -6.809920 -7.805324 -69.91151 -16.29200 9.884584 -30.28683 0.0011650 34.52690 -12.66613 -12.66293 0.3319030 -3.823218 3.579455 -1.197800 71.22991 -22.17614 -9.132231 8.934833 0.1163490 27.58857 6.341005 -1.810122 0.0889280 31.80497 -0.6573040 -1.730517 2.618905 -2.443246 2.231949 21.05572 1.594669 -3.021200 -29.23277 -0.8716060 -4.452437 -1.019926 1.464713 -1.719640 24.82080 -1.952116 -4.257692 +-0.0490000 40.60387 2.968130 6.780290 0.3518100 1.598240 -2.588980 1.606370 -0.6063710 4.232220 0.1093190 -4.063770 -0.0046320 0.0825280 -0.0927340 3.695360 -0.7544480 1.973470 -3.744470 -8.700970 -4.904962 -70.88610 -17.35770 9.929008 -27.66028 0.0011650 35.16180 -11.80692 -10.87573 0.2852650 2.176580 6.577632 -4.384020 70.63450 -18.15266 -9.667048 10.03265 0.1163490 26.30510 7.008678 -1.223352 0.0747800 -0.7305030 0.4284680 1.743937 54.34729 -4.835621 -1.074371 9.137504 5.289661 -3.020902 -30.70562 -0.8687340 -4.818579 21.60547 1.171606 -0.0342390 -1.272151 -1.886707 -7.032578 +-0.0370750 41.81056 2.968130 7.296476 0.4387100 -0.3847930 -4.810570 0.7177930 -0.4790630 6.622445 -0.7205180 0.2170790 -0.1072710 -0.1669200 0.0205430 3.943000 -0.3966010 0.2499270 0.5136740 -7.977970 -1.134083 -74.42540 -13.28160 5.881170 -21.83660 0.0011650 35.30630 -10.84113 -7.695415 0.2676810 9.603888 7.048002 -9.243760 73.80751 -11.40650 -7.985020 13.65550 0.1163490 26.98030 7.962735 -0.3291820 -0.2501000 -25.45668 1.331627 2.501022 73.94672 -3.461740 -1.227959 6.551764 9.393176 -2.179612 -21.03787 -0.0785040 -4.612796 18.82639 1.075741 0.3011050 -8.326876 -0.7395040 -7.905264 +-0.0492780 42.52045 2.968130 8.028471 0.4387270 -2.183500 -5.438199 0.2072610 -0.4842430 7.701901 -0.9499680 3.168510 -0.0889130 -0.0297360 0.0692490 4.540220 -0.2602800 -2.275510 2.874230 -2.376980 2.091650 -76.07090 -2.581600 0.7454570 -16.12650 0.0011650 34.86560 -9.942211 -3.643180 0.2476490 14.10310 1.174088 -11.53900 76.15389 -2.965070 -5.198220 20.48967 0.1163490 29.01340 9.230290 0.7452390 0.2288370 -38.03374 1.956252 2.239554 62.35056 -2.866381 -0.2397530 8.452842 4.334472 0.6557800 -7.289600 0.3666450 -3.843508 1.867966 1.000802 -0.7417120 -5.670934 1.476608 -7.036381 +-0.1147910 42.30725 2.968130 7.389349 0.3518580 -2.723740 -4.885140 -0.1526010 -0.0863740 6.676330 -0.9908230 5.642550 -0.0815090 0.3846910 0.1674810 4.107840 0.6112240 -3.806190 4.723633 0.3030470 3.157360 -76.51633 9.078669 -2.237584 -11.19450 0.0011650 33.69044 -8.229190 -0.2649510 0.3502730 13.70860 -2.341550 -11.48470 76.44480 4.952410 -2.805780 23.66457 0.1163490 31.16320 11.07391 3.243204 0.1396680 -39.73745 0.9433510 2.634595 37.03880 -0.0079470 0.2421630 3.952889 0.5003140 0.6370110 -2.884728 0.2945820 -4.572917 14.90006 0.3393120 0.5460770 -12.46497 2.812716 -5.142097 +-0.1136690 41.29929 2.968130 7.077470 0.1953070 -3.103870 -2.569706 -0.5870810 0.7460720 4.264240 -0.9203070 6.794440 -0.0655790 0.8732530 0.3329260 4.152214 1.027240 -4.007210 6.108605 0.9400970 2.701448 -74.59380 19.52292 -4.328449 -8.674590 0.0011650 31.67350 -6.320746 1.746516 0.4130220 11.23750 -2.078610 -9.506420 73.19800 10.55287 3.473820 25.37001 0.1163490 33.11210 12.83219 7.515890 0.4558040 -33.10924 0.6728450 2.248022 -2.150151 -1.284785 1.135497 8.195504 0.7814600 0.9302330 6.604897 -0.4295430 -3.435708 18.94620 0.4580620 0.7902670 -11.64451 2.760721 -2.794761 +-0.0257510 40.58662 2.968130 5.315712 0.000000 -2.980694 -0.9209280 -1.497272 1.052490 3.234412 -0.6388500 7.299640 0.4079420 -0.0122590 0.1256210 4.790095 1.457380 -3.998490 5.549260 -3.365490 1.062321 -70.36150 22.98137 -6.453584 -9.202444 -0.1163490 29.47779 -4.281356 2.351367 0.2714110 9.001228 2.655120 -4.562235 69.81071 14.49866 7.158091 26.05653 -0.0011650 34.04590 13.20947 13.28238 0.0895360 -34.63461 1.663542 5.230479 -2.874681 -1.354475 2.571830 22.27972 3.499624 -0.6994310 20.20984 -0.8096520 1.118457 16.39768 5.239849 0.5319330 4.287104 -0.0057910 -1.855253 +-0.0427160 39.99832 2.968130 5.501198 -0.1952380 -2.305610 -0.9075000 -2.142024 1.066763 3.411768 -0.4139390 6.538830 0.0427510 -0.3591020 0.2041640 4.601790 1.017530 -3.147050 3.099600 -8.162370 -1.197800 -69.30029 21.18730 -7.691476 -10.38207 -0.1163490 27.82978 -2.964121 2.533740 0.0889280 5.930410 6.809920 -1.510628 68.94670 16.53321 9.626520 25.46272 -0.0011650 34.76811 12.18372 15.55740 0.3319030 -28.75425 0.7551880 4.375766 -1.009826 -1.458228 1.758046 24.68831 2.019926 4.264540 32.70480 0.5576440 1.612639 2.529472 2.394109 -2.208158 20.77636 -1.529196 3.034380 +-0.0490000 40.60387 2.968130 6.780290 -0.3518100 -1.598240 -2.588980 -1.606370 0.8475770 4.232220 -0.1093190 4.063770 -0.0046320 -0.0825280 0.0927340 3.695360 0.7544480 -1.973470 -3.382610 -9.230900 -4.384020 -70.63450 16.45700 -8.214620 -11.96230 -0.1163490 26.30510 -4.355410 1.223352 0.0747800 2.220852 8.700970 0.7050230 70.88610 16.12165 10.70320 23.80100 -0.0011650 35.40301 10.84210 13.52900 0.2852650 -30.70332 1.151009 4.769948 21.61604 -1.309091 -0.0288900 -1.231163 1.831893 6.845827 -0.7391490 -0.5250250 -1.818685 54.36355 4.687464 1.070386 9.172863 -5.207838 3.084680 +-0.0370750 41.81056 2.968130 7.055270 -0.4387100 0.3847930 -4.569364 -0.7177930 0.4790630 5.657620 0.7205180 -0.4582850 -0.1072710 0.1669200 -0.0205430 3.943000 0.3966010 -0.2499270 -10.08630 -6.565590 -9.243760 -73.08390 11.40650 -7.985020 -17.75600 -0.1163490 26.98030 -8.686354 -1.359260 -0.2501000 -1.313670 7.736764 2.069029 74.42540 9.326259 7.569613 21.11298 -0.0011650 35.30630 9.635085 8.660240 0.2676810 -20.89793 0.0200240 4.532423 18.85304 -1.135874 -0.2918260 -8.274943 0.7717070 7.956114 -25.12860 -1.376650 -2.522182 73.94746 3.378500 1.186994 6.482924 -9.345399 2.210355 +-0.0492780 42.52045 2.968130 6.822440 -0.4387270 2.183500 -4.714581 0.0339450 0.0018310 6.978283 0.9499680 -3.168510 -0.0889130 0.0297360 -0.0692490 4.540220 0.2602800 2.275510 -14.10310 0.0319430 -11.53900 -76.63630 2.965070 -5.714349 -27.72584 -0.1163490 29.01340 -11.88356 -5.810566 0.2288370 -2.874230 2.376980 2.574062 76.07090 -4.814778 2.675105 15.64409 -0.0011650 34.86560 8.494974 2.678356 0.2476490 -5.750584 -0.0682040 3.706347 1.838004 -0.9924500 0.7040120 -6.252903 -1.350606 6.723120 -36.76496 -1.611116 -2.217723 62.39058 2.803816 0.2258220 8.343335 -4.624382 -0.6874000 +-0.1147910 42.30725 2.968130 5.942111 -0.3518580 2.723740 -3.437904 0.3938070 -0.3960380 5.711505 0.9908230 -5.642550 -0.0815090 -0.3846910 -0.1674810 4.107840 -0.6112240 3.806190 -13.70860 2.341550 -11.48470 -76.44480 -4.952410 -2.547715 -31.86555 -0.1163490 31.64561 -12.76236 -9.514564 0.1396680 -3.949440 -0.3030470 2.674948 75.06911 -17.84588 -1.945802 10.71209 -0.0011650 33.44923 7.987984 -0.9410790 0.3502730 -1.522238 0.2477410 4.483660 14.98725 -0.3526480 -0.5609450 -12.46601 -2.716281 4.674154 -37.94170 -0.5235370 -2.521068 37.07784 -0.0044090 -0.2444200 3.539016 -0.8207050 -0.7948700 +-0.1136690 41.29929 2.968130 5.389027 -0.1953070 3.103870 -1.363676 0.5870810 -0.7460720 3.540622 0.9203070 -6.794440 -0.0655790 -0.1496350 -0.3329260 4.875833 -1.027240 4.007210 -9.904170 0.5302230 -9.506420 -73.19800 -10.06840 3.473820 -32.36500 -0.1163490 32.62968 -13.55581 -12.09881 0.4558040 -4.560220 -0.4576850 1.669190 73.62899 -22.59373 -6.134900 8.915796 -0.0011650 31.67350 7.526777 -1.987722 0.4130220 8.712742 0.9255390 3.315778 18.95539 -0.4671390 -0.8017530 -12.08175 -2.643082 2.386326 -31.30434 -0.2056730 -2.097641 -2.062192 1.296254 -1.151119 7.956662 -0.9896620 -1.269012 diff --git a/Walk-On-the-moon/Walk-On-the-moon/Poseball/poseball script.lsl b/Walk-On-the-moon/Walk-On-the-moon/Poseball/poseball script.lsl index 8b510958..00846b62 100644 --- a/Walk-On-the-moon/Walk-On-the-moon/Poseball/poseball script.lsl +++ b/Walk-On-the-moon/Walk-On-the-moon/Poseball/poseball script.lsl @@ -1,19 +1,33 @@ -// :CATEGORY:World -// :NAME:Walk-On-the-moon +// :CATEGORY:Sphere World +// :NAME:Walk-On-The-Moon // :AUTHOR:Ferd Frederix // :CREATED:2013-11-19 16:49:29 -// :EDITED:2013-11-19 16:49:29 // :ID:1003 // :NUM:1544 -// :REV:1.1 -// :WORLD:Second Life +// :REV:2 +// :WORLD:Second Life, Opensim // :DESCRIPTION: -// Walk on the moon pose ball script +// Controlled Walk Pose ball - put this in a small sphere and set it at ground level. +// Add a walk animation named "avatar_walk" to the prim, and an animation named "avatar_stand". +// You can change these to your preferred walk, and rename them in the script. +// When you click it, it will let you walk on your sphere world + + // :CODE: +string Text = "Live on Mars"; // the hovertext when no one is stting +string WALK = "avatar_walk"; +string STAND = "avatar_stand"; -string WALK = "Walk: Power Slow"; // requires two animations. one for walkoing, one for standing -string STAND = "avatar_stand_1"; +// Requires there to be one walk animation in the inventory of the pose ball. + +integer debug = FALSE; +DEBUG(string msg) +{ + if (debug) + llSay(0,llGetScriptName() + ":" + msg); + +} // global listeners @@ -22,14 +36,14 @@ integer To_Planet_CHANNEL = 6583586; // walk on a sphere -string Text = "Walk on the Moon"; // the hovertext when no one is stting + string ANIMATION ; // change to a walk animation + + vector gSphereLocation; // location of the walkable sphere vector Home; // pose ball home rotation gOrient; - rotation sphereRot; - key avatarKey; float x ; float y ; @@ -49,11 +63,35 @@ stopSpin() llTargetOmega(<0.0,0.0,0.0>*llGetRot(),0.1,0.01); // start spin } + +//uSteppedLookAt( vector vPosTarget, float vFltRate ){ +// rotation vRotTarget = llRotBetween( <1.0, 0.0, 0.0>, vPosTarget ); +// if ((integer)(vFltRate = llAcos( +// (vPosTarget = llVecNorm( vPosTarget )) * +// (<1.0, 0.0, 0.0> * llGetLocalRot()) +// ) / (vFltRate / 5.0) +// + +// )){ +// rotation vRotStep = llAxisAngle2Rot( llRot2Axis( vRotTarget / llGetLocalRot() ), +// (1.0 / vFltRate) * llRot2Angle( vRotTarget / llGetLocalRot() ) ); +// vFltRate = (integer)vFltRate; +// do{ +// llSetLocalRot( vRotStep * llGetLocalRot() ); +// }while( --vFltRate ); +// } +// llSetLocalRot( vRotTarget ); +//} //-- for fi + + uSteppedLookAt( vector vPosTarget, float vFltRate ){ + rotation vRotTarget = llRotBetween( <1.0, 0.0, 0.0>, vPosTarget ); - if ((integer)(vFltRate = llAcos( (vPosTarget = llVecNorm( vPosTarget )) * - (<1.0, 0.0, 0.0> * llGetLocalRot()) ) / (vFltRate / 5.0))){ - rotation vRotStep = llAxisAngle2Rot( llRot2Axis( vRotTarget / llGetLocalRot() ), + + vFltRate = llAcos((vPosTarget = llVecNorm( vPosTarget )) *(<1.0, 0.0, 0.0> * llGetLocalRot())) / (vFltRate / 5.0); + + if ((integer) vFltRate) { + rotation vRotStep = llAxisAngle2Rot( llRot2Axis( vRotTarget / llGetLocalRot() ), (1.0 / vFltRate) * llRot2Angle( vRotTarget / llGetLocalRot() ) ); vFltRate = (integer)vFltRate; do{ @@ -66,12 +104,6 @@ uSteppedLookAt( vector vPosTarget, float vFltRate ){ face_target(vector lookat) { - - // rotation rot = llGetRot() * llRotBetween(<1.0 ,0.0 ,0.0 > * llGetRot(), lookat - llGetPos()); - - // llSetRot(rot); - // llSleep(.1); - rotation rot = llGetRot() * llRotBetween(<0.0 ,0.0 ,1.0 > * llGetRot(), gSphereLocation - llGetPos()); llSetRot(rot); } @@ -80,15 +112,18 @@ key avatar; warpPos( vector destpos ) - { + { + llOwnerSay("tp to: " + (string) destpos); + llSetRegionPos(destpos); + } Fetch(key id, string message) { if (llGetOwnerKey(id) == llGetOwner()) { - //llOwnerSay("walk script Heard " + message); + DEBUG("walk script Heard " + message); list data = llParseString2List(message, ["^"], []); @@ -99,7 +134,6 @@ Fetch(key id, string message) gRADIUS = dia/2; llOwnerSay("Sphere located at " + (string) gSphereLocation); Home = llGetPos(); - } } } @@ -145,8 +179,9 @@ default listen(integer channel, string name, key id, string message) { + DEBUG("Heard:" + message); Fetch(id,message); - state running; + state running; } @@ -174,14 +209,14 @@ state running if(avatar != NULL_KEY){ if (gSphereLocation == <0,0,0>) { - llOwnerSay("World not located yet, please click the sphere world"); + llOwnerSay("World not located yet, please click the sphere world and make sure it is within 100 meters"); return; } //SOMEONE SAT DOWN avatarKey = avatar; llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION |PERMISSION_TAKE_CONTROLS); - return; + }else{ //SOMEONE STOOD UP if (llGetPermissionsKey() != NULL_KEY) @@ -203,10 +238,11 @@ state running { if(perm & PERMISSION_TRIGGER_ANIMATION) { + vector height = llGetAgentSize(avatarKey); aRADIUS = gRADIUS + height.z * 0.50 ; // adjust for the agent size - vector unitpos = llRot2Fwd( gOrient ); + vector unitpos = llRot2Fwd( gOrient ); vector pos = gSphereLocation + unitpos * aRADIUS; warpPos(pos); @@ -249,7 +285,19 @@ state running vector unitpos = llRot2Fwd( gOrient ); vector pos = gSphereLocation + unitpos * aRADIUS; - + + //llOwnerSay((string) llVecDist(gSphereLocation,llGetPos())); + + // face_target(pos); + + //llLookAt( pos, 1.0, 0.1); + + // if (pos != priorpos) + // { + // llOwnerSay("rotating"); + // uSteppedLookAt(pos,2.0); + // priorpos = pos; + // } llSetRot(gOrient); //llRezObject("Pointer",pos,<0,0,0>,gOrient,1); @@ -297,7 +345,11 @@ state running { z = -bump; controls = "R"; - } + } + + + + } on_rez(integer p) diff --git a/Walk-On-the-moon/Walk-On-the-moon/Walk-On-the-moon.prj b/Walk-On-the-moon/Walk-On-the-moon/Walk-On-the-moon.prj index 80a5c87d..884ca32e 100644 --- a/Walk-On-the-moon/Walk-On-the-moon/Walk-On-the-moon.prj +++ b/Walk-On-the-moon/Walk-On-the-moon/Walk-On-the-moon.prj @@ -1,9 +1,17 @@ + + + + + + diff --git a/Walk-On-the-moon/license.txt b/Walk-On-the-moon/license.txt new file mode 100644 index 00000000..ec773168 --- /dev/null +++ b/Walk-On-the-moon/license.txt @@ -0,0 +1,18 @@ +Come visit us on the hypergrid at www.outworldz.com:9000 + +By Ferd Frederix -from the Free Script Library at http://www.outworldz.com + +LICENSE: + +This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. + +You are free to: + +Share — copy and redistribute the material in any medium or format +Adapt — remix, transform, and build upon the material +The licensor cannot revoke these freedoms as long as you follow the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. +NonCommercial — You may not use the material for commercial purposes. +ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. +No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. \ No newline at end of file diff --git a/Walk-On-the-moon/walk-on-the-moon.iar b/Walk-On-the-moon/walk-on-the-moon.iar new file mode 100644 index 00000000..9b9296ac Binary files /dev/null and b/Walk-On-the-moon/walk-on-the-moon.iar differ