Clench teeth toggle (1 Viewer)

Hank East

Content Creator
Joined
Jan 25, 2012
Title. A mod that toggles teeth clenching on and off.

EDIT:

Code:
package
{
	public class Main extends flash.display.MovieClip
	{
		public var lProxy:Class;
		public var her;
		public function initl(l)
		{
			var lp = lProxy.createProxy(her, "startClenchingTeeth");
			lp.hooked = false;
			l.unloadMod();
		}
	}
}

EDIT2:

Code:
package
{
	import flash.utils.Dictionary;
	public class Main extends flash.display.MovieClip
	{
		public var modSettingsLoader:Class;
		public var lProxy:Class;
		public var cData;
		public var loader;
		public var her;

		private var lp:*;

		public function initl(l)
		{
			var msl:* = new modSettingsLoader("Clench", settingsLoaded, cData);
			lp = lProxy.createProxy(her, "startClenchingTeeth");
			l.unloadMod();
		}
		public function settingsLoaded(e):void
		{
			var dict:Dictionary = e.settings;
			if (dict["toggleClench"] != null)
				loader.registerFunctionPersist(toggleClench, dict["toggleClench"]);
		}
		private function toggleClench() : void
		{
			lp.hooked = !lp.hooked;
			if(!lp.hooked) her.clenchTeeth = false;
			loader.updateStatus("Toggle Clench: " + (lp.hooked?"ON":"OFF"));
		}
	}
}

Clench.txt
Code:
toggleClench=37


EDIT3:
Different approach, ignores teeth clench:
Code:
package
{
	public class Main extends flash.display.MovieClip
	{
		public var lProxy:Class;
		public var her:*;
		private var clench_tmp:Boolean = false;

		public function initl(l:*) : void
		{
			var lp = lProxy.createProxy(her, "move");
			
			lp.addPre(
					function(a, b)
					{
						clench_tmp = her.clenchTeeth;
						her.clenchTeeth = false;
					}, true);

			lp.addPost(
					function()
					{
			            if(her.penisInMouthDist > 0)
			               her.clenchedTeethTimer = Math.max(0,her.clenchedTeethTimer-1);
			            else if(her.pos < 1/10)
			            	her.clenchedTeethTimer = Math.min(her.clenchedTeethTime, her.clenchedTeethTimer+1);
						her.clenchTeeth = clench_tmp;
					}, true);


			lp = lProxy.createProxy(her, "startClenchingTeeth");
			lp.addPre(
					function()
					{
						clench_tmp = true;
						l.updateStatus("CLENCH!");
					}, true);

			lp = lProxy.createProxy(her, "updateLips");
			lp.addPre(
					function()
					{
						her.clenchTeeth = clench_tmp || (her.clenchedTeethTimer != her.clenchedTeethTime) && !her.mouthFull;
					}, true);

			lp = lProxy.createProxy(her, "startClenchingTeeth");
			var mf_temp;
			lp.addPre(
					function()
					{
						l.updateStatus(her.clenchTeeth + "_" + her.mouthFull);
						clench_tmp = her.clenchTeeth;
						her.clenchTeeth = false;
						mf_temp = her.mouthFull;
						her.mouthFull = false;
					}, true);
			lp.addPost(
					function()
					{
						her.mouthFull = mf_temp;
						her.clenchTeeth = clench_tmp;
					}, true);

			l.unloadMod();
		}
	}
}
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
looked like you could run it through the alternate compiler

save the stuff in a text file, set extension to .as. name it 'clenchteethmod.as' to follow this example
save the as3compile.exe (found on forums) in the same location as the file

open command prompt in current folder by holding shift and right clicking, and choose 'open command window here'
type
as3compile.exe clenchteethmod.as




edit - the alternate compiler probably has a batch script included or something to avoid the command prompt stuff, but this works well
 

Hank East

Content Creator
Joined
Jan 25, 2012
So I attempted to make an SWF outta this but I wasn't able to do it. May I kindly ask for someone with more experience to turn this code into a mod?
 

stuntcock

Content Creator
Joined
Jun 5, 2012
So I attempted to make an SWF outta this but I wasn't able to do it. May I kindly ask for someone with more experience to turn this code into a mod?
Making it into a SWF mod shouldn't be difficult. You copy-paste the code into a TXT file (or an AS file if you want to be fancy) and then run the Lightweight Mod Compiler with your source file as an argument.

Code:
as3compile "clenchTeeth.as" -o "clenchTeeth.mod" -v

The actual problem is that animtools run a per-frame logic cycle which automatically un-clenches the girl's teeth. So the mod file below will allow you to toggle the clench state, but it's useless if you're running animtools (at best, you'll see a momentary glimpse of teeth before animtools resets the girl's mouth into a receptive state).

Solution: go bug sby sby to un-bundle the noClenchTeeth mod from animtools (or reduce it to a position-based configuration option instead of an "always-on" thing).

View attachment clenchTeeth.mod
View attachment clench.txt
Code:
package
{
   import flash.utils.Dictionary;
   public class Main extends flash.display.MovieClip
   {
     public const modName:String = "clenchTeeth";
     public const modVersion:Number = 0.1;
     public var modSettingsLoader:Class;
     public var cData;
     public var loader;
     public var her;

     public function initl(l)
     {
       var msl:* = new modSettingsLoader("Clench", settingsLoaded, cData);
       l.unloadMod();
     }
     public function settingsLoaded(e):void
     {
       var dict:Dictionary = e.settings;
       if (dict["toggleClench"] != null)
         loader.registerFunctionPersist(toggleClench, dict["toggleClench"]);
     }
     private function toggleClench() : void
     {
       if (her.clenchTeeth) {
         her.clenchTeeth = false;
         her.clenchedTeethTime = 50;
         her.clenchedTeethTimer = 999;
       } else {
         her.startClenchingTeeth();
  her.clenchedTeethTime = 99999;
       }
       loader.updateStatus("Toggle Clench: " + (her.clenchTeeth?"ON":"OFF"));
     }
   }
}

Please note that this is a "soft" toggle. If you manually change the girl's mood to HAPPY (via the in-game menu, or by loading a happy character) then she'll automatically un-clench her teeth. You can simply hit the toggle button again to re-clench. The toggle also doesn't prevent the girl from clenching her teeth if you subsequently piss her off. A custom dialogue line could also force her to clench her teeth, regardless of her emotional state.
 

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.