Search:


Follow Us On:

Kobold-Texture-Applier-Script

See also:

Please copy/paste this into a new script in SL. Set the permissions to copy only, put it in a box, and there you go. Well, besides the other instructions I glossed over. See the script comments.

 /////////////////////////////////////////////////////////////
 // Welcome to the Roarbeast Kobold texture applier script!
 //
 // This script is intended for use by third party texture
 //  creators who wish to sell their textures in a way that
 //  is more difficult to be stolen, and much easier to
 //  apply to the avatar.
 //
 // To set up this script, simply paste the texture UUID
 //  into the appropriate bodypart. Like so:
 //  string BODY_DIFFUSE = "";
 //   changes to:
 //  string BODY_DIFFUSE = "bfde6d35-afe2-498a-7b1c-d0de2ffb9e4";
 //
 // If your texture set does not include a certain bodypart,
 //  (for example, you did not texture all heads), simply
 //  leave that part blank and the applier will not send
 //  any data for it.
 // Please do not delete a bodypart line you don't intend
 //  to use. It will make the script cry.
 //
 // To use this script, place it in a copy-able object
 //  (bonus points for a pretty looking custom object)
 //  and then sell the object.
 //
 // Make sure that you have set this script to be
 //  NO MOD, copy, NO TRANS.
 // If you have mod or trans permissions, you're basically
 //  giving your textures away for free.
 //
 // For the end user, the applier object will delete
 //  itself a few dozen seconds after it's used, to prevent
 //  litter.
 //
 // 07 JAN 2020 - Stickman Ingmann

 // You can put a special message here thanking them.
 // It plays after the textures are sent.
 string MSG_APPLIED = "Custom textures applied. Thank you for using the Roarbeast Kobold!";

 // Note: "Diffuse" is what most people call "the texture."
 // (However: normal and specular are also technically "textures.")
 string BODY_DIFFUSE = "";
 string BODY_NORMAL = "";
 string BODY_SPECULAR = "";
 // A specular map has extra options. They can beautify the
 //  specular map wonderfully if used well. If you're
 //  short on time or don't care, you can ignore them.
 vector BODY_SPECULAR_COLOR = <1.0, 1.0, 1.0>;
 integer BODY_SPECULAR_GLOSS = 51;
 integer BODY_SPECULAR_ENVIRONMENT = 1;

 string HEAD_A_DIFFUSE = "";
 string HEAD_A_NORMAL = "";
 string HEAD_A_SPECULAR = "";
 vector HEAD_A_SPECULAR_COLOR = <1.0, 1.0, 1.0>;
 integer HEAD_A_SPECULAR_GLOSS = 51;
 integer HEAD_A_SPECULAR_ENVIRONMENT = 1;

 string HEAD_B_DIFFUSE = "";
 string HEAD_B_NORMAL = "";
 string HEAD_B_SPECULAR = "";
 vector HEAD_B_SPECULAR_COLOR = <1.0, 1.0, 1.0>;
 integer HEAD_B_SPECULAR_GLOSS = 51;
 integer HEAD_B_SPECULAR_ENVIRONMENT = 1;

 string HEAD_C_DIFFUSE = "";
 string HEAD_C_NORMAL = "";
 string HEAD_C_SPECULAR = "";
 vector HEAD_C_SPECULAR_COLOR = <1.0, 1.0, 1.0>;
 integer HEAD_C_SPECULAR_GLOSS = 51;
 integer HEAD_C_SPECULAR_ENVIRONMENT = 1;

 // Uses HEAD_B by default.
 // (Due to development constraints we
 //  shortcutted this unwrap.)
 string MOUTH_DIFFUSE = "";
 string MOUTH_NORMAL = "";
 string MOUTH_SPECULAR = "";
 vector MOUTH_SPECULAR_COLOR = <1.0, 1.0, 1.0>;
 integer MOUTH_SPECULAR_GLOSS = 51;
 integer MOUTH_SPECULAR_ENVIRONMENT = 1;

 string EYE_DIFFUSE = "";
 string EYE_NORMAL = "";
 string EYE_SPECULAR = "";
 vector EYE_SPECULAR_COLOR = <1.0, 1.0, 1.0>;
 integer EYE_SPECULAR_GLOSS = 51;
 integer EYE_SPECULAR_ENVIRONMENT = 1;

 string ARMOR_DIFFUSE = "";
 string ARMOR_NORMAL = "";
 string ARMOR_SPECULAR = "";
 vector ARMOR_SPECULAR_COLOR = <1.0, 1.0, 1.0>;
 integer ARMOR_SPECULAR_GLOSS = 51;
 integer ARMOR_SPECULAR_ENVIRONMENT = 1;

 /////////////////////////////////////////////
 // EDIT ABOVE ONLY
 // unless you know what you're doing
 /////////////////////////////////////////////
 // Note liveries use 8659+1 for kobold.
 integer CHANNEL_COMM = 8660;
 float TIMER_DIE = 30.0;
 string PREFIX = "liv_texture";
 string S = ";";

 sendTextures() {
   sendSingle("body", BODY_DIFFUSE);
   sendSingle("body_norm", BODY_NORMAL);
   sendSingleSpecular("body_spec", BODY_SPECULAR, BODY_SPECULAR_COLOR, BODY_SPECULAR_GLOSS, BODY_SPECULAR_ENVIRONMENT);
   sendSingle("head-a", HEAD_A_DIFFUSE);
   sendSingle("head-a_norm", HEAD_A_NORMAL);
   sendSingleSpecular("head-a_spec", HEAD_A_SPECULAR, HEAD_A_SPECULAR_COLOR, HEAD_A_SPECULAR_GLOSS, HEAD_A_SPECULAR_ENVIRONMENT);
   sendSingle("head-b", HEAD_B_DIFFUSE);
   sendSingle("head-b_norm", HEAD_B_NORMAL);
   sendSingleSpecular("head-b_spec", HEAD_B_SPECULAR, HEAD_B_SPECULAR_COLOR, HEAD_B_SPECULAR_GLOSS, HEAD_B_SPECULAR_ENVIRONMENT);
   sendSingle("head-c", HEAD_C_DIFFUSE);
   sendSingle("head-c_norm", HEAD_C_NORMAL);
   sendSingleSpecular("head-c_spec", HEAD_C_SPECULAR, HEAD_C_SPECULAR_COLOR, HEAD_C_SPECULAR_GLOSS, HEAD_C_SPECULAR_ENVIRONMENT);
   sendSingle("eye", EYE_DIFFUSE);
   sendSingle("eye_norm", EYE_NORMAL);
   sendSingleSpecular("eye_spec", EYE_SPECULAR, EYE_SPECULAR_COLOR, EYE_SPECULAR_GLOSS, EYE_SPECULAR_ENVIRONMENT);
   if (MOUTH_DIFFUSE) {
     sendSingle("mouth", MOUTH_DIFFUSE);
     sendSingle("mouth_norm", MOUTH_NORMAL);
     sendSingleSpecular("mouth_spec", MOUTH_SPECULAR, MOUTH_SPECULAR_COLOR, MOUTH_SPECULAR_GLOSS, MOUTH_SPECULAR_ENVIRONMENT);
   }
   else {
     sendSingle("mouth", HEAD_B_DIFFUSE);
     sendSingle("mouth_norm", HEAD_B_NORMAL);
     sendSingleSpecular("mouth_spec", HEAD_B_SPECULAR, HEAD_B_SPECULAR_COLOR, HEAD_B_SPECULAR_GLOSS, HEAD_B_SPECULAR_ENVIRONMENT);
   }
   sendSingle("armor", ARMOR_DIFFUSE);
   sendSingle("armor_norm", ARMOR_NORMAL);
   sendSingleSpecular("armor_spec", ARMOR_SPECULAR, ARMOR_SPECULAR_COLOR, ARMOR_SPECULAR_GLOSS, ARMOR_SPECULAR_ENVIRONMENT);
   llOwnerSay(MSG_APPLIED);
 }

 sendSingle(string sPart, string sTexture) {
   if (sTexture) {
     llRegionSayTo(llGetOwner(), CHANNEL_COMM, PREFIX+S+sPart+S+sTexture);
   }
 }

 sendSingleSpecular(string sPart, string sTexture, vector vColor, integer iGloss, integer iEnv) {
   if (sTexture) {
     llRegionSayTo(llGetOwner(), CHANNEL_COMM, PREFIX+S+sPart+S+sTexture+S+(string)vColor+S+(string)iGloss+S+(string)iEnv);
   }
 }

 default {
   on_rez(integer a) {
     sendTextures();
     llSetTimerEvent(TIMER_DIE);
   }

   touch_start(integer n) {
     if (llDetectedKey(0) != llGetOwner()) return;
     sendTextures();
     llSetTimerEvent(TIMER_DIE);
   }

   timer() {
     // Only delete self if we're a customer.
     if (llGetOwner() != llGetCreator()) {
       // And if we're not attached, to avoid errors
       if (!llGetAttached()) {
         llDie();
       }
     }
     llSetTimerEvent(0.0);
   }
 }
Edit - Upload - Edit Sidebar
Page last modified on January 31, 2020, at 12:19 AM