1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Independent penis length and width.

Discussion in 'Filled Requests' started by blackmare, Sep 3, 2015.

  1. blackmare

    blackmare Potential Patron

    Joined:
    Sep 3, 2015
    Messages:
    2
    Likes Received:
    0
    Is there anyway to make the penis size sliders independent of each other so increasing the length doesn't also increase the width by default?
     
  2. stuntcock

    stuntcock Club Regular Staff Member Moderator

    Joined:
    Jun 5, 2012
    Messages:
    1,520
    Likes Received:
    353
    Why not just adjust the length slider to the desired value, and then adjust the width slider back to the desired value?



    Since the task is trivial (we simply need to copy-paste a function from SDT.swf and then comment out one line of code), here you go:
    Code:
    package flash {
    	import flash.display.MovieClip;
    	public dynamic class Main extends MovieClip {
    		public var lProxy;
    		public var him;
    		public var her;
    		private var EventBus;
    		
    		public function initl(l) : void {
    			EventBus = l.getVanillaClass("obj.EventBus");
    			
    			var setPenisLength = (lProxy as Class).createProxy(him, "setPenisLength");
    			setPenisLength.addPre(setPenisLength_Pre, true);
    			setPenisLength.hooked = false;
    			l.updateStatusCol("Penis length and width sliders have been decoupled.", "#00ff00");
    		}
    		
    		private function setPenisLength_Pre(newLength:Number) : void {
    			 var widthCoefficient:Number = him.currentPenisWidthScale / him.currentPenisLengthScale;
    			 him.currentPenisLengthScale = him.MIN_PENIS_SIZE + (him.MAX_PENIS_SIZE - him.MIN_PENIS_SIZE) * newLength;
    			 //him.currentPenisWidthScale = Math.max(him.MIN_PENIS_SIZE,Math.min(him.MAX_PENIS_SIZE, widthCoefficient * him.currentPenisLengthScale));
    			 him.penis.scaleX = him.currentPenisLengthScale;
    			 him.penis.scaleY = him.currentPenisWidthScale;
    			 her.hisPenisSizeChanged(him.currentPenisLengthScale * him.currentPenis.length);
    			 EventBus.dispatch("penisTipPosChanged");
    		}
    	}
    }
    
    There's something wrong with the preceding code - it doesn't run properly after being passed through the Lightweight Compiler. I just compiled it as a heavyweight Flash mod since I doubt that the mod will actually be used (because the length-width coupling has existed since early SDT and everyone already knows about the workaround). Therefore IDGAF about efficiency.

    Edit: the aforementioned problem has been fixed. Credit to MG.



    SDT-anisotropicPenisAdjustment.mod

    √ tested with penisrangeV4
    X not tested with anything else
     
  3. Faceless

    Faceless Club Regular Content Creator

    Joined:
    Jun 12, 2011
    Messages:
    1,118
    Likes Received:
    22
    I think it's just the compiler doesn't play nice with the proxy system, because I ran into a similar issue when trying to tie some stuff to an RGB slider.
     
  4. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,331
    Likes Received:
    73
    hmm, during one of my past mods i actually had to re-incorporate the combined scaling xD
     
  5. stuntcock

    stuntcock Club Regular Staff Member Moderator

    Joined:
    Jun 5, 2012
    Messages:
    1,520
    Likes Received:
    353
    MG provided a corrected code snippet which compiles and runs properly. Upon review, I believe that the problem was a missing visibility modifier:
    Code:
    // This is broken ...
    function initl(l) : void {
    
    
    // This works ...
    public function initl(l) : void {
    
    The ultimate cause of the error is laziness. When writing AS3 code in Flash as "companion" logic for template-based mods (such as costumes and hairstyles), we can be very sloppy about specifying visibility modifiers, return types, etc... This stuff can usually be forgotten (or deliberately excluded) without any adverse effect on the mod's behaviour. After a while, you pick up bad habits :-[

    I've updated the code block in the previous post, and replaced the MOD file with a "lightweight" compiled version. I don't like the public-variable approach suggested by MG (because it feels like action at a distance) but I've left it in because it's effective and very concise.
     
  6. blackmare

    blackmare Potential Patron

    Joined:
    Sep 3, 2015
    Messages:
    2
    Likes Received:
    0
    Wow, thanks you guys for all the help. :)
     
  7. Faceless

    Faceless Club Regular Content Creator

    Joined:
    Jun 12, 2011
    Messages:
    1,118
    Likes Received:
    22
    Hm, interesting. This isn't really helped by the fact that the Flash IDE automatically wraps things into classes for you, so you can get away with not using classes at all, and thus trying to apply visibility simply doesn't work.