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

Cough hotkey

Discussion in 'Filled Requests' started by Oktoberfest, Apr 21, 2014.

  1. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Hi there, i'd like to request a mod that lets you make her cough after pressing a key. I've been looking for a mod that increases the amount of coughs, the only mod that i found doesn't seem to work, at least for me (ModGuy's "Adjust rate of coughing"), maybe it's outdated.
     
  2. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,410
    Likes Received:
    139
    this might work if you throw it into the alternate compiler:

    Code:
    package flash
    {
    	public dynamic class Main extends flash.display.MovieClip
    	{
    		public function initl(l)
    		{
    			l.registerFunction(l.her.cough, 114);
    			l.unloadMod();
    		}
    	}
    }
    of course, this would be a loader mod, if it compiles xD

    edit - if somebody wants to throw a comment in there and release it, feel free. it is way too small for me to bother with it.


    ~could have sworn i had a cough button in one of my mods at one point in time that wasn't just sound effects, probably something i threw away xD

    triple edit - modguy be fixing my posts and making the code readable. . i suppose it is okay since i did forget the unload function. although i think it would have worked but given an invalid error message
     
  3. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Thanks Sby! I'll try to compile it myself, i'll let you know if it worked.

    EDIT: It works! Is there a way to make her cough with a regular cough (not in throat)?
     
  4. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Ummmm, i tried to play around and replaced "l.registerFunction(l.her.cough, 114);" with "l.registerFunction(l.her.openCough, 114);"
    The animation works, but there's no sound... sadface, i'm bad at this. Any ideas on how to fix it?
     
  5. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,410
    Likes Received:
    139
    you can try using g.soundControl.playOpenCough as a function to call instead.
    looked at the code and seemed like a potential candidate.

    if you didn't already figure it out, the '114' is the key to be pressed.
     
  6. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Thanks again! Where do you find all that stuff, like "l.her.cough"? I've looked in the decompiled files of SDT and i haven't found anything like that, only variables and things like that.

    EDIT: Errrr, i have no idea where to place "g.soundControl.playOpenCough" in the code, do i have to change something else?

    I tried like this and the animation worked, but not the sound:
    Code:
    package flash
    {
     public dynamic class Main extends flash.display.MovieClip
     {
      public function initl(l)
      {
       l.registerFunction(l.her.openCough, 70);
       l.registerFunction(g.soundControl.playOpenCough, 70);
       l.unloadMod();
      }
     }
    }
    I figured having both the sound and animation would be nice when i hit the F key.
     
  7. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,410
    Likes Received:
    139
    it would be
    l.registerFunction(l.g.soundControl.playOpenCough, 70);


    here is a nice picture it threw together:
    https://app.box.com/s/pr4vo14q7s5l3u30wf63
    (should note the soundControl file was under the 'obj' folder)

    decompiled actionscript files link, but guessing you might already have those:
    https://app.box.com/s/6ewwjuozjym6fdnp4y3c
     
  8. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Mmmmm nice, i'm getting somewhere now. I found a lot of interesting stuff, although, i can't figure out how to use it, especially codes that begin with "this.", it doesn't look like i can use that in any way. And btw, "borrowing" your codes and you explaining me how some things work taught me more than your tutorrial, no offense :-X
     
  9. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,410
    Likes Received:
    139
    eh, it is alright. those are off-the-cuff videos and these are tailored replies.


    for all of the things that have 'this', that pertains the the instance of whatever class the file is.

    so if in the 'her.as' file you see 'this.hiltDistance', you can access that by 'her.hiltDistance', because the 'this' is refferring to itself, which is a specific object instance of the 'her' class. the full path to getting to that from the loader object would be 'l.g.her.hiltDistance'

    also, the loader object also has a direct reference to the 'her' object, so you can use 'l.her.hiltDistance'
     
  10. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Soooooooo. I've been playing around, A LOT, but i don't feel like i've made any progress, i tried to bind the tap animation to a key, but errrrr... it didn't worked. Is there a thread where i can ask questions about coding? (Btw, i have no coding or scripting background, so it might be painful to explain stuff to me)
     
  11. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,410
    Likes Received:
    139
    hmm, i don't remember any specific thread for coding questions, one might exist somewhere.

    if there was one, not sure how well off it would be. it could get messy having conversations about different problems in the same thread. i would suggest just stemming off of this thread where people can already see past related stuff mentioned.



    edit -
    also, here you go, i threw something together:
    coughhotkeyV1: https://app.box.com/s/yecbxa8ka8fqsip0xni1

    source looks like:
    Code:
    package flash
    {
    	import flash.media.SoundTransform;
    	import flash.events.Event;
    	public dynamic class Main extends flash.display.MovieClip
    	{
    		public function initl(l)
    		{
    			l.registerFunction( function() {  	//this register function call looks like shit because i inserted the function to use into the call
    				if(l.her.mouthFull)				//means she is on dat cock
    				{
    					//instant in-throat cough
    					l.her.openCough();
    					l.g.soundControl.playCough();
    					l.g.dialogueControl.cough();
    
    				}
    				else
    				{
    					//instant cough:
    					l.g.soundControl.stopBreathing(true);
    					l.g.soundControl.playOpenCough();
    					l.g.soundControl.openCoughing = true;
    					l.g.soundControl.breathing = true;
    					//l.g.soundControl.startBreathing(false); //decided to do it differently, left commented 
    					
    					//queue a cough for after next breath:
    					//l.g.soundControl.queueOpenCough();	
    				}	
    			} , 70);   		//map cough key to 'f' (key 70) , i guess
    			l.unloadMod();	//tell the loader we are done so it doesn't error
    		}
    		
    	}
    }

    another edit - if people are interested, i can put together a video showing the process of how i came about this code. it would essentially be a part 2 of my code modding tutorial showing the concepts mentioned previously being applied.

    yet another edit - who am i kidding, i don't wait for people to actually give their input on the matter. put together yet another tutorial video of essentially making this mod: https://www.mediafire.com/?0s5dbb0mx13qq5x
     
  12. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Right...i watched your video, it helped, kinda, but i think i'll just give up on coding, i don't have the motivation :( . I'll leave that to you. If i may ask, what are you working on next?
     
  13. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,410
    Likes Received:
    139
    lol, i don't really make plans, just kinda do stuff when i feel like it xD
     
  14. Oktoberfest

    Oktoberfest Avid Affiliate

    Joined:
    Mar 6, 2014
    Messages:
    34
    Likes Received:
    2
    Alright, turns out i didn't give up yet! So, i'm trying to bind more actions to keys, so far i get why and how "CoughHotkey" works, BUT, there's one thing that i still don't fully get, the first lines in the code, ex:

    public dynamic class Main extends flash.display.MovieClip and so on.

    If i understand right, it tells what "things" the code's going to do, like animation, sound. I have no idea what to use and when.
    I'm still trying to get to work a hand tap hotkey, you know, that animation she makes when low on breath. I basicly replaced one line in the code that you gave me for the first CoughHotkey with "l.g.her.tapHands()" (Found it in her with the might of ctrl+F) and bound it to W. She taps when i load the mod, but after that nothing happens when i hit the W key, i tried to add some lines buuuuut, well, almost nothing changed, it made her tap twice instead of once. I'm probably not putting enough conditions (if and else) into my code.
    Last thing, could you post your source code for deepthroatreactionsV3, i feel like i could find some good stuff in there. I hope i'm not too annoying, eh?
     
  15. sby

    sby Club Regular Content Creator

    Joined:
    Sep 11, 2012
    Messages:
    1,410
    Likes Received:
    139
    try this:

    Code:
    package flash
    {
     public dynamic class Main extends flash.display.MovieClip
     {
      public function initl(l)
      {
       l.registerFunction(l.g.her.tapHands, 70);
       l.unloadMod();
      }
     }
    }
    the thing to note is that i am using the reference to the tapHands function by not putting the '( )' at the end.
    '( )' means you are calling the function, so putting those means you are trying to register a function to the return value of that function, not the function itself

    also, uploaded deepthroatactionsV3 that includes the source in a text file