Thread: Incoming User Function Changes

Page 3 of 3 FirstFirst 123
Results 41 to 59 of 59
  1. Collapse Details
    Re: Incoming User Function Changes 
    #41
    Junior Member
    MainSecondary
    Join Date
    Jan 2017
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site
    Thanks so much brolly. You are correct, I was quite confused. I really appreciate it.
     

  2. Collapse Details
    Re: Incoming User Function Changes 
    #42
    RocketLauncher Developer

    MainSecondary
    Join Date
    Apr 2014
    Posts
    4,792
    Edited my previous post, you didn't change the class name so that would never work like that.
     

  3. Collapse Details
    Re: Incoming User Function Changes 
    #43
    Junior Member
    MainSecondary
    Join Date
    Jan 2017
    Posts
    8
    Hey Again,

    I'm still getting an error on game launch from Hyperspin with the below MAME.ahk.

    Here's the code again:
    Code:
    class SystemUserFunction extends UserFunction {
    
    ; Use this function to define any code you want to run in every module on start
    StartUserFeatures() {
    Global RLLog, romName, emupath, ListXMLInfo
    
    RLLog.Info(A_ThisFunc . " - Starting")
    
    ListMameTable := []
    ListMameTable := ListXMLInfo%zz%(romName)
    RotationAngle := ListMameTable[2]
    
    If (romName == "punchout")
    {
    RLLog.Info("RotateFunctions - Override Punchout")
    Run, %emupath%\maestro -p, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Portrait")
    }
    Else If (RotationAngle != "0")
    {
    Run, %emupath%\maestro -p, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Portrait")
    } Else {
    Run, %emupath%\maestro -l, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Landscape")
    }
    RLLog.Info(A_ThisFunc . " - Ending")
    }
    
    ; Use this function to define any code you may need to stop or clean up in every module on exit
    StopUserFeatures() {
    Global RLLog, emupath
    RLLog.Info(A_ThisFunc . " - Starting")
    
    Run, %emupath%\maestro -l, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Landscape")
    }
    RLLog.Info(A_ThisFunc . " - Ending")
    }
    Here's the error:
    MAME_ahk_error.png

    Any idea why I might be getting this? Thanks
    Last edited by reddye5 ; 11-16-2017 at 12:49 AM.
     

  4. Collapse Details
    Re: Incoming User Function Changes 
    #44
    Super Moderator
    agent47's Avatar
    MainSecondary
    Join Date
    Jan 2016
    Posts
    1,259
    The line the error message mentions is outside of the StopUserFeatures function so it needs to be moved. This should work:

    Code:
    class SystemUserFunction extends UserFunction {
    
    	; Use this function to define any code you want to run in every module on start
    	StartUserFeatures() {
    		Global RLLog, romName, emupath, ListXMLInfo
    
    		RLLog.Info(A_ThisFunc . " - Starting")
    
    		ListMameTable := []
    		ListMameTable := ListXMLInfo%zz%(romName)
    		RotationAngle := ListMameTable[2]
    
    		If (romName == "punchout")
    		{
    			RLLog.Info("RotateFunctions - Override Punchout")
    			Run, %emupath%\maestro -p, %emupath%\, hide
    			RLLog.Info("RotateFunctions - Rotating Portrait")
    		}
    		Else If (RotationAngle != "0")
    		{
    			Run, %emupath%\maestro -p, %emupath%\, hide
    			RLLog.Info("RotateFunctions - Rotating Portrait")
    		} 
    		Else {
    			Run, %emupath%\maestro -l, %emupath%\, hide
    			RLLog.Info("RotateFunctions - Rotating Landscape")
    		}
    		RLLog.Info(A_ThisFunc . " - Ending")
    	}
    
    	; Use this function to define any code you may need to stop or clean up in every module on exit
    	StopUserFeatures() {
    		Global RLLog, emupath
    		RLLog.Info(A_ThisFunc . " - Starting")
    
    		Run, %emupath%\maestro -l, %emupath%\, hide
    		RLLog.Info("RotateFunctions - Rotating Landscape")
    		RLLog.Info(A_ThisFunc . " - Ending")
    	}
    }
     

  5. Collapse Details
    Re: Incoming User Function Changes 
    #45
    Junior Member
    MainSecondary
    Join Date
    Jan 2017
    Posts
    8
    Thank you agent47. I appreciate it.
     

  6. Collapse Details
    Re: Incoming User Function Changes 
    #46
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    I have some games that need alt+enter after launching to become full screen in PC Games, and some that will need a simple Space key to be launched, can someone tell me where to add these commands or paste the commands so I can try them here?
     

  7. Collapse Details
    Re: Incoming User Function Changes 
    #47
    Senior Member Ninja2bseen's Avatar
    MainSecondary
    Join Date
    Jun 2014
    Posts
    867
    This would be a nice feature to press alt enter per game basis especially pc games
     

  8. Collapse Details
    Re: Incoming User Function Changes 
    #48
    Super Moderator
    agent47's Avatar
    MainSecondary
    Join Date
    Jan 2016
    Posts
    1,259
    Create an ahk script located at RocketLauncher/Lib/User Functions/%SystemName%/%GameName%, paste the following in that file, and set Fullscreen to true on the Misc tab in the PCLauncher module for that game.

    Code:
    class GameUserFunction extends GameFunction {
    
    	SetFullscreenPostLaunch(fs) {
    		RLLog.Info(A_ThisFunc . " - Starting")
    		;Sleep, 1000
    		Send, !{Enter}
    		RLLog.Info(A_ThisFunc . " - Ending")
    	}
    }
    You may have to uncomment and play with the Sleep value if it isn't working for whatever reason to ensure it's not getting sent too early. To send a space instead replace !{Enter} with {Space}.
     

  9. Collapse Details
    Re: Incoming User Function Changes 
    #49
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    I believe I put the ahk files in their correct paths, tried both games, one needs alt+enter, the other needs space to start, but none received the commands, I also increased the sleep value to make sure they weren`t sent too early, but it didn`t work, does it have something to do with the autohotkey version I have installed?

    AHK version 1.1.21.02

    The path I tried is \RocketLauncher\Lib\User Functions\PC Games\Game Folder\Game AHK file\

    I also tried \RocketLauncher\Lib\User Functions\PC Games\Game AHK file\
    Last edited by aorin1 ; 11-26-2017 at 05:30 PM.
     

  10. Collapse Details
    Re: Incoming User Function Changes 
    #50
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    Anyone?
     

  11. Collapse Details
    Re: Incoming User Function Changes 
    #51
    RocketLauncher Developer

    MainSecondary
    Join Date
    Apr 2014
    Posts
    4,792
    agent's solution should work, you'll need to check the log to make sure the function is being called.
    Could also be that the game only reacts to real keyboard events in that case there's nothing it can be done as simulated keypresses won't work.
     

  12. Collapse Details
    Re: Incoming User Function Changes 
    #52
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    Here's the troubleshooting log:

    https://pastebin.com/7RdupQNC

    Thanks for checking
     

  13. Collapse Details
    Re: Incoming User Function Changes 
    #53
    RocketLauncher Developer

    MainSecondary
    Join Date
    Apr 2014
    Posts
    4,792
    Well, the function is being called:
    21:44:13:506 | MD | INFO | +47 | GameUserFunction.SetFullscreenPostLaunch - Starting

    You can try doing something like instead of the !{Enter}:
    KeyUtils.Send("{Alt Down}{Enter}{Alt Up}")
     

  14. Collapse Details
    Re: Incoming User Function Changes 
    #54
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    I tried with the new instructions but the game keeps Windowed no matter what, I'm removing it from the database, it will only accept true keyboard alt+enter to go full screen.

    Thanks for checking again!
     

  15. Collapse Details
    Re: Incoming User Function Changes 
    #55
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    I've managed to make Myst V - End of Ages boot without any further intervention, since it dumbly asks which language every time you start the game.
    The simple command "Send {space}" did the trick.
    Sonic Before the Sequel and Sonic After the Sequel only need alt+enter to become full screen but it won't accept the commands I tried earlier, I'll probably stick to a simple Xpadder profile and assign a button in the gamepad to do that for me.
    Now, Assassin's Creed - Revelations need space in order to enter the game, and when I close the game, that uplay launcher is still there waiting for me to close it, an alt+F4 should do the trick, but it didn't accept the simple "Send {space}" command to only start the game so I stopped there.

    Can someone help me figuring that out? Some games will only accept the physical keyboard, yet somehow I don't believe that it cannot be sorted out.
     

  16. Collapse Details
    Re: Incoming User Function Changes 
    #56
    Super Moderator
    agent47's Avatar
    MainSecondary
    Join Date
    Jan 2016
    Posts
    1,259
    Quote Originally Posted by aorin1 View Post
    Some games will only accept the physical keyboard, yet somehow I don't believe that it cannot be sorted out.
    Well, believe it. If it only accepts physical keyboard inputs then you obviously can't use simulated ones via AHK. I don't own AC: Revelations (on PC) so I can't verify if it's one of those games or not.

    Regarding the UPlay launcher, are you referring to the game launcher or the UPlay client?
     

  17. Collapse Details
    Re: Incoming User Function Changes 
    #57
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    It launches this Uplay screen when I open any AC Revelations exe from the game's install folder:
    https://ibb.co/mGWgM7

    It works with Enter and needs to be closed after I exit the game, from all my AC collection in the frontend, this is the only version I couldn't get to launch directly without any third party launcher.
     

  18. Collapse Details
    Re: Incoming User Function Changes 
    #58
    Senior Member aorin1's Avatar
    MainSecondary
    Join Date
    Apr 2015
    Posts
    223
    Hey guys, mainly Agent, thanks again for the help, I was having a hard time believing these commands weren't working.
    It was nothing less than administrative privilege to the Autohotkey.exe, since it's installed in C:\program files, it needed this permission in order to make the commands work, now all games that has a launcher and needs input to start are working automatically.
    I went ahead and made 3 scripts that will launch each of the Shadow Warrior (1998 game) and expansions with auto cursor move and click, there's no other way (via command line or anything) this game will launch, no parameters, no keys, only clicks.
     

  19. Collapse Details
    Re: Incoming User Function Changes 
    #59
    Senior Member
    MainSecondary
    Join Date
    Aug 2016
    Posts
    132
    Hi, i need help with the cursor restrict movement code lines. I tried different things and did not make it work. What should i put in my global.ahk file?
     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •