Guest User

m3 specular applier

a guest
Dec 14th, 2015
644
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Specular map applier script for [M3+] - Head (v.1.12.15)
  2. //If you want to use this with any other version of the M3 head or the venus head or the kemono body or whatever, you will need to figure out the link and face numbers and replace them in the script.
  3.  
  4. integer listen_id;
  5. integer channel;
  6. string specmap = "UUID goes here"; // your specular map UUID
  7. vector repeats = <10,10,0>; // horizontal and vertical repeats
  8. vector offsets = <0,0,0>; // horizontal and vertical offsets
  9. float rot = 0.0; // texture angle
  10. integer gloss = 51; // glossyness
  11. integer env = 0; // environment reflection
  12. vector color = <1.000, 1.000, 1.000>; // specular color
  13.  
  14.  
  15. default
  16. {
  17.  
  18. state_entry()
  19. {
  20. }
  21.  
  22. touch_start(integer total_number)
  23. {
  24. if(llDetectedKey(0) == llGetOwner())
  25. {
  26. channel = ( -1 * (integer)("0x"+llGetSubString((string)llGetKey(),-5,-1)) );
  27. listen_id = llListen( channel, "",llGetOwner(), "");
  28.  
  29. list button_text = ["Apply",
  30. "Delete script"];
  31.  
  32. llDialog(llGetOwner(),"What do?",button_text,channel);
  33. llSetTimerEvent(30.0);
  34. }
  35. }
  36.  
  37. listen(integer channel, string name, key id, string message)
  38. {
  39. if (message=="Apply")
  40. {
  41.  
  42. //Base
  43. llSetLinkPrimitiveParamsFast( 1, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  44. llSetLinkPrimitiveParamsFast( 1, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  45. llSetLinkPrimitiveParamsFast( 1, [ PRIM_SPECULAR, 1, specmap, repeats, offsets, rot, color, gloss, env ] );
  46. llSetLinkPrimitiveParamsFast( 1, [ PRIM_ALPHA_MODE, 1, 0, 0 ] );
  47. llSetLinkPrimitiveParamsFast( 1, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  48. llSetLinkPrimitiveParamsFast( 1, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  49. llSetLinkPrimitiveParamsFast( 1, [ PRIM_SPECULAR, 5, specmap, repeats, offsets, rot, color, gloss, env ] );
  50. llSetLinkPrimitiveParamsFast( 1, [ PRIM_ALPHA_MODE, 5, 0, 0 ] );
  51. llSetLinkPrimitiveParamsFast( 1, [ PRIM_SPECULAR, 6, specmap, repeats, offsets, rot, color, gloss, env ] );
  52. llSetLinkPrimitiveParamsFast( 1, [ PRIM_ALPHA_MODE, 6, 0, 0 ] );
  53. llSetLinkPrimitiveParamsFast( 1, [ PRIM_SPECULAR, 7, specmap, repeats, offsets, rot, color, gloss, env ] );
  54. llSetLinkPrimitiveParamsFast( 1, [ PRIM_ALPHA_MODE, 7, 0, 0 ] );
  55.  
  56. //Eyelids
  57. llSetLinkPrimitiveParamsFast( 5, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  58. llSetLinkPrimitiveParamsFast( 5, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  59. llSetLinkPrimitiveParamsFast( 5, [ PRIM_SPECULAR, 3, specmap, repeats, offsets, rot, color, gloss, env ] );
  60. llSetLinkPrimitiveParamsFast( 5, [ PRIM_ALPHA_MODE, 3, 0, 0 ] );
  61.  
  62. llSetLinkPrimitiveParamsFast( 6, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  63. llSetLinkPrimitiveParamsFast( 6, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  64. llSetLinkPrimitiveParamsFast( 6, [ PRIM_SPECULAR, 3, specmap, repeats, offsets, rot, color, gloss, env ] );
  65. llSetLinkPrimitiveParamsFast( 6, [ PRIM_ALPHA_MODE, 3, 0, 0 ] );
  66.  
  67. llSetLinkPrimitiveParamsFast( 7, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  68. llSetLinkPrimitiveParamsFast( 7, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  69. llSetLinkPrimitiveParamsFast( 7, [ PRIM_SPECULAR, 3, specmap, repeats, offsets, rot, color, gloss, env ] );
  70. llSetLinkPrimitiveParamsFast( 7, [ PRIM_ALPHA_MODE, 3, 0, 0 ] );
  71.  
  72. //Tongue (remove the "//" next to every llSetLinkPrimitiveParamsFast to apply speculars to the tongue)
  73. // llSetLinkPrimitiveParamsFast( 13, [ PRIM_SPECULAR, ALL_SIDES, specmap, repeats, offsets, rot, color, gloss, env ] );
  74. // llSetLinkPrimitiveParamsFast( 13, [ PRIM_ALPHA_MODE, ALL_SIDES, 0, 0 ] );
  75.  
  76. //Face_e01
  77.  
  78. llSetLinkPrimitiveParamsFast( 19, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  79. llSetLinkPrimitiveParamsFast( 19, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  80. llSetLinkPrimitiveParamsFast( 19, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  81. llSetLinkPrimitiveParamsFast( 19, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  82.  
  83. //Face_e02
  84.  
  85. llSetLinkPrimitiveParamsFast( 8, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  86. llSetLinkPrimitiveParamsFast( 8, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  87. llSetLinkPrimitiveParamsFast( 8, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  88. llSetLinkPrimitiveParamsFast( 8, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  89.  
  90. //Face_e03
  91.  
  92. llSetLinkPrimitiveParamsFast( 10, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  93. llSetLinkPrimitiveParamsFast( 10, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  94. llSetLinkPrimitiveParamsFast( 10, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  95. llSetLinkPrimitiveParamsFast( 10, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  96.  
  97. //Face_e04
  98.  
  99. llSetLinkPrimitiveParamsFast( 12, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  100. llSetLinkPrimitiveParamsFast( 12, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  101. llSetLinkPrimitiveParamsFast( 12, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  102. llSetLinkPrimitiveParamsFast( 12, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  103.  
  104. //Face_e05
  105.  
  106. llSetLinkPrimitiveParamsFast( 15, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  107. llSetLinkPrimitiveParamsFast( 15, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  108. llSetLinkPrimitiveParamsFast( 15, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  109. llSetLinkPrimitiveParamsFast( 15, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  110.  
  111. //Face_e06
  112.  
  113. llSetLinkPrimitiveParamsFast( 20, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  114. llSetLinkPrimitiveParamsFast( 20, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  115. llSetLinkPrimitiveParamsFast( 20, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  116. llSetLinkPrimitiveParamsFast( 20, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  117.  
  118. //Face_e07
  119.  
  120. llSetLinkPrimitiveParamsFast( 16, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  121. llSetLinkPrimitiveParamsFast( 16, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  122. llSetLinkPrimitiveParamsFast( 16, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  123. llSetLinkPrimitiveParamsFast( 16, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  124.  
  125. //Face_e08
  126.  
  127. llSetLinkPrimitiveParamsFast( 22, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  128. llSetLinkPrimitiveParamsFast( 22, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  129. llSetLinkPrimitiveParamsFast( 22, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  130. llSetLinkPrimitiveParamsFast( 22, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  131.  
  132. //Face_e09
  133.  
  134. llSetLinkPrimitiveParamsFast( 11, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  135. llSetLinkPrimitiveParamsFast( 11, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  136. llSetLinkPrimitiveParamsFast( 11, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  137. llSetLinkPrimitiveParamsFast( 11, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  138.  
  139. //Face_e10
  140.  
  141. llSetLinkPrimitiveParamsFast( 18, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  142. llSetLinkPrimitiveParamsFast( 18, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  143. llSetLinkPrimitiveParamsFast( 18, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  144. llSetLinkPrimitiveParamsFast( 18, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  145.  
  146. //Face_e11
  147.  
  148. llSetLinkPrimitiveParamsFast( 21, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  149. llSetLinkPrimitiveParamsFast( 21, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  150. llSetLinkPrimitiveParamsFast( 21, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  151. llSetLinkPrimitiveParamsFast( 21, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  152.  
  153. //Face_e12
  154.  
  155. llSetLinkPrimitiveParamsFast( 17, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  156. llSetLinkPrimitiveParamsFast( 17, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  157. llSetLinkPrimitiveParamsFast( 17, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  158. llSetLinkPrimitiveParamsFast( 17, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  159.  
  160. //Face_e13
  161.  
  162. llSetLinkPrimitiveParamsFast( 14, [ PRIM_SPECULAR, 0, specmap, repeats, offsets, rot, color, gloss, env ] );
  163. llSetLinkPrimitiveParamsFast( 14, [ PRIM_ALPHA_MODE, 0, 0, 0 ] );
  164. llSetLinkPrimitiveParamsFast( 14, [ PRIM_SPECULAR, 2, specmap, repeats, offsets, rot, color, gloss, env ] );
  165. llSetLinkPrimitiveParamsFast( 14, [ PRIM_ALPHA_MODE, 2, 0, 0 ] );
  166.  
  167. }
  168.  
  169.  
  170. if (message=="Delete script")
  171. {
  172. llRemoveInventory(llGetScriptName());
  173. }
  174.  
  175. }
  176. timer(){
  177. llListenRemove(listen_id);
  178. llSetTimerEvent(0.0);
  179. }
  180. }
RAW Paste Data