14 Feb 18 - Mod.fla template v0.98.3 (2 Viewers)

Iago

Content Creator
Joined
Aug 19, 2014
Iago Iago That's probably because the arm costume layers are something I kitbashed together, and aren't actually in the proper object hierarchy. If you don't use animtools and change his arm position using the menu, what happens?

EDIT: Check the updateHisArmCostume() method. Is it actually implemented, or is there stuff commented out?

Thanks for answering. The arm works normally in default position when passing from holding to free and viceversa.
When in another position (like the one in the picture I posted) the sleeve returns to the arm while the menu is displayed.

All references to the updateHisArmCostume() method and all lines within it are uncommented.Here is the code, if you want to have a look at it:

Code:
import flash.geom.ColorTransform;
import flash.display.MovieClip;

/**    v0.98.1 change log
    Re-implemented jaw/lips to use proxy method.
    Added warning to components that require explicit listener activation.
*/

//variable declarations
var loader, her, him, g, lProxy;                        //main references
var nipr, nipl, nippiercer, nippiercel;                    //her nipples
var rtit, ltit, uboob;                                    //her breasts
var chest, navelpierce, back, butt, futa;                //her torso
var thighr, rthighmask, calfr;                            //her right leg
var thighl, calfl;                                        //her left leg
var shoulderl, sternum;                                    //her torso (under)
var neck, ear, herface, jaw, hernose;                    //her head
var ulip, uteeth, lteeth, ulipstick, llipstick;            //her mouth
var browll, browlf, browrl, browrf;                        //her brows
var specs, iris, eyeridge;                                //her eyes
var handr, fingerr, forearmr, forearmrb, upperarmr;        //her right arm
var handl, handlb, fingerl, forearml, upperarml;        //her left arm
var hfootl, hcalfl, hthighl;                            //his left leg
var hcalfr, hfootr, hthighr;                            //his right leg
var htorso, htopback, hip, newpenis;                    //his torso
var hupperarmr, hforearmr, hhandr;                        //his right arm
var hupperarml, hforearml, hhandl;                        //his left arm
var hisArmCostumeL, hisArmCostumeR;                        //his arm costume
var htitr, htitl;                                        //his breasts
var hnipr, hnipl;                                        //his nipples
var hisTitCostumeL, hisTitCostumeR;                        //his breast costume

function initl(l) {
    var i:uint;

    //character code - generate on Modding tab
//    g.inGameMenu.loadData("earring:stud");

    //additional loop for each component to hide
/*    for (i = 0; i<her.torso.rightCalfContainer.calf.numChildren; i++) {
        her.torso.rightCalfContainer.calf.getChildAt(i).visible = false;
    }
*/
    //---------------------------her components---------------------------\\
    //---------------------------right nipple
//    nipr = new newnippler();

    //adds as nipple - follows skin HSL sliders on Options tab
//    loader.loadManual(nipr, her.torso.midLayer.rightBreast.nipple);

    //---------------------------left nipple
//    nipl = new newnipplel();

    //adds as nipple - follows skin HSL sliders on Options tab
//    loader.loadManual(nipl, her.torsoBack.leftBreast.nipple);

    //---------------------------right breast
/*    rtit = new breastr();
    for(i = 0; i < rtit.numChildren; i++) {
        rtit.getChildAt(i).gotoAndStop(g.characterControl.breastSize + 1);
    }
*/
    //adds as skin - follows skin HSL sliders on Options tab
//    loader.loadManual(rtit, her.torso.midLayer.rightBreast);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(rtit, her.torso.topContainer.breastTop);

    //---------------------------left breast
/*    ltit = new breastl();
    for(i = 0; i < rtit.numChildren; i++) {
        ltit.getChildAt(i).gotoAndStop(g.characterControl.breastSize + 1);
    }
*/
    //adds as skin - follows skin HSL sliders on Options tab
//    loader.loadManual(ltit, her.torsoBack.leftBreast);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(ltit, her.torsoBackCostume.breastCostume.top);

    //---------------------------nipple piercings
/*    nippiercer = new newnippiercer();
    loader.loadManual(nippiercer, her.torso.nipplePiercing);

    nippiercel = new newnippiercel();
    loader.loadManual(nippiercel, her.torso.leftNipplePiercing);
*/
    //---------------------------chest/abs
//    chest = new newchest();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(chest, her.torso.midLayer.chest);

    //add as costume layers - ignore skin HSL sliders on Options tab
    //bottoms chest costume - above right thigh, upper chest masked
//    loader.loadManual(chest, her.torso.chestCostume);

    //upper chest costume - between breast costume, above back
//    loader.loadManual(chest, her.torso.upperChestCostume);

    //lower chest costume - between breast costume, below back
//    loader.loadManual(chest, her.torso.chestUnderCostume);

    //---------------------------underboob
//    uboob = new underboob();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(uboob, her.torso.midLayer.chest);

    //adds as upper chest costume - between breast costume, above back
//    loader.loadManual(chest, her.torso.upperChestCostume);

    //adds as lower chest costume - between breast costume, below back
//    loader.loadManual(chest, her.torso.chestUnderCostume);

    //register underboob slider listener
//    registerUBoob();

    //---------------------------belly piercing
/*    navelpierce = new bellypierce();
    loader.loadManual(navelpierce, her.torso.chestCostume.bellyPiercing);
*/
    //---------------------------back
//    back = new newback();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(back, her.torso.back);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(back, her.torso.backCostume);

    //---------------------------buttock
//    butt = new newbackside();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(butt, her.torsoBack.backside);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(butt, her.torsoBackCostume.backsideCostume);

    //---------------------------right thigh
//    thighr = new newthighr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(thighr, her.torso.leg.thigh);
//    loader.XYRA(thighr, "x:141.5;y:139;r:0;a:1");

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(thighr, her.torso.rightThighCostume);

    //remove thigh costume mask
/*    her.torso.rightThighCostume.mask = her.torso.getChildAt(
        her.torso.getChildIndex(her.torso.rightThighCostume)-1
    );
    rthighmask = her.torso.rightThighCostume.mask;
    her.torso.rightThighCostume.mask = null;
    rthighmask.visible = false;
*/
    //---------------------------right calf
//    calfr = new newcalfr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(calfr, her.torso.rightCalfContainer.calf);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(calfr, her.torso.rightCalfContainer.footwear);

    //---------------------------left thigh
//    thighl = new newthighl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(thighl, her.leftLegContainer.leg.thigh);
//    loader.XYRA(thighl, "x:141.5;y:139;r:0;a:1");

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(thighl, her.leftLegContainer.leg.leftThighCostume);

    //---------------------------left calf
//    calfl = new newcalfl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(calfl, her.leftLegContainer.leg.calf);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(calfl, her.leftLegContainer.leg.footwear);

    //---------------------------left shoulder
//    shoulderl = new newshoulderl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(shoulderl, her.torsoBack.leftShoulder);

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManual(shoulderl, her.torsoBackCostume);
    loader.XYRA(shoulderl, "x:51.5;y:-11.5;r:1;a:1");
*/
    //---------------------------sternum
//    sternum = new newchestback();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(sternum, her.torsoBack.chestBack);

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManual(sternum, her.torsoBackCostume);
    loader.XYRA(sternum, "x:83;y:66;r:27;a:1");
*/
    //---------------------------neck
//    neck = new newneck();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(neck, her.head.neck);

    //adds as collar - ignores HSL sliders on Options tab
/*    loader.loadManual(neck, her.collarContainer.collar);
    loader.XYRA(neck, "x:-8;y:-80;r:3;a:1");
*/
    //---------------------------ear
//    ear = new newear();
//    loader.loadManual(ear, her.ear);

    //---------------------------iris
//    iris = new neweye();
//    loader.loadManual(iris, her.eye.ball.irisContainer.iris);

    //---------------------------face
//    herface = new newface();
//    loader.loadManual(herface, her.head.face.skull);
   
    //---------------------------nose
//    hernose = new newnose();
//    loader.loadManual(hernose, her.head.face.nose);

    //---------------------------jaw
//    jaw = new newjaw();
//    loader.loadManual(jaw, her.head.jaw);

    //---------------------------upper lips
//    ulip = new upperlip();
//    loader.loadManual(ulip, her.head.face);
//    loader.XYRA(ulip, "x:120;y:100;r:0;a:1");

    //---------------------------upper lipstick
//    ulipstick = new upperlipstick();
//    loader.loadManual(ulipstick, her.topLipstickContainer);
   
    //---------------------------lower lipstick
//    llipstick = new lowerlipstick();
//    loader.loadManual(llipstick, her.bottomLipstick);
   
    //---------------------------upper teeth
//    uteeth = new upperteeth();
//    loader.loadManual(uteeth, her.head.teeth);
   
    //---------------------------lower teeth
//    lteeth = new lowerteeth();
//    loader.loadManual(lteeth, her.head.jaw.teeth);
   
    //---------------------------eyewear
//    specs = new neweyewear();
//    loader.loadManual(specs, her.eyewear);

    //---------------------------futa penis
//    futa = new herpenis();
//    loader.loadManual(futa, her.torso.penisContainer);

    //---------------------------eyebrows
/*    for(i = 0;i<her.rightEyebrow.numChildren;i++) {
        her.rightEyebrow.getChildAt(i).visible = false;
        her.leftEyebrow.getChildAt(i).visible = false;
    }

    browll = new leftbrowline();
    loader.loadManual(browll, her.leftEyebrow);
    loader.XYRA(browll, "x:4;y:19.5;r:0;a:1");
    her.leftEyebrow.leftEyebrowLine = browll;

    browlf = new leftbrowfill();
    loader.loadManual(browlf, her.leftEyebrow);
    loader.XYRA(browlf, "x:2;y:17.5;r:0;a:1");
    her.leftEyebrow.leftEyebrowFill = browlf;

    browrl = new rightbrowline();
    loader.loadManual(browrl, her.rightEyebrow);
    loader.XYRA(browrl, "x:39.5;y:28.5;r:0;a:1");
    her.rightEyebrow.rightEyebrowLine = browrl;

    browrf = new rightbrowfill();
    loader.loadManual(browrf, her.rightEyebrow);
    loader.XYRA(browrf, "x:38.5;y:27;r:0;a:1");
    her.rightEyebrow.rightEyebrowFill = browrf;
*/
    //---------------------------eye ridge
//    eyeridge = new neweyeridge();
//    loader.loadManual(eyeridge, her.eye.eyebrowUnderMask);

    //---------------------------right hand
//    handr = new newhandr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(handr, her.rightForeArmContainer.upperArm.foreArm.hand);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(handr, her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume);

    //NOTE: if right glove is implemented, the right hand needs to be in hand job mode ("her.currentRightArmPosition = 3" or character code "arms:[x],handjob;") before the fingers are loaded, or buggy behavior results
//    g.inGameMenu.loadData("arms:,handjob");

    //---------------------------right fingers
//    fingerr = new newfingerr();

    //glove positioning
/*    fingerr.x = her.rightForeArmContainer.upperArm.foreArm.hand.grip.x;
    fingerr.y = her.rightForeArmContainer.upperArm.foreArm.hand.grip.y;
    fingerr.rotation = her.rightForeArmContainer.upperArm.foreArm.hand.grip.rotation;
*/
    //glove finger scaling
//    registerGloveFingerScaling();

    //---------------------------left hand
//    handl = new newhandl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(handl, her.leftArmContainer.upperArm.foreArm.hand);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(handl, her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume);

    //---------------------------left hand (behind back)
//    handlb = new newhandlb();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(handlb, her.torso.midLayer.leftArm);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(handlb, her.torso.leftGlove);

    //---------------------------left fingers
//    fingerl = new newfingerl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(fingerl, her.leftHandOver.hand);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(fingerl, her.leftHandOver.hand.glove);

    //---------------------------right forearm
//    forearmr = new newforearmr();

    //adds as skin - follows HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearmr,
        her.rightForeArmContainer.upperArm.foreArm,
        her.rightForeArmContainer.upperArm.foreArm.getChildIndex(
            her.rightForeArmContainer.upperArm.foreArm.hand
        )
    );
*/
    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearmr,
        her.rightForeArmContainer.upperArmCostume.foreArmCostume,
        her.rightForeArmContainer.upperArmCostume.foreArmCostume.getChildIndex(
            her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume
        )
    );
*/
    //---------------------------right forearm (behind back)
//    forearmrb = new newforearmrb();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(forearmrb, her.torso.behindBackRightArm);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(forearmrb, her.torso.rightGlove);

    //---------------------------left forearm
//    forearml = new newforearml();

    //adds as skin - follows HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearml,
        her.leftArmContainer.upperArm.foreArm,
        her.leftArmContainer.upperArm.foreArm.getChildIndex(
            her.leftArmContainer.upperArm.foreArm.hand
        )
    );
*/
    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearml,
        her.leftArmContainer.upperArmCostume.foreArmCostume,
        her.leftArmContainer.upperArmCostume.foreArmCostume.getChildIndex(
            her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume
        )
    );
*/
    //---------------------------right upperarm
//    upperarmr = new newupperarmr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(upperarmr, her.rightArmContainer.upperArm);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(upperarmr, her.rightArmContainer.upperArmCostume);

    //---------------------------left upperarm
//    upperarml = new newupperarml();

    //adds as skin - follows HSL sliders on Options tab
/*    loader.loadManualIndex(
        upperarml,
        her.leftArmContainer.upperArm,
        her.leftArmContainer.upperArm.getChildIndex(
            her.leftArmContainer.upperArm.foreArm
        )
    );
*/
    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        upperarml,
        her.leftArmContainer.upperArmCostume,
        her.leftArmContainer.upperArmCostume.getChildIndex(
            her.leftArmContainer.upperArmCostume.foreArmCostume
        )
    );
*/
    //---------------------------his components---------------------------\\
    //-----To load his components as skin, see registerHisBodyType().-----\\
    //---------------------------left foot
//    hfootl = new hisfootl();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hfootl, him.leftLegCostume.calf.foot);

    //---------------------------right foot
//    hfootr = new hisfootr();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hfootr, him.rightLegCostume.calf.foot);

    //registers his foot type listener
//    registerHisFeet();

    //---------------------------left calf
//    hcalfl = new hiscalfl();

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        hcalfl,
        him.leftLegCostume.calf,
        him.leftLegCostume.calf.getChildIndex(
            him.leftLegCostume.calf.foot
        )
    );
*/
    //---------------------------right calf
//    hcalfr = new hiscalfr();

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        hcalfr,
        him.rightLegCostume.calf,
        him.rightLegCostume.calf.getChildIndex(
            him.rightLegCostume.calf.foot
        )
    );
*/
    //---------------------------left thigh
//    hthighl = new histhighl();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hthighl, him.leftLegCostume);

    //---------------------------right thigh
//    hthighr = new histhighr();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hthighr, him.rightLegCostume);

    //---------------------------torso
    htorso = new historso();

    //adds as costume - ignores HSL sliders on Options tab
    //loader.loadManual(htorso, him.overLayer.torso.costume);
    loader.loadManual(htorso, him.torsoLayer.torso);

    //---------------------------top back
//    htopback = new topback();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(htopback, him.topBack);

    //---------------------------pants hip
//    hip = new pantstop();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hip, him.midLayer.hips);

    //---------------------------right upper arm
//    hupperarmr = new hisupperarmr();

    //---------------------------right forearm
//    hforearmr = new hisforearmr();

    //---------------------------right hand
//    hhandr = new hishandr();

    //register his hand type listener
//    registerHisHandR();

    //---------------------------right arm costume
    hisArmCostumeR = new hisRightArmCostumeContainer();
    loader.loadManualIndex(
        hisArmCostumeR,
        him.armContainer.parent,
        him.armContainer.parent.getChildIndex(him.armContainer) + 1
    );

    hupperarmr = hisArmCostumeR.arm.upperArm;
    hforearmr = hisArmCostumeR.arm.lowerArm;
    hhandr = hisArmCostumeR.arm.hand;

    //---------------------------left upper arm
//    hupperarml = new hisupperarml();

    //---------------------------left forearm
//    hforearml = new hisforearml();

    //---------------------------left hand
//    hhandl = new hishandl();

    //---------------------------left arm costume
    hisArmCostumeL = new hisLeftArmCostumeContainer();
    loader.loadManual(hisArmCostumeL, him.overLayer);

    hupperarml = hisArmCostumeL.arm.upperArm;
    hforearml = hisArmCostumeL.arm.foreArm.foreArm;
    hhandl = hisArmCostumeL.arm.foreArm.hand;

    //---------------------------right breast
//    htitr = new hisbreastr();

    //---------------------------right breast costume
/*    hisTitCostumeR = new hisRightBreastCostumeContainer();
    loader.loadManualIndex(
        hisTitCostumeR,
        him.overLayer,
        him.overLayer.getChildIndex(him.overLayer.torso)
    );

    htitr = hisTitCostumeR.breast;
*/
    //---------------------------left breast
//    htitl = new hisbreastl();

    //---------------------------left breast costume
/*    hisTitCostumeL = new hisLeftBreastCostumeContainer();
    loader.loadManualIndex(
        hisTitCostumeL,
        him.overLayer,
        him.overLayer.getChildIndex(him.overLayer.torso) + 1
    );

    htitl = hisTitCostumeL.breast;
*/
    //---------------------------right nipple
//    hnipr = new hisnippler();
           
    //---------------------------left nipple
//    hnipl = new hisnipplel();

    //---------------------------penis
//    newpenis = new hispenis();

/*    loader.loadManualIndex(
        newpenis,
        him.penis,
        him.penis.getChildIndex(
            him.penis.wet
        ) - 1
    );
*/
    //register his penis type listener
//    registerHisPenisType();

    //adjust penis mask size
//    him.penis.mask.width *= 2;
//    him.penis.mask.height *= 1.5;

    //----------------------------misc code, function calls---------------------------\\
    //enable loader hue slider - component must have unique variable name
//    loader.registerForHueShift("slider name",[/*variable 1, variable 2, etc...*/]);
loader.registerForHueShift("UniversityJacketMain",[htorso.rgbFill,hforearml.rgbFill,hforearmr.rgbFill]);
loader.registerForHueShift("UniversityJacketDetails",[htorso.rgbFill2,hupperarml.rgbFill2,hforearml.rgbFill2,hupperarmr.rgbFill2,hforearmr.rgbFill2]);
registerForRGBSliders(him.bodies[0].topControl,[htorso.rgbFill,htorso.rgbFill2,hupperarml.rgbFill2,hforearml.rgbFill,hforearml.rgbFill2,hupperarmr.rgbFill2,hforearmr.rgbFill2,hforearmr.rgbFill]);
    //frame listener
    loader.addEnterFrame(frameRefresh);
   
    //register face listener
//    registerFace();
   
    //register his body type listener
//    registerHisBodyType();

    //register right arm position listener
//    registerRightArmPosition();

    //register left hand job listener
//    registerLeftHandPosition();

    //restores body visibility
    loader.registerUnloadFunction(resetBody);

    //remove proxy methods on mod unload
    loader.registerUnloadFunction(lProxy.restoreProxies);

    loader.unloadMod();
}

//wrapper for methods that need to execute every frame
function frameRefresh(l) {
    //his arm costumes
    updateHisArmCostume();
}

//her face
function registerFace() {
    var updateLips = lProxy.createProxy(her, "updateLips");
    updateLips.addPost(function():void {
        updateFace();
    }, false);

    //initialize
    updateFace();
}
function updateFace() {
    jaw.gotoAndStop(her.head.jaw.currentFrame);
   
    ulip.gotoAndStop(her.head.face.currentFrame);
    ulip.shape.gotoAndStop(her.head.face.lipOutline.currentFrame);

    ulipstick.gotoAndStop(her.head.face.currentFrame);
    ulipstick.shape.gotoAndStop(her.head.face.lipOutline.currentFrame);

    llipstick.gotoAndStop(her.head.face.lipOutline.currentFrame);
}

/**
 * manages RGB sliders
 * @param rgbSrc the control object from which the ARGB values are extracted,
 *     with the list of valid control objects listed below:
 *    hisTop:                him.bodies[0].topControl
 *    hisBottoms:            him.bodies[0].bottomsControl
 *    hisFootwear:        him.currentBody.footwearControl
 *    collar:                g.characterControl.collarControl
 *    cuffs:                g.characterControl.cuffsControl
 *    ankleCuffs:            g.characterControl.ankleCuffsControl
 *    gag:                g.characterControl.gagControl
 *    panties:            g.characterControl.pantiesControl
 *    top:                g.characterControl.braControl
 *    armwear:            g.characterControl.armwearControl
 *    bottoms:            g.characterControl.bottomsControl
 *    tops:                g.characterControl.topControl
 *    legwear:            g.characterControl.legwearControl
 *    legwearB:            g.characterControl.legwearBControl
 *    footwear:            g.characterControl.footwearControl
 *    eyewear:            g.characterControl.eyewearControl
 *    headwear:            g.characterControl.headwearControl
 *    tonguePiercing:        g.characterControl.tonguePiercingControl
 *    nipplePiercing:        g.characterControl.nipplePiercingControl
 *    bellyPiercing:        g.characterControl.bellyPiercingControl
 *    earring:            g.characterControl.earringControl
 * @param dest an Array containing the mod components to which the ARGB values are applied
 */
function registerForRGBSliders(rgbSrc, dest:Array) {
    var setFill = lProxy.createProxy(rgbSrc, "setFill");
    setFill.addPre(rgbSliders(dest), false);

    //initialize
    applySlider(rgbSrc.rgb1, dest, "rgbFill");
    applySlider(rgbSrc.rgb2, dest, "rgbFill2");
    var rgb = new Object();
    rgb.a = 1;
    rgb.r = rgbSrc.rgb1.r * 0.5;
    rgb.g = rgbSrc.rgb1.g * 0.5;
    rgb.b = rgbSrc.rgb1.b * 0.5;
    applySlider(rgb, dest, "outline");
}
function rgbSliders(dest:Array) {
    return function(argb:Object, targetName:String = "rgbFill"):void {
        applySlider(argb, dest, targetName);
        if(targetName == "rgbFill") {
            var rgb = new Object();
            rgb.a = 1;
            rgb.r = argb.r * 0.5;
            rgb.g = argb.g * 0.5;
            rgb.b = argb.b * 0.5;
            applySlider(rgb, dest, "outline");
        }
    }
}
function applySlider(argb:Object, dest:Array, targetName:String) {
    var trans:ColorTransform = new ColorTransform(
        0, 0, 0, argb.a, argb.r, argb.g, argb.b
    );

    for each(var o:MovieClip in dest) {
        if(o != null && o.getChildByName(targetName) != null) {
            o.getChildByName(targetName).transform.colorTransform = trans;
        }
    }
}

//his arm costume
function updateHisArmCostume() {
    //left arm
    hisArmCostumeL.arm.rotation = him.leftArmContainer.arm.rotation;
    hforearml.parent.rotation = him.leftArmContainer.arm.foreArm.rotation;

    hhandl.x = him.leftArmContainer.arm.foreArm.hand.x;
    hhandl.y = him.leftArmContainer.arm.foreArm.hand.y;
    hhandl.rotation = him.leftArmContainer.arm.foreArm.hand.rotation;

    //right arm
    hisArmCostumeR.x = him.armContainer.x;
    hisArmCostumeR.y = him.armContainer.y;
    hisArmCostumeR.rotation = him.armContainer.rotation;

    hisArmCostumeR.arm.x = him.armContainer.arm.x;
    hisArmCostumeR.arm.y = him.armContainer.arm.y;
    hisArmCostumeR.arm.rotation = him.armContainer.arm.rotation;

    hupperarmr.rotation = him.armContainer.arm.upperArm.rotation;
    hforearmr.rotation = him.armContainer.arm.lowerArm.rotation;
    hhandr.rotation = him.armContainer.arm.hand.rotation;

}

//update his penis
function registerHisPenisType() {
    var updatePenis = lProxy.createProxy(him, "updatePenis");
    updatePenis.addPost(function():void {
        updateHisPenis();
    }, false);

    //initialize
    updateHisPenis();
}
function updateHisPenis() {
    newpenis.gotoAndStop(him.penisNameList[him.currentPenisID]);
}

//redraw his body components on body type change
function registerHisBodyType() {
    var setBody = lProxy.createProxy(him, "setBody");
    setBody.addPost(function():void {
        updateHisBody();
    }, false);

    //initialize
    updateHisBody();
}
function updateHisBody() {
    //add as skin - follows HSL sliders on Options tab
    //---------------------------torso
    //loader.loadManual(htorso, him.torsoLayer.torso);

    //---------------------------right arm
//    loader.loadManual(hupperarmr, him.armContainer.arm.upperArm);
//    loader.loadManual(hforearmr, him.armContainer.arm.lowerArm);
//    loader.loadManual(hhandr, him.armContainer.arm.hand);

    //initialize
//    hisHandR();

    //---------------------------left arm
//    loader.loadManual(hupperarml, him.leftArmContainer.arm);
//    loader.loadManual(hforearml, him.leftArmContainer.arm.foreArm);
//    loader.loadManual(hhandl, him.leftArmContainer.arm.foreArm.hand);

    //---------------------------left leg
//    loader.loadManual(hfootl, him.leftLeg.calf.foot);
//    loader.loadManual(hcalfl, him.leftLeg.calf);
//    loader.loadManual(hthighl, him.leftLeg);

    //---------------------------right leg
//    loader.loadManual(hfootr, him.rightLeg.calf.foot);
//    loader.loadManual(hcalfr, him.rightLeg.calf);
//    loader.loadManual(hthighr, him.rightLeg);

    //initialize
//    hisFeet();

    //futa body
    if(him.currentBodyID == 1) {
        //breasts - skin
/*        if(!him.torsoLayer.rightBreastContainer.rightBreast.contains(htitr)) {
            loader.loadManual(htitr, him.torsoLayer.rightBreastContainer.rightBreast);
            loader.loadManual(htitl, him.torsoLayer.leftBreastContainer.leftBreast);
        }
*/
        //breasts - costume
/*        if(!hisTitCostumeR.visible) {
            hisTitCostumeL.visible = true;
            hisTitCostumeR.visible = true;
        }
*/
        //nipples
/*        if(!him.torsoLayer.rightBreastContainer.rightBreast.nipple.contains(hnipr)) {
            loader.loadManual(hnipr, him.torsoLayer.rightBreastContainer.rightBreast.nipple);
            loader.loadManual(hnipl, him.torsoLayer.leftBreastContainer.leftBreast.nipple);
        }
*/  
        //breasts - frames
/*        var i:Number;
        for(i = 0; i < htitr.numChildren; i++) {
            htitr.getChildAt(i).gotoAndStop(him.bodies[1].breastSize + 2);
        }
        for(i = 0; i < htitl.numChildren; i++) {
            htitl.getChildAt(i).gotoAndStop(him.bodies[1].breastSize + 2);
        }
*/
        //torso
//        htorso.gotoAndStop("futa");

        //torso costume position - futa
//        htorso.y = -22;
//        htorso.x = 1;

        //right arm
//        hupperarmr.gotoAndStop("futa");
//        hforearmr.gotoAndStop("futa");

        //left arm
//        hupperarml.gotoAndStop("futa");
//        hforearml.gotoAndStop("futa");
//        hhandl.gotoAndStop("futa");

        //left leg
//        hcalfl.gotoAndStop("futa");
//        hthighl.gotoAndStop("futa");

        //right leg
//        hcalfr.gotoAndStop("futa");
//        hthighr.gotoAndStop("futa");

        //pants hip
//        hip.gotoAndStop("futa");

        //top back
//        topback.gotoAndStop("futa");
    }
    else {
        //breasts - costume
/*        if(hisTitCostumeR.visible) {
            hisTitCostumeL.visible = false;
            hisTitCostumeR.visible = false;
        }
*/
        //torso
//        htorso.gotoAndStop("him");

        //torso costume position - him
//        htorso.y = htorso.x = 0;

        //right arm
//        hupperarmr.gotoAndStop("him");
//        hforearmr.gotoAndStop("him");

        //left arm
//        hupperarml.gotoAndStop("him");
//        hforearml.gotoAndStop("him");
//        hhandl.gotoAndStop("him");

        //left leg
//        hcalfl.gotoAndStop("him");
//        hthighl.gotoAndStop("him");

        //right leg
//        hcalfr.gotoAndStop("him");
//        hthighr.gotoAndStop("him");

        //pants hip
//        hip.gotoAndStop("him");

        //top back
//        topback.gotoAndStop("him");
    }
}

//manages his right hand type
function registerHisHandR() {
    var setArmPosition = lProxy.createProxy(him, "setArmPosition");
    setArmPosition.addPost(function():void {
        hisHandR();
    }, false);

    //initialize
    hisHandR();
}
function hisHandR() {
    if(him.currentBodyID == 1) {
        if(him.currentArmPosition == 0) {
            hhandr.gotoAndStop("futaopen");
        }
        else {
            hhandr.gotoAndStop("futaclosed");
        }
    }
    else {
        if(him.currentArmPosition == 0) {
            hhandr.gotoAndStop("himopen");
        }
        else {
            hhandr.gotoAndStop("himclosed");
        }
    }
}

//manages his foot type
function registerHisFeet() {
    var feet1 = lProxy.createProxy(him.bodies[0].footwearControl, "selectFunction");
    feet1.addPost(function():void {
        hisFeet();  
    }, false);

    var feet2 = lProxy.createProxy(him.bodies[1].footwearControl, "selectFunction");
    feet2.addPost(function():void {
        hisFeet();  
    }, false);
}
function hisFeet() {
    //skin layering
    if(him.leftLeg.calf.foot.contains(hfootl)) {
        him.leftLeg.calf.foot.setChildIndex(hfootl, him.leftLeg.calf.foot.numChildren - 1);
    }
    if(him.rightLeg.calf.foot.contains(hfootr)) {
        him.rightLeg.calf.foot.setChildIndex(hfootr, him.rightLeg.calf.foot.numChildren - 1);
    }

    if(him.currentBodyID == 1) {
        if(him.currentBody.footwearControl.selectedName == "Highheel") {
            hfootr.gotoAndStop("heel");
            hfootl.gotoAndStop("heel");
        }
        else {
            hfootr.gotoAndStop("futa");
            hfootl.gotoAndStop("futa");
        }
    }
    else {
        hfootr.gotoAndStop("him");
        hfootl.gotoAndStop("him");
    }
}

//restores body visibility
function resetBody() {
    var i:uint;

    //additional loop for each component to restore
/*    for (i = 0; i < her.torso.rightCalfContainer.calf.numChildren; i++) {
        her.torso.rightCalfContainer.calf.getChildAt(i).visible = true;
    }
*/
    //fix brows
/*    her.leftEyebrow.leftEyebrowLine = her.leftEyebrow.getChildAt(0);
    her.leftEyebrow.leftEyebrowFill = her.leftEyebrow.getChildAt(1);
    her.rightEyebrow.rightEyebrowLine = her.rightEyebrow.getChildAt(0);
    her.rightEyebrow.rightEyebrowFill = her.rightEyebrow.getChildAt(1);
    for(i = 0; i < 2; i++) {
        her.rightEyebrow.getChildAt(i).visible = true;
        her.leftEyebrow.getChildAt(i).visible = true;
    }
*/
    //restore masks
//    him.penis.mask.width /= 2;
//    him.penis.mask.height /= 1.5;
//    her.torso.rightThighCostume.mask = rthighmask;
}

//updates underboob with breast slider
function registerUBoob() {
    var setBreasts = lProxy.createProxy(g.characterControl, "setBreasts");
    setBreasts.addPost(function():void {
        uboobslider();
    }, false);

    //initialize
    uboobslider();
}
function uboobslider() {
    uboob.gotoAndStop(g.characterControl.breastSize+1);
}

//glove finger scaling
function registerGloveFingerScaling() {
    var tmp = lProxy.createProxy(her, "updateHandJobMode");
    tmp.addPost(function():void {
        if(her.rightForeArmContainer.upperArm.foreArm.hand.grip != null) {
            fingerr.scaleY = her.rightForeArmContainer.upperArm.foreArm.hand.grip.scaleY;
        }
    },false);

    if(her.rightForeArmContainer.upperArm.foreArm.hand.grip != null) {
        fingerr.scaleY = her.rightForeArmContainer.upperArm.foreArm.hand.grip.scaleY;
    }
}

//right arm, hand position
function registerRightArmPosition() {
    var setRightArmPosition = lProxy.createProxy(her, "setRightArmPosition");
    setRightArmPosition.addPost(function():void {
//        updateRightArm();
//        updateRightHand();
    }, false);

    //initialize
    updateRightArm();
    updateRightHand();
}
//right arm:back support
function updateRightArm() {
    if(her.currentRightArmPosition == 0) {
        upperarmr.gotoAndStop("backArm");
    }
    else {
        upperarmr.gotoAndStop("normalArm");
    }
}
//hand job
function updateRightHand() {
    if(her.currentRightArmPosition == 3) {
        handr.gotoAndStop("handjob");
        forearmr.gotoAndStop("handjob");
        fingerr.visible = true;

        //hand skin layering
/*        her.rightForeArmContainer.upperArm.foreArm.hand.setChildIndex(
            handr,
            her.rightForeArmContainer.upperArm.foreArm.hand.numChildren - 1
        );
*/
        //adds fingers as skin - follows HSL sliders on Options tab
/*        if(!her.rightForeArmContainer.upperArm.foreArm.hand.grip.contains(fingerr)) {
            loader.loadManual(fingerr, her.rightForeArmContainer.upperArm.foreArm.hand.grip);
        }
*/
        //adds fingers as costume - ignores HSL sliders on Options tab
/*        if(!her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove.contains(fingerr)) {
            loader.loadManual(
                fingerr,
                her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove
            );
            her.rightForeArmContainer.upperArmCostume.
                foreArmCostume.handCostume.setChildIndex
            (
                her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove,
                handr
            );
        }
*/
    }
    else {
        handr.gotoAndStop("normal");
        forearmr.gotoAndStop("normal");
        fingerr.visible = false;
    }
}

//left hand job
function registerLeftHandPosition() {
    var setLeftArmPosition = lProxy.createProxy(her, "setLeftArmPosition");
    setLeftArmPosition.addPost(function():void {
        updateLeftHand();
    }, false);
   
    //initialize
    updateLeftHand();
}
function updateLeftHand() {
    if(her.currentLeftArmPosition == 3) {
        handl.gotoAndStop("handjob");
        forearml.gotoAndStop("handjob");

        //hand skin layering
/*        her.leftArmContainer.upperArm.foreArm.hand.setChildIndex(
            handl,
            her.leftArmContainer.upperArm.foreArm.hand.numChildren - 1
        );
*/
    }
    else {
        handl.gotoAndStop("normal");
        forearml.gotoAndStop("normal");
    }
}
 

Faceless

Content Creator
Joined
Jun 12, 2011
Iago Iago Right, your code seems to be fine, so it's probably as I thought. The animtools tween changes aren't being propagated to the costume layers, because they aren't in the proper hierarchy. Ugh. Off the top of my head I can think of two potential fixes for this.
  1. Figure out how to insert the new layers into the proper hierarchy so that animtools will work. sby sby Would I be able to adapt the overtop stuff from your template for this?
  2. Get rid of the costume layers, and figure out how to selectively exempt layers from the skin HSL sliders.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
Iago Iago Right, your code seems to be fine, so it's probably as I thought. The animtools tween changes aren't being propagated to the costume layers, because they aren't in the proper hierarchy. Ugh. Off the top of my head I can think of two potential fixes for this.
  1. Figure out how to insert the new layers into the proper hierarchy so that animtools will work. sby sby Would I be able to adapt the overtop stuff from your template for this?
  2. Get rid of the costume layers, and figure out how to selectively exempt layers from the skin HSL sliders.
the overtop stuff is implemented in the template extension. in there i assign the movieclips that act as modpiece layers the same matrix as what the tops template uses:
rightArmm.transform.matrix = g.her.rightArmContainer.upperArmCostume.top.transform.matrix;

this rightArmm movieclip is a layer for overtop mod pieces to be added to.

i also had to add a few proxies to update the matrix on breast stuff

var lp10 = lProxy.createProxy(g.her.rightBreastController, "update");
lp10.addPost(rupdate,true);
lp10.hooked = true;

function rupdate()
{
rightBreastm.transform.matrix = g.her.rightBreastController._breastMatrix;
}


you could probably do the same matrix assignment stuff. don't know if gonna get complicated when you change the him
 

Faceless

Content Creator
Joined
Jun 12, 2011
Oh, you're using transformation matrices! Yeah, that's probably a better idea than manually copying XYR values...

Iago Iago Try out your position with this test file. Hopefully switching transformation matrices will fix this.
 
Last edited:

Faceless

Content Creator
Joined
Jun 12, 2011
Iago Iago Right, got it.

EDIT: Huh, just tried this position file with animtools v12, and that happens to his actual arm. Updating to animtools v18 reproduces your problem, where his arm is fine but not the costume. Assuming that's not a configuration issue on my part, that makes it seem like sby sby made some change between v12 and v18 that fixed his arm. I just have to trawl through the v18 source to find it and adapt it to the costume... *sigh*
 
Last edited:

sby

Content Creator
Coder
Joined
Sep 11, 2012
maybe it is this:

/*********************************/
animtoolsV15
registered him animation change with setbody ~bugfix


where i make sure to call him animation changed when his body is set:
var animchangeprox= lProxy.createProxy(g.him, "setBody");
animchangeprox.addPost(g.him.animationChanged, persistonresetforinitfolder == 1);


i imagine you might want to do the matrix assignment whenever setbody is performed.
 

Faceless

Content Creator
Joined
Jun 12, 2011
sby sby I'm stumped. When I run this code:
Code:
var ref1:Point = him.armContainer.arm.hand.localToGlobal(new Point());
var ref2:Point = hhandr.localToGlobal(new Point());
trace("----");
trace("original hand - x: " + ref1.x + ", y: " + ref1.y);
trace("hand costume - x: " + ref2.x + ", y: " + ref2.y);
to compare the positions of the sprites on the stage, I get the same values for both. Which tracks with the fact that when the menu is up the parts align properly. stuntcock stuntcock didn't you encounter a problem like this once?
 

stuntcock

Content Creator
Joined
Jun 5, 2012
stuntcock stuntcock didn't you encounter a problem like this once?
I don't think so. I've worked on very few clothing mods, and I haven't contributed to any male clothing mods. I've done scripting work for a few male body mods, but I haven't encountered this particular problem. The leash mods involved positioning items within the local coordinate-space of the guy's hands, but it yielded no surprises (i.e. attaching something to the guy's left hand was no more or less difficult than attaching something to the girl's left ear).

I vaguely recall some problems which involved "mod behaves/misbehaves during normal gameplay but then behaves/misbehaves when menu is visible." I believe that the problem involved a collision between lProxy code and ENTER_FRAME code. One (or the other) would have precedence and so you'd get weird visual results based on their interactions (such as "clothing always lags behind body motion by exactly 1 frame worth of movement" or "clothing begins to drift sideways when menu is called up, and will drift off the girl's body completely if menu is not closed promptly"). You might find it useful to investigate the role of ENTER_FRAME code (i.e. register a new ENTER_FRAME function and then include some trace statements within that function; compare their output with the output from your existing trace statements).

I can't completely follow the conversation here because some of the attachments have been deleted. It seems as if male body parts are appearing in the correct location while male clothes are not. Is that correct? Could we just sidestep the problem by implementing the clothes as a body mod and drawing them onto the skin sprites? Or do we need to do things properly so that the in-game RGB sliders will be compatible with the new clothes? Or do you want to fix the template for the sake of future modding projects (therefore a quick-and-dirty fix wouldn't be acceptable)?
 

Faceless

Content Creator
Joined
Jun 12, 2011
stuntcock stuntcock Right, basically with at least some animtools positions the costume container I created for his right arm doesn't align with the actual arm itself. As the point of adding a custom costume container was to remove those sprites from his skin HSL sliders, a proper fix is of course desired. But yeah, the problem is basically "menu=ok, no menu=broken". Hm, if the problem really is an lProxy-ENTER_FRAME collision it looks like I'll need to trawl through SDT itself to figure out where the arm animation is occurring so I can properly inject the costume updates without using ENTER_FRAME. "Fuck!" about covers it, I think... Still, thanks.
 

stuntcock

Content Creator
Joined
Jun 5, 2012
Hm, if the problem really is an lProxy-ENTER_FRAME collision it looks like I'll need to trawl through SDT itself to figure out where the arm animation is occurring so I can properly inject the costume updates without using ENTER_FRAME.
It isn't as bad as that.

The game's use of ENTER_FRAME isn't really a problem. I mean: it's literally necessary. If the game wasn't running ENTER_FRAME events then core logic (such as the him.move() function) wouldn't get invoked and so our lProxy pre/post methods would never take effect.

The interaction that I'm describing is between ENTER_FRAME stuff in mod code and lProxy stuff in mod code. But after looking into it for a few more minutes, it's actually even simpler than that. The problem occurs because of the order of function calls associated with ENTER_FRAME.

ENTER_FRAME functions will be invoked in the order in which they're registered:
  • SDT core code goes first
  • the Loader itself goes second
  • all other mods get invoked based on the order in which they invoked stage.addEventListener (this order is usually equivalent to their position in the $INIT$\Mods.txt list)
So in theory you're fine, because the "male clothing mod" based on your template will get loaded LONG after animtools (e.g. several minutes after the game has started). Therefore its code will always run against a scene which has been reorganized by animtools. But that's not actually true.

The order of events is like this:
  • CPU tick
  • Flash decides that it's time to render a new frame
  • SDT's ENTER_FRAME handler invokes among other things him.setArmPosition()
    • SDT's code moves the guy's arm into the default "standing" position.
    • Let's call this Point 1. Keep it in mind, it's relevant in the next paragraph.
  • the Loader ENTER_FRAME handler is invoked
    • The Loader itself doesn't actually care about the guy's arm. It does nothing.
    • Let's call this Point 2.
  • sby's ENTER_FRAME handler (within animtools) is called
    • animtools reacts to the new frame by among other things moving the guy's arm into the customized position (bathtub or whatever)
    • animtools code does not move the guy's arm clothing, because there's no such concept in SDT. Arm clothing layers do not exist.
  • Let's call this Point 3.
Faceless Faceless : you want your code to execute at point 3. You want to move the arm clothing into the same customized position as the guy's arm. If you had used stage.addEventListener(Event.ENTER_FRAME, updateHisArmCostume); then that's exactly what would happen. But you used loader.addEnterFrame(updateHisArmCostume); instead. That method doesn't touch the "global" ENTER_FRAME priority queue; it adds your function to the Loader's internal queue. So your code takes effect at Step 2. You dutifully move the guy's clothing to match his arm position, but you do so right after SDT has moved his arm into the default position.

Why does it work when the menu is open? SDT stops calling him.setArmPosition(). animtools moves his arm into the custom position. At the start of the next frame, it's still in the custom position. SDT doesn't change that. So your template code moves his clothing to the custom location, and everything is cool.

Please note that a proxy on him.setArmPosition would not work. It would cause your function to be invoked at Point 1 instead of Point 2. You need it to occur at Point 3.

Possible Solutions:
  • replace the loader.addEnterFrame line (in the Mod Template.fla file) with stage.addEventListener. If your code gets invoked at Point 3 then the arm clothing will work correctly.
  • draw the arm costume sprite as a child of the arm sprite, so that the updateHisArmCostume function becomes unnecessary
    • Note: this would screw up the layering slightly; arm clothing might not look like it's supposed to.
  • ask sby to use loader.addEnterFrame instead of stage.addEventListener. If sby's code gets invoked at Point 2 then the arm clothing would work properly.
    • Note: this might introduce new timing problems elsewhere, because there are other mods which don't "expect" animtools to be invoked early.
  • ask sby to use lProxy.addPost instead of stage.addEventListener. If sby's code gets invoked at Point 1 then the arm clothing would work correctly.
    • Note: this would involve a lot of code refactoring. sby probably won't do it unless we can present some really good rationale.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
the animtools his arm code does this:

var bod = g.him.bodies[g.him.currentBodyID];
//stuff
bod.updateArmPosition();

perhaps you can proxy that? i prefer not to mess with the order of things
(you may have to proxy all of them bods)

also, i don't know how easy it would be to find all clothing pieces on his arm and update them, but if it is doable i can add it to animtools so as to cover the other him loader mods.
 

Faceless

Content Creator
Joined
Jun 12, 2011
I decided to split the right arm costume stuff off into its own native ENTER_FRAME listener, separate from the left arm costume stuff which still uses the loader API listener. That seems like the least problematic fix. Thanks, stuntcock stuntcock .

sby sby No, I tried that earlier. No dice, the arm costume doesn't ever change position at all.

Iago Iago , here's the fix:
Code:
function initl(l) {

    //...other stuff

    //frame listener - loader API
   loader.addEnterFrame(frameRefresh);
   
   //frame listener - Flash native
   loader.addEventListener(Event.ENTER_FRAME, updateHisRightArmCostume);

    //...more other stuff
}

//wrapper for methods that need to execute every frame
function frameRefresh(l) {
   //update his left arm costume
   updateHisLeftArmCostume();
}

//his left arm costume
function updateHisLeftArmCostume() {
   hisArmCostumeL.arm.transform.matrix = him.leftArmContainer.arm.transform.matrix;
   hforearml.parent.transform.matrix = him.leftArmContainer.arm.foreArm.transform.matrix;
   hhandl.transform.matrix = him.leftArmContainer.arm.foreArm.hand.transform.matrix;
}

//his right arm costume
function updateHisRightArmCostume(e:Event) {
   hisArmCostumeR.transform.matrix = him.armContainer.transform.matrix;

   hisArmCostumeR.arm.transform.matrix = him.armContainer.arm.transform.matrix;
   hupperarmr.transform.matrix = him.armContainer.arm.upperArm.transform.matrix;
   hforearmr.transform.matrix = him.armContainer.arm.lowerArm.transform.matrix;
   hhandr.transform.matrix = him.armContainer.arm.hand.transform.matrix;
}
 

Iago

Content Creator
Joined
Aug 19, 2014
I might have made something wrong but this is what I've got, both with the default position and the Animtool one. The right arm is perfectly fixed but now is the left one that's not in the right place:
screenshot0003.png



I've added this:

//frame listener - Flash native
loader.addEventListener(Event.ENTER_FRAME, updateHisRightArmCostume);

under this:

//frame listener - loader API
loader.addEnterFrame(frameRefresh);

changed the line inside frameRefresh and paste the two new functions at the end of the code.

If I don't change the line in frameRefresh, both arms work but the left one sleeve has a bit of lag which I suppose was the thing you were trying to fix in that arm.

Maybe there's something I've forgot to uncomment or comment this time? Here is my code:

Code:
import flash.geom.ColorTransform;
import flash.display.MovieClip;

/**    v0.98.1 change log
    Re-implemented jaw/lips to use proxy method.
    Added warning to components that require explicit listener activation.
*/

//variable declarations
var loader, her, him, g, lProxy;                        //main references
var nipr, nipl, nippiercer, nippiercel;                    //her nipples
var rtit, ltit, uboob;                                    //her breasts
var chest, navelpierce, back, butt, futa;                //her torso
var thighr, rthighmask, calfr;                            //her right leg
var thighl, calfl;                                        //her left leg
var shoulderl, sternum;                                    //her torso (under)
var neck, ear, herface, jaw, hernose;                    //her head
var ulip, uteeth, lteeth, ulipstick, llipstick;            //her mouth
var browll, browlf, browrl, browrf;                        //her brows
var specs, iris, eyeridge;                                //her eyes
var handr, fingerr, forearmr, forearmrb, upperarmr;        //her right arm
var handl, handlb, fingerl, forearml, upperarml;        //her left arm
var hfootl, hcalfl, hthighl;                            //his left leg
var hcalfr, hfootr, hthighr;                            //his right leg
var htorso, htopback, hip, newpenis;                    //his torso
var hupperarmr, hforearmr, hhandr;                        //his right arm
var hupperarml, hforearml, hhandl;                        //his left arm
var hisArmCostumeL, hisArmCostumeR;                        //his arm costume
var htitr, htitl;                                        //his breasts
var hnipr, hnipl;                                        //his nipples
var hisTitCostumeL, hisTitCostumeR;                        //his breast costume

function initl(l) {
    var i:uint;

    //character code - generate on Modding tab
//    g.inGameMenu.loadData("earring:stud");

    //additional loop for each component to hide
/*    for (i = 0; i<her.torso.rightCalfContainer.calf.numChildren; i++) {
        her.torso.rightCalfContainer.calf.getChildAt(i).visible = false;
    }
*/
    //---------------------------her components---------------------------\\
    //---------------------------right nipple
//    nipr = new newnippler();

    //adds as nipple - follows skin HSL sliders on Options tab
//    loader.loadManual(nipr, her.torso.midLayer.rightBreast.nipple);

    //---------------------------left nipple
//    nipl = new newnipplel();

    //adds as nipple - follows skin HSL sliders on Options tab
//    loader.loadManual(nipl, her.torsoBack.leftBreast.nipple);

    //---------------------------right breast
/*    rtit = new breastr();
    for(i = 0; i < rtit.numChildren; i++) {
        rtit.getChildAt(i).gotoAndStop(g.characterControl.breastSize + 1);
    }
*/
    //adds as skin - follows skin HSL sliders on Options tab
//    loader.loadManual(rtit, her.torso.midLayer.rightBreast);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(rtit, her.torso.topContainer.breastTop);

    //---------------------------left breast
/*    ltit = new breastl();
    for(i = 0; i < rtit.numChildren; i++) {
        ltit.getChildAt(i).gotoAndStop(g.characterControl.breastSize + 1);
    }
*/
    //adds as skin - follows skin HSL sliders on Options tab
//    loader.loadManual(ltit, her.torsoBack.leftBreast);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(ltit, her.torsoBackCostume.breastCostume.top);

    //---------------------------nipple piercings
/*    nippiercer = new newnippiercer();
    loader.loadManual(nippiercer, her.torso.nipplePiercing);

    nippiercel = new newnippiercel();
    loader.loadManual(nippiercel, her.torso.leftNipplePiercing);
*/
    //---------------------------chest/abs
//    chest = new newchest();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(chest, her.torso.midLayer.chest);

    //add as costume layers - ignore skin HSL sliders on Options tab
    //bottoms chest costume - above right thigh, upper chest masked
//    loader.loadManual(chest, her.torso.chestCostume);

    //upper chest costume - between breast costume, above back
//    loader.loadManual(chest, her.torso.upperChestCostume);

    //lower chest costume - between breast costume, below back
//    loader.loadManual(chest, her.torso.chestUnderCostume);

    //---------------------------underboob
//    uboob = new underboob();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(uboob, her.torso.midLayer.chest);

    //adds as upper chest costume - between breast costume, above back
//    loader.loadManual(chest, her.torso.upperChestCostume);

    //adds as lower chest costume - between breast costume, below back
//    loader.loadManual(chest, her.torso.chestUnderCostume);

    //register underboob slider listener
//    registerUBoob();

    //---------------------------belly piercing
/*    navelpierce = new bellypierce();
    loader.loadManual(navelpierce, her.torso.chestCostume.bellyPiercing);
*/
    //---------------------------back
//    back = new newback();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(back, her.torso.back);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(back, her.torso.backCostume);

    //---------------------------buttock
//    butt = new newbackside();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(butt, her.torsoBack.backside);

    //adds as costume - ignores skin HSL sliders on Options tab
//    loader.loadManual(butt, her.torsoBackCostume.backsideCostume);

    //---------------------------right thigh
//    thighr = new newthighr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(thighr, her.torso.leg.thigh);
//    loader.XYRA(thighr, "x:141.5;y:139;r:0;a:1");

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(thighr, her.torso.rightThighCostume);

    //remove thigh costume mask
/*    her.torso.rightThighCostume.mask = her.torso.getChildAt(
        her.torso.getChildIndex(her.torso.rightThighCostume)-1
    );
    rthighmask = her.torso.rightThighCostume.mask;
    her.torso.rightThighCostume.mask = null;
    rthighmask.visible = false;
*/
    //---------------------------right calf
//    calfr = new newcalfr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(calfr, her.torso.rightCalfContainer.calf);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(calfr, her.torso.rightCalfContainer.footwear);

    //---------------------------left thigh
//    thighl = new newthighl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(thighl, her.leftLegContainer.leg.thigh);
//    loader.XYRA(thighl, "x:141.5;y:139;r:0;a:1");

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(thighl, her.leftLegContainer.leg.leftThighCostume);

    //---------------------------left calf
//    calfl = new newcalfl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(calfl, her.leftLegContainer.leg.calf);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(calfl, her.leftLegContainer.leg.footwear);

    //---------------------------left shoulder
//    shoulderl = new newshoulderl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(shoulderl, her.torsoBack.leftShoulder);

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManual(shoulderl, her.torsoBackCostume);
    loader.XYRA(shoulderl, "x:51.5;y:-11.5;r:1;a:1");
*/
    //---------------------------sternum
//    sternum = new newchestback();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(sternum, her.torsoBack.chestBack);

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManual(sternum, her.torsoBackCostume);
    loader.XYRA(sternum, "x:83;y:66;r:27;a:1");
*/
    //---------------------------neck
//    neck = new newneck();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(neck, her.head.neck);

    //adds as collar - ignores HSL sliders on Options tab
/*    loader.loadManual(neck, her.collarContainer.collar);
    loader.XYRA(neck, "x:-8;y:-80;r:3;a:1");
*/
    //---------------------------ear
//    ear = new newear();
//    loader.loadManual(ear, her.ear);

    //---------------------------iris
//    iris = new neweye();
//    loader.loadManual(iris, her.eye.ball.irisContainer.iris);

    //---------------------------face
//    herface = new newface();
//    loader.loadManual(herface, her.head.face.skull);
    
    //---------------------------nose
//    hernose = new newnose();
//    loader.loadManual(hernose, her.head.face.nose);

    //---------------------------jaw
//    jaw = new newjaw();
//    loader.loadManual(jaw, her.head.jaw);

    //---------------------------upper lips
//    ulip = new upperlip();
//    loader.loadManual(ulip, her.head.face);
//    loader.XYRA(ulip, "x:120;y:100;r:0;a:1");

    //---------------------------upper lipstick
//    ulipstick = new upperlipstick();
//    loader.loadManual(ulipstick, her.topLipstickContainer);
    
    //---------------------------lower lipstick
//    llipstick = new lowerlipstick();
//    loader.loadManual(llipstick, her.bottomLipstick);
    
    //---------------------------upper teeth
//    uteeth = new upperteeth();
//    loader.loadManual(uteeth, her.head.teeth);
    
    //---------------------------lower teeth
//    lteeth = new lowerteeth();
//    loader.loadManual(lteeth, her.head.jaw.teeth);
    
    //---------------------------eyewear
//    specs = new neweyewear();
//    loader.loadManual(specs, her.eyewear);

    //---------------------------futa penis
//    futa = new herpenis();
//    loader.loadManual(futa, her.torso.penisContainer);

    //---------------------------eyebrows
/*    for(i = 0;i<her.rightEyebrow.numChildren;i++) {
        her.rightEyebrow.getChildAt(i).visible = false;
        her.leftEyebrow.getChildAt(i).visible = false;
    }

    browll = new leftbrowline();
    loader.loadManual(browll, her.leftEyebrow);
    loader.XYRA(browll, "x:4;y:19.5;r:0;a:1");
    her.leftEyebrow.leftEyebrowLine = browll;

    browlf = new leftbrowfill();
    loader.loadManual(browlf, her.leftEyebrow);
    loader.XYRA(browlf, "x:2;y:17.5;r:0;a:1");
    her.leftEyebrow.leftEyebrowFill = browlf;

    browrl = new rightbrowline();
    loader.loadManual(browrl, her.rightEyebrow);
    loader.XYRA(browrl, "x:39.5;y:28.5;r:0;a:1");
    her.rightEyebrow.rightEyebrowLine = browrl;

    browrf = new rightbrowfill();
    loader.loadManual(browrf, her.rightEyebrow);
    loader.XYRA(browrf, "x:38.5;y:27;r:0;a:1");
    her.rightEyebrow.rightEyebrowFill = browrf;
*/
    //---------------------------eye ridge
//    eyeridge = new neweyeridge();
//    loader.loadManual(eyeridge, her.eye.eyebrowUnderMask);

    //---------------------------right hand
//    handr = new newhandr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(handr, her.rightForeArmContainer.upperArm.foreArm.hand);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(handr, her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume);

    //NOTE: if right glove is implemented, the right hand needs to be in hand job mode ("her.currentRightArmPosition = 3" or character code "arms:[x],handjob;") before the fingers are loaded, or buggy behavior results
//    g.inGameMenu.loadData("arms:,handjob");

    //---------------------------right fingers
//    fingerr = new newfingerr();

    //glove positioning
/*    fingerr.x = her.rightForeArmContainer.upperArm.foreArm.hand.grip.x;
    fingerr.y = her.rightForeArmContainer.upperArm.foreArm.hand.grip.y;
    fingerr.rotation = her.rightForeArmContainer.upperArm.foreArm.hand.grip.rotation;
*/
    //glove finger scaling
//    registerGloveFingerScaling();

    //---------------------------left hand
//    handl = new newhandl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(handl, her.leftArmContainer.upperArm.foreArm.hand);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(handl, her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume);

    //---------------------------left hand (behind back)
//    handlb = new newhandlb();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(handlb, her.torso.midLayer.leftArm);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(handlb, her.torso.leftGlove);

    //---------------------------left fingers
//    fingerl = new newfingerl();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(fingerl, her.leftHandOver.hand);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(fingerl, her.leftHandOver.hand.glove);

    //---------------------------right forearm
//    forearmr = new newforearmr();

    //adds as skin - follows HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearmr,
        her.rightForeArmContainer.upperArm.foreArm,
        her.rightForeArmContainer.upperArm.foreArm.getChildIndex(
            her.rightForeArmContainer.upperArm.foreArm.hand
        )
    );
*/
    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearmr,
        her.rightForeArmContainer.upperArmCostume.foreArmCostume,
        her.rightForeArmContainer.upperArmCostume.foreArmCostume.getChildIndex(
            her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume
        )
    );
*/
    //---------------------------right forearm (behind back)
//    forearmrb = new newforearmrb();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(forearmrb, her.torso.behindBackRightArm);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(forearmrb, her.torso.rightGlove);

    //---------------------------left forearm
//    forearml = new newforearml();

    //adds as skin - follows HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearml,
        her.leftArmContainer.upperArm.foreArm,
        her.leftArmContainer.upperArm.foreArm.getChildIndex(
            her.leftArmContainer.upperArm.foreArm.hand
        )
    );
*/
    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        forearml,
        her.leftArmContainer.upperArmCostume.foreArmCostume,
        her.leftArmContainer.upperArmCostume.foreArmCostume.getChildIndex(
            her.leftArmContainer.upperArmCostume.foreArmCostume.handCostume
        )
    );
*/
    //---------------------------right upperarm
//    upperarmr = new newupperarmr();

    //adds as skin - follows HSL sliders on Options tab
//    loader.loadManual(upperarmr, her.rightArmContainer.upperArm);

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(upperarmr, her.rightArmContainer.upperArmCostume);

    //---------------------------left upperarm
//    upperarml = new newupperarml();

    //adds as skin - follows HSL sliders on Options tab
/*    loader.loadManualIndex(
        upperarml,
        her.leftArmContainer.upperArm,
        her.leftArmContainer.upperArm.getChildIndex(
            her.leftArmContainer.upperArm.foreArm
        )
    );
*/
    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        upperarml,
        her.leftArmContainer.upperArmCostume,
        her.leftArmContainer.upperArmCostume.getChildIndex(
            her.leftArmContainer.upperArmCostume.foreArmCostume
        )
    );
*/
    //---------------------------his components---------------------------\\
    //-----To load his components as skin, see registerHisBodyType().-----\\
    //---------------------------left foot
//    hfootl = new hisfootl();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hfootl, him.leftLegCostume.calf.foot);

    //---------------------------right foot
//    hfootr = new hisfootr();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hfootr, him.rightLegCostume.calf.foot);

    //registers his foot type listener
//    registerHisFeet();

    //---------------------------left calf
//    hcalfl = new hiscalfl();

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        hcalfl,
        him.leftLegCostume.calf,
        him.leftLegCostume.calf.getChildIndex(
            him.leftLegCostume.calf.foot
        )
    );
*/
    //---------------------------right calf
//    hcalfr = new hiscalfr();

    //adds as costume - ignores HSL sliders on Options tab
/*    loader.loadManualIndex(
        hcalfr,
        him.rightLegCostume.calf,
        him.rightLegCostume.calf.getChildIndex(
            him.rightLegCostume.calf.foot
        )
    );
*/
    //---------------------------left thigh
//    hthighl = new histhighl();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hthighl, him.leftLegCostume);

    //---------------------------right thigh
//    hthighr = new histhighr();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hthighr, him.rightLegCostume);

    //---------------------------torso
    htorso = new historso();

    //adds as costume - ignores HSL sliders on Options tab
    //loader.loadManual(htorso, him.overLayer.torso.costume);
    loader.loadManual(htorso, him.torsoLayer.torso);

    //---------------------------top back
//    htopback = new topback();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(htopback, him.topBack);

    //---------------------------pants hip
//    hip = new pantstop();

    //adds as costume - ignores HSL sliders on Options tab
//    loader.loadManual(hip, him.midLayer.hips);

    //---------------------------right upper arm
//    hupperarmr = new hisupperarmr();

    //---------------------------right forearm
//    hforearmr = new hisforearmr();

    //---------------------------right hand
//    hhandr = new hishandr();

    //register his hand type listener
//    registerHisHandR();

    //---------------------------right arm costume
    hisArmCostumeR = new hisRightArmCostumeContainer();
    loader.loadManualIndex(
        hisArmCostumeR,
        him.armContainer.parent,
        him.armContainer.parent.getChildIndex(him.armContainer) + 1
    );

    hupperarmr = hisArmCostumeR.arm.upperArm;
    hforearmr = hisArmCostumeR.arm.lowerArm;
    hhandr = hisArmCostumeR.arm.hand;

    //---------------------------left upper arm
    //hupperarml = new hisupperarml();

    //---------------------------left forearm
    //hforearml = new hisforearml();

    //---------------------------left hand
    //hhandl = new hishandl();
   //---------------------------left arm costume
    hisArmCostumeL = new hisLeftArmCostumeContainer();
    loader.loadManual(hisArmCostumeL, him.overLayer);

    hupperarml = hisArmCostumeL.arm.upperArm;
    hforearml = hisArmCostumeL.arm.foreArm.foreArm;
    hhandl = hisArmCostumeL.arm.foreArm.hand;

    //---------------------------right breast
//    htitr = new hisbreastr();

    //---------------------------right breast costume
/*    hisTitCostumeR = new hisRightBreastCostumeContainer();
    loader.loadManualIndex(
        hisTitCostumeR,
        him.overLayer,
        him.overLayer.getChildIndex(him.overLayer.torso)
    );

    htitr = hisTitCostumeR.breast;
*/
    //---------------------------left breast
//    htitl = new hisbreastl();

    //---------------------------left breast costume
/*    hisTitCostumeL = new hisLeftBreastCostumeContainer();
    loader.loadManualIndex(
        hisTitCostumeL,
        him.overLayer,
        him.overLayer.getChildIndex(him.overLayer.torso) + 1
    );

    htitl = hisTitCostumeL.breast;
*/
    //---------------------------right nipple
//    hnipr = new hisnippler();
            
    //---------------------------left nipple
//    hnipl = new hisnipplel();

    //---------------------------penis
//    newpenis = new hispenis();

/*    loader.loadManualIndex(
        newpenis,
        him.penis,
        him.penis.getChildIndex(
            him.penis.wet
        ) - 1
    );
*/
    //register his penis type listener
//    registerHisPenisType();

    //adjust penis mask size
//    him.penis.mask.width *= 2;
//    him.penis.mask.height *= 1.5;

    //----------------------------misc code, function calls---------------------------\\
    //enable loader hue slider - component must have unique variable name
//    loader.registerForHueShift("slider name",[/*variable 1, variable 2, etc...*/]);
loader.registerForHueShift("UniversityJacketMain",[htorso.rgbFill,hforearml.rgbFill,hforearmr.rgbFill]);
loader.registerForHueShift("UniversityJacketDetails",[htorso.rgbFill2,hupperarml.rgbFill2,hforearml.rgbFill2,hupperarmr.rgbFill2,hforearmr.rgbFill2]);
registerForRGBSliders(him.bodies[0].topControl,[htorso.rgbFill,htorso.rgbFill2,hupperarml.rgbFill2,hforearml.rgbFill,hforearml.rgbFill2,hupperarmr.rgbFill2,hforearmr.rgbFill2,hforearmr.rgbFill]);
    //frame listener
    loader.addEnterFrame(frameRefresh);
  
   //frame listener - Flash native
   loader.addEventListener(Event.ENTER_FRAME, updateHisRightArmCostume);
    
    //register face listener
//    registerFace();
    
    //register his body type listener
//    registerHisBodyType();

    //register right arm position listener
//    registerRightArmPosition();

    //register left hand job listener
//    registerLeftHandPosition();

    //restores body visibility
    loader.registerUnloadFunction(resetBody);

    //remove proxy methods on mod unload
    loader.registerUnloadFunction(lProxy.restoreProxies);

    loader.unloadMod();
}

//wrapper for methods that need to execute every frame
function frameRefresh(l) {
    //his arm costumes
    //updateHisArmCostume();
   updateHisLeftArmCostume();
}

//her face
function registerFace() {
    var updateLips = lProxy.createProxy(her, "updateLips");
    updateLips.addPost(function():void {
        updateFace();
    }, false);

    //initialize
    updateFace();
}
function updateFace() {
    jaw.gotoAndStop(her.head.jaw.currentFrame);
    
    ulip.gotoAndStop(her.head.face.currentFrame);
    ulip.shape.gotoAndStop(her.head.face.lipOutline.currentFrame);

    ulipstick.gotoAndStop(her.head.face.currentFrame);
    ulipstick.shape.gotoAndStop(her.head.face.lipOutline.currentFrame);

    llipstick.gotoAndStop(her.head.face.lipOutline.currentFrame);
}

/**
 * manages RGB sliders
 * @param rgbSrc the control object from which the ARGB values are extracted,
 *     with the list of valid control objects listed below:
 *    hisTop:                him.bodies[0].topControl
 *    hisBottoms:            him.bodies[0].bottomsControl
 *    hisFootwear:        him.currentBody.footwearControl
 *    collar:                g.characterControl.collarControl
 *    cuffs:                g.characterControl.cuffsControl
 *    ankleCuffs:            g.characterControl.ankleCuffsControl
 *    gag:                g.characterControl.gagControl
 *    panties:            g.characterControl.pantiesControl
 *    top:                g.characterControl.braControl
 *    armwear:            g.characterControl.armwearControl
 *    bottoms:            g.characterControl.bottomsControl
 *    tops:                g.characterControl.topControl
 *    legwear:            g.characterControl.legwearControl
 *    legwearB:            g.characterControl.legwearBControl
 *    footwear:            g.characterControl.footwearControl
 *    eyewear:            g.characterControl.eyewearControl
 *    headwear:            g.characterControl.headwearControl
 *    tonguePiercing:        g.characterControl.tonguePiercingControl
 *    nipplePiercing:        g.characterControl.nipplePiercingControl
 *    bellyPiercing:        g.characterControl.bellyPiercingControl
 *    earring:            g.characterControl.earringControl
 * @param dest an Array containing the mod components to which the ARGB values are applied
 */
function registerForRGBSliders(rgbSrc, dest:Array) {
    var setFill = lProxy.createProxy(rgbSrc, "setFill");
    setFill.addPre(rgbSliders(dest), false);

    //initialize
    applySlider(rgbSrc.rgb1, dest, "rgbFill");
    applySlider(rgbSrc.rgb2, dest, "rgbFill2");
    var rgb = new Object();
    rgb.a = 1;
    rgb.r = rgbSrc.rgb1.r * 0.5;
    rgb.g = rgbSrc.rgb1.g * 0.5;
    rgb.b = rgbSrc.rgb1.b * 0.5;
    applySlider(rgb, dest, "outline");
}
function rgbSliders(dest:Array) {
    return function(argb:Object, targetName:String = "rgbFill"):void {
        applySlider(argb, dest, targetName);
        if(targetName == "rgbFill") {
            var rgb = new Object();
            rgb.a = 1;
            rgb.r = argb.r * 0.5;
            rgb.g = argb.g * 0.5;
            rgb.b = argb.b * 0.5;
            applySlider(rgb, dest, "outline");
        }
    }
}
function applySlider(argb:Object, dest:Array, targetName:String) {
    var trans:ColorTransform = new ColorTransform(
        0, 0, 0, argb.a, argb.r, argb.g, argb.b
    );

    for each(var o:MovieClip in dest) {
        if(o != null && o.getChildByName(targetName) != null) {
            o.getChildByName(targetName).transform.colorTransform = trans;
        }
    }
}

//his arm costume
function updateHisArmCostume() {
    //left arm
    hisArmCostumeL.arm.rotation = him.leftArmContainer.arm.rotation;
    hforearml.parent.rotation = him.leftArmContainer.arm.foreArm.rotation;

    hhandl.x = him.leftArmContainer.arm.foreArm.hand.x;
    hhandl.y = him.leftArmContainer.arm.foreArm.hand.y;
    hhandl.rotation = him.leftArmContainer.arm.foreArm.hand.rotation;

    //right arm
    hisArmCostumeR.x = him.armContainer.x;
    hisArmCostumeR.y = him.armContainer.y;
    hisArmCostumeR.rotation = him.armContainer.rotation;

    hisArmCostumeR.arm.x = him.armContainer.arm.x;
    hisArmCostumeR.arm.y = him.armContainer.arm.y;
    hisArmCostumeR.arm.rotation = him.armContainer.arm.rotation;

    hupperarmr.rotation = him.armContainer.arm.upperArm.rotation;
    hforearmr.rotation = him.armContainer.arm.lowerArm.rotation;
    hhandr.rotation = him.armContainer.arm.hand.rotation;

}

//update his penis
function registerHisPenisType() {
    var updatePenis = lProxy.createProxy(him, "updatePenis");
    updatePenis.addPost(function():void {
        updateHisPenis();
    }, false);

    //initialize
    updateHisPenis();
}
function updateHisPenis() {
    newpenis.gotoAndStop(him.penisNameList[him.currentPenisID]);
}

//redraw his body components on body type change
function registerHisBodyType() {
    var setBody = lProxy.createProxy(him, "setBody");
    setBody.addPost(function():void {
        updateHisBody();
    }, false);

    //initialize
    updateHisBody();
}
function updateHisBody() {
    //add as skin - follows HSL sliders on Options tab
    //---------------------------torso
    //loader.loadManual(htorso, him.torsoLayer.torso);

    //---------------------------right arm
//    loader.loadManual(hupperarmr, him.armContainer.arm.upperArm);
//    loader.loadManual(hforearmr, him.armContainer.arm.lowerArm);
//    loader.loadManual(hhandr, him.armContainer.arm.hand);

    //initialize
//    hisHandR();

    //---------------------------left arm
//    loader.loadManual(hupperarml, him.leftArmContainer.arm);
//    loader.loadManual(hforearml, him.leftArmContainer.arm.foreArm);
//    loader.loadManual(hhandl, him.leftArmContainer.arm.foreArm.hand);

    //---------------------------left leg
//    loader.loadManual(hfootl, him.leftLeg.calf.foot);
//    loader.loadManual(hcalfl, him.leftLeg.calf);
//    loader.loadManual(hthighl, him.leftLeg);

    //---------------------------right leg
//    loader.loadManual(hfootr, him.rightLeg.calf.foot);
//    loader.loadManual(hcalfr, him.rightLeg.calf);
//    loader.loadManual(hthighr, him.rightLeg);

    //initialize
//    hisFeet();

    //futa body
    if(him.currentBodyID == 1) {
        //breasts - skin
/*        if(!him.torsoLayer.rightBreastContainer.rightBreast.contains(htitr)) {
            loader.loadManual(htitr, him.torsoLayer.rightBreastContainer.rightBreast);
            loader.loadManual(htitl, him.torsoLayer.leftBreastContainer.leftBreast);
        }
*/
        //breasts - costume
/*        if(!hisTitCostumeR.visible) {
            hisTitCostumeL.visible = true;
            hisTitCostumeR.visible = true;
        }
*/
        //nipples
/*        if(!him.torsoLayer.rightBreastContainer.rightBreast.nipple.contains(hnipr)) {
            loader.loadManual(hnipr, him.torsoLayer.rightBreastContainer.rightBreast.nipple);
            loader.loadManual(hnipl, him.torsoLayer.leftBreastContainer.leftBreast.nipple);
        }
*/   
        //breasts - frames
/*        var i:Number;
        for(i = 0; i < htitr.numChildren; i++) {
            htitr.getChildAt(i).gotoAndStop(him.bodies[1].breastSize + 2);
        }
        for(i = 0; i < htitl.numChildren; i++) {
            htitl.getChildAt(i).gotoAndStop(him.bodies[1].breastSize + 2);
        }
*/
        //torso
//        htorso.gotoAndStop("futa");

        //torso costume position - futa
//        htorso.y = -22;
//        htorso.x = 1;

        //right arm
//        hupperarmr.gotoAndStop("futa");
//        hforearmr.gotoAndStop("futa");

        //left arm
//        hupperarml.gotoAndStop("futa");
//        hforearml.gotoAndStop("futa");
//        hhandl.gotoAndStop("futa");

        //left leg
//        hcalfl.gotoAndStop("futa");
//        hthighl.gotoAndStop("futa");

        //right leg
//        hcalfr.gotoAndStop("futa");
//        hthighr.gotoAndStop("futa");

        //pants hip
//        hip.gotoAndStop("futa");

        //top back
//        topback.gotoAndStop("futa");
    }
    else {
        //breasts - costume
/*        if(hisTitCostumeR.visible) {
            hisTitCostumeL.visible = false;
            hisTitCostumeR.visible = false;
        }
*/
        //torso
//        htorso.gotoAndStop("him");

        //torso costume position - him
//        htorso.y = htorso.x = 0;

        //right arm
//        hupperarmr.gotoAndStop("him");
//        hforearmr.gotoAndStop("him");

        //left arm
//        hupperarml.gotoAndStop("him");
//        hforearml.gotoAndStop("him");
//        hhandl.gotoAndStop("him");

        //left leg
//        hcalfl.gotoAndStop("him");
//        hthighl.gotoAndStop("him");

        //right leg
//        hcalfr.gotoAndStop("him");
//        hthighr.gotoAndStop("him");

        //pants hip
//        hip.gotoAndStop("him");

        //top back
//        topback.gotoAndStop("him");
    }
}

//manages his right hand type
function registerHisHandR() {
    var setArmPosition = lProxy.createProxy(him, "setArmPosition");
    setArmPosition.addPost(function():void {
        hisHandR();
    }, false);

    //initialize
    hisHandR();
}
function hisHandR() {
    if(him.currentBodyID == 1) {
        if(him.currentArmPosition == 0) {
            hhandr.gotoAndStop("futaopen");
        }
        else {
            hhandr.gotoAndStop("futaclosed");
        }
    }
    else {
        if(him.currentArmPosition == 0) {
            hhandr.gotoAndStop("himopen");
        }
        else {
            hhandr.gotoAndStop("himclosed");
        }
    }
}

//manages his foot type
function registerHisFeet() {
    var feet1 = lProxy.createProxy(him.bodies[0].footwearControl, "selectFunction");
    feet1.addPost(function():void {
        hisFeet();   
    }, false);

    var feet2 = lProxy.createProxy(him.bodies[1].footwearControl, "selectFunction");
    feet2.addPost(function():void {
        hisFeet();   
    }, false);
}
function hisFeet() {
    //skin layering
    if(him.leftLeg.calf.foot.contains(hfootl)) {
        him.leftLeg.calf.foot.setChildIndex(hfootl, him.leftLeg.calf.foot.numChildren - 1);
    }
    if(him.rightLeg.calf.foot.contains(hfootr)) {
        him.rightLeg.calf.foot.setChildIndex(hfootr, him.rightLeg.calf.foot.numChildren - 1);
    }

    if(him.currentBodyID == 1) {
        if(him.currentBody.footwearControl.selectedName == "Highheel") {
            hfootr.gotoAndStop("heel");
            hfootl.gotoAndStop("heel");
        }
        else {
            hfootr.gotoAndStop("futa");
            hfootl.gotoAndStop("futa");
        }
    }
    else {
        hfootr.gotoAndStop("him");
        hfootl.gotoAndStop("him");
    }
}

//restores body visibility
function resetBody() {
    var i:uint;

    //additional loop for each component to restore
/*    for (i = 0; i < her.torso.rightCalfContainer.calf.numChildren; i++) {
        her.torso.rightCalfContainer.calf.getChildAt(i).visible = true;
    }
*/
    //fix brows
/*    her.leftEyebrow.leftEyebrowLine = her.leftEyebrow.getChildAt(0);
    her.leftEyebrow.leftEyebrowFill = her.leftEyebrow.getChildAt(1);
    her.rightEyebrow.rightEyebrowLine = her.rightEyebrow.getChildAt(0);
    her.rightEyebrow.rightEyebrowFill = her.rightEyebrow.getChildAt(1);
    for(i = 0; i < 2; i++) {
        her.rightEyebrow.getChildAt(i).visible = true;
        her.leftEyebrow.getChildAt(i).visible = true;
    }
*/
    //restore masks
//    him.penis.mask.width /= 2;
//    him.penis.mask.height /= 1.5;
//    her.torso.rightThighCostume.mask = rthighmask;
}

//updates underboob with breast slider
function registerUBoob() {
    var setBreasts = lProxy.createProxy(g.characterControl, "setBreasts");
    setBreasts.addPost(function():void {
        uboobslider();
    }, false);

    //initialize
    uboobslider();
}
function uboobslider() {
    uboob.gotoAndStop(g.characterControl.breastSize+1);
}

//glove finger scaling
function registerGloveFingerScaling() {
    var tmp = lProxy.createProxy(her, "updateHandJobMode");
    tmp.addPost(function():void {
        if(her.rightForeArmContainer.upperArm.foreArm.hand.grip != null) {
            fingerr.scaleY = her.rightForeArmContainer.upperArm.foreArm.hand.grip.scaleY;
        }
    },false);

    if(her.rightForeArmContainer.upperArm.foreArm.hand.grip != null) {
        fingerr.scaleY = her.rightForeArmContainer.upperArm.foreArm.hand.grip.scaleY;
    }
}

//right arm, hand position
function registerRightArmPosition() {
    var setRightArmPosition = lProxy.createProxy(her, "setRightArmPosition");
    setRightArmPosition.addPost(function():void {
//        updateRightArm();
//        updateRightHand();
    }, false);

    //initialize
    updateRightArm();
    updateRightHand();
}
//right arm:back support
function updateRightArm() {
    if(her.currentRightArmPosition == 0) {
        upperarmr.gotoAndStop("backArm");
    }
    else {
        upperarmr.gotoAndStop("normalArm");
    }
}
//hand job
function updateRightHand() {
    if(her.currentRightArmPosition == 3) {
        handr.gotoAndStop("handjob");
        forearmr.gotoAndStop("handjob");
        fingerr.visible = true;

        //hand skin layering
/*        her.rightForeArmContainer.upperArm.foreArm.hand.setChildIndex(
            handr,
            her.rightForeArmContainer.upperArm.foreArm.hand.numChildren - 1
        );
*/
        //adds fingers as skin - follows HSL sliders on Options tab
/*        if(!her.rightForeArmContainer.upperArm.foreArm.hand.grip.contains(fingerr)) {
            loader.loadManual(fingerr, her.rightForeArmContainer.upperArm.foreArm.hand.grip);
        }
*/
        //adds fingers as costume - ignores HSL sliders on Options tab
/*        if(!her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove.contains(fingerr)) {
            loader.loadManual(
                fingerr,
                her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove
            );
            her.rightForeArmContainer.upperArmCostume.
                foreArmCostume.handCostume.setChildIndex
            (
                her.rightForeArmContainer.upperArmCostume.foreArmCostume.handCostume.glove,
                handr
            );
        }
*/
    }
    else {
        handr.gotoAndStop("normal");
        forearmr.gotoAndStop("normal");
        fingerr.visible = false;
    }
}

//left hand job
function registerLeftHandPosition() {
    var setLeftArmPosition = lProxy.createProxy(her, "setLeftArmPosition");
    setLeftArmPosition.addPost(function():void {
        updateLeftHand();
    }, false);
    
    //initialize
    updateLeftHand();
}
function updateLeftHand() {
    if(her.currentLeftArmPosition == 3) {
        handl.gotoAndStop("handjob");
        forearml.gotoAndStop("handjob");

        //hand skin layering
/*        her.leftArmContainer.upperArm.foreArm.hand.setChildIndex(
            handl,
            her.leftArmContainer.upperArm.foreArm.hand.numChildren - 1
        );
*/
    }
    else {
        handl.gotoAndStop("normal");
        forearml.gotoAndStop("normal");
    }
}

//his left arm costume
function updateHisLeftArmCostume() {
   hisArmCostumeL.arm.transform.matrix = him.leftArmContainer.arm.transform.matrix;
   hforearml.parent.transform.matrix = him.leftArmContainer.arm.foreArm.transform.matrix;
   hhandl.transform.matrix = him.leftArmContainer.arm.foreArm.hand.transform.matrix;
}

//his right arm costume
function updateHisRightArmCostume(e:Event) {
   hisArmCostumeR.transform.matrix = him.armContainer.transform.matrix;

   hisArmCostumeR.arm.transform.matrix = him.armContainer.arm.transform.matrix;
   hupperarmr.transform.matrix = him.armContainer.arm.upperArm.transform.matrix;
   hforearmr.transform.matrix = him.armContainer.arm.lowerArm.transform.matrix;
   hhandr.transform.matrix = him.armContainer.arm.hand.transform.matrix;
}
 

Faceless

Content Creator
Joined
Jun 12, 2011
Iago Iago Add this line to initl() after you instantiate hisArmCostumeL:
Code:
hisArmCostumeL.transform.matrix = him.leftArmContainer.transform.matrix;
 

Iago

Content Creator
Joined
Aug 19, 2014
Now it works fine. There's still some lag on the left arm for a second, right after loading a new position, but I'm not complaining XD. Thanks for all the time and work you put into it. I'll make good use of it.
 

Huitznahua

Content Creator
Joined
Feb 6, 2014
Ok I feel dumb after this many years tinkering with sdt but : how do I add the RGB control with this template ?

I tried this :
Code:
//register RGB sliders
registerForRGBSliders(main.g.characterControl.bottomsControl, [newback, newchest, newthighr]);

but I got this error :
Code:
Scene 1, Layer 'Layer 1', Frame 1, Line 598, Column 24    1120: Access of undefined property main.

I drawn on the layer named rgbFill. Do I still need to create a symbol and give it the instance name rgbFill like with the sby sby template ?
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.