Advertisement
john_danger

just cant get any thing to happen hud to texture mesh 1 face

Dec 31st, 2019
1,172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // Materials UUID Texture Changer // SENDER
  3. string product_id = "c5796baf-9bbe-999a-ed7b-7bb19f776a04"; // product id needs to match the one set in the receiver
  4. // -------------------------------------------
  5. string vApplierPassword = "#PASSWORD"; // password needs to match the one set in the receiver
  6. integer vApplierChannel = 1976; // channel needs to match the one set in the receiver
  7. // [ PRIM_SPECULAR, integer face, string texture, vector repeats, vector offsets, float rot, vector specular_color, integer glossiness,
  8. //  integer environment ]
  9. // [ PRIM_NORMAL, integer face, string texture, vector repeats, vector offsets, float rot ]
  10. // valid formats:
  11. // button & texture uuid diffuse
  12. // button & texture uuid diffuse & texture uuid normal
  13. // button & texture uuid diffuse & texture uuid normal & texture uuid specular
  14. // if you want to ignore a field, type NULL_KEY, eg, if you want just specualar use the folling line:
  15. // "BUTTON1",NULL_KEY, NULL_KEY, "TEXTURE_UUID",
  16. list settings = [
  17.   "BUTTON1",
  18.   "ec361789-d072-c404-1edf-7a754a6e3e00",
  19.   "ec361789-d072-c404-1edf-7a754a6e3e00",
  20.   "ec361789-d072-c404-1edf-7a754a6e3e00",
  21.   "BUTTON2",
  22.   "bc15d140-7800-2058-525f-c5fcb196e1c1",
  23.   "bc15d140-7800-2058-525f-c5fcb196e1c1",
  24.   "bc15d140-7800-2058-525f-c5fcb196e1c1",
  25.   "BUTTON3",
  26.   "37acf7d9-bcec-65e6-f2b5-ad3d00022375",
  27.   "37acf7d9-bcec-65e6-f2b5-ad3d00022375",
  28.   "37acf7d9-bcec-65e6-f2b5-ad3d00022375",
  29.     "BUTTON4",
  30.   "aba0b7e8-66a9-f5e8-0660-05ad41acc45c",
  31.   "aba0b7e8-66a9-f5e8-0660-05ad41acc45c",
  32.   "aba0b7e8-66a9-f5e8-0660-05ad41acc45c",
  33.     "BUTTON5",
  34.   "fc3a5c80-3064-73ec-ba53-b90f143b09a9",
  35.   "fc3a5c80-3064-73ec-ba53-b90f143b09a9",
  36.   "fc3a5c80-3064-73ec-ba53-b90f143b09a9",
  37.   "BUTTON6",
  38.   "d5433834-4b33-c29c-416b-30af007ca35f",
  39.   "d5433834-4b33-c29c-416b-30af007ca35f",
  40.   "d5433834-4b33-c29c-416b-30af007ca35f",
  41.     "BUTTON7",
  42.   "7f3c13d2-9cf0-9645-5aa9-e9603539a1ab",
  43.   "7f3c13d2-9cf0-9645-5aa9-e9603539a1ab",
  44.   "7f3c13d2-9cf0-9645-5aa9-e9603539a1ab",
  45.   "BUTTON8",
  46.   "267c3acb-5ee1-e17f-3214-cfc1178d3202",
  47.   "267c3acb-5ee1-e17f-3214-cfc1178d3202",
  48.   "267c3acb-5ee1-e17f-3214-cfc1178d3202"
  49. ];
  50. integer isKey(key in ) {
  51.   if ( in ) return 2;
  52.   return ( in == NULL_KEY);
  53. }
  54. default
  55. {
  56.   touch_start(integer num_detected)
  57.   {
  58.     string btnid = llGetLinkName(llDetectedLinkNumber(0));
  59.     integer line = llListFindList(settings, [btnid]);
  60.     if (line != -1) {
  61.       string pswd = llSHA1String((string) llGetOwner() + vApplierPassword + product_id);
  62.       integer end = 0;
  63.       list l;
  64.       while (!end) {
  65.         string t = llList2String(settings, ++line);
  66.         if (isKey((key) t)) l += t;
  67.         else end = 1;
  68.       }
  69.       llRegionSayTo(llGetOwner(), vApplierChannel, llDumpList2String([pswd] + l, "&"));
  70.     }
  71.   }
  72. }
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. -----------------------------------------------
  83. // Materials UUID Texture Changer // RECEIVER
  84. string product_id = "c5796baf-9bbe-999a-ed7b-7bb19f776a04"; // product id needs to match the one set in the sender
  85. // -------------------------------------------
  86. string vApplierPassword = "#PASSWORD"; // password needs to match the one set in the sender
  87. integer vApplierChannel = 1976; // channel needs to match the one set in the sender
  88. // -------------------------------------------
  89. string vTargetPrimName = "MCM"; // prim name of the prim that is affected by the applier
  90. integer vTargetPrimFace = 1; // face that should get textured
  91. integer _TargetPrimLinknr;
  92. default
  93. {
  94.   state_entry()
  95.   {
  96.     _TargetPrimLinknr = -1;
  97.     integer i;
  98.     for (i = 0; i < llGetObjectPrimCount(llGetKey()) + 1; i++)
  99.       if (llGetLinkName(i) == vTargetPrimName)
  100.         _TargetPrimLinknr = i;
  101.     if (_TargetPrimLinknr == -1)
  102.       llOwnerSay("error: unable to find \"" + vTargetPrimName + "\" so could not register its linknr, please check if the name is spelled correctly and reset the script...");
  103.     else
  104.       llListen(vApplierChannel, "", llGetOwner(), "");
  105.   }
  106.   changed(integer change) {
  107.     if ((change & CHANGED_LINK) || (change & CHANGED_INVENTORY))
  108.       llResetScript();
  109.   }
  110.   listen(integer channel, string name, key id, string message) {
  111.     if (channel == vApplierChannel) {
  112.       //if (llGetAttached() == 0) return; // don't continue if this product is not worn...
  113.       list data = llParseString2List(message, ["&"], []);
  114.       string pswd = llList2String(data, 0);
  115.       if (pswd != llSHA1String((string) llGetOwner() + vApplierPassword + product_id))
  116.         return; // don't continue if the message is not meant for this product...
  117.       list lt = llList2List(data, 1, -1);
  118.       integer i = 0;
  119.       for (i; i < llGetListLength(lt); ++i) {
  120.         key t = (key) llList2String(lt, i);
  121.         if (t) {
  122.           if (i == 0) {
  123.             llSetLinkTexture(_TargetPrimLinknr, t, vTargetPrimFace);
  124.           } else if (i == 1) {
  125.             list l = llGetLinkPrimitiveParams(_TargetPrimLinknr, [PRIM_NORMAL, vTargetPrimFace]);
  126.             l = llListReplaceList(l, [t], 0, 0);
  127.             llSetLinkPrimitiveParamsFast(_TargetPrimLinknr, [PRIM_NORMAL, vTargetPrimFace] + l);
  128.           } else if (i == 2) {
  129.             list l = llGetLinkPrimitiveParams(_TargetPrimLinknr, [PRIM_SPECULAR, vTargetPrimFace]);
  130.             l = llListReplaceList(l, [t], 0, 0);
  131.             llSetLinkPrimitiveParamsFast(_TargetPrimLinknr, [PRIM_SPECULAR, vTargetPrimFace] + l);
  132.           }
  133.         }
  134.       }
  135.     }
  136.   }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement