Jump to content
Ghost Recon.net Forums

Not a mod, but so much which can be done.


Recommended Posts

This is custom programming in WinBatch and AutoHotKey which can be done to enhance the game.

Things that are done.  The quick save functionality which only gives you a single save has been modified to give you time stamped multiple saves.  In other words, this code besides launching the game looks for quick saves and rapidly renames them while your are playing (they don't get overwritten).

I have highlighted the code that does this.

; 08/29/15 - Modified from CMBB to CMBN
; 09/10/15 - Modified to support recon photos
; 09/16/15 - Restart "Windows7 Remap Keys.exe
; 10/22/15 - Improved suffix handling
; 12/09/15 - Reset preferences prior to game load
; 03/05/16 - Changed shutdown of AHK (to resolve keys being forgotten)
; 03/06/16 - Another try at fixing hotkey problem (was the screen shot code)
; 04/04/16 - Modified from CMBN for Anno
; 04/10/16 - Modified from Anno for GR (handle multiple mod save directories)
; 04/10/16 - Added rapid scroll for weapons
; 04/11/16 - 20 min NVidia capture (add exact window name match)
; 04/24/16 - Added screenshot movement and time stamps.

        WhoAmI="GR Mgr"
        If WinExist(WhoAmI)Then Exit
        WinTitle(WinName(), WhoAmI)
        WinHide(WhoAmI)

; ----- Definitions ------

        Interval=1
        GameEXE="E:\Games\GhostRecon\GhostRecon.exe"
        GamePath="E:\Games\GhostRecon\"
        GameName="Ghost Recon~"
        GameSavePaths=""
        GameSavePaths=StrCat(GameSavePaths, "E:\Games\GhostRecon\Data\Save\game\", @TAB)
        GameSavePaths=StrCat(GameSavePaths, "E:\Games\GhostRecon\Mods\Origmiss\Save\Game\", @TAB)
        GameSavePaths=StrCat(GameSavePaths, "E:\Games\GhostRecon\Mods\Mp1\save\game\", @TAB)
        GameSavePaths=StrCat(GameSavePaths, "E:\Games\GhostRecon\Mods\Mp2\save\game\", @TAB)
        GameSavePaths=StrCat(GameSavePaths, "E:\Games\GhostRecon\Mods\Heroes Unleashed\save\game\")
        GameSaveQuick="quick_save.sav"

        SystemTrayRestart="C:\Program Files\SystemTrayRefresh\SystemTrayRefresh.exe"
        ;IntControl(72, 1, @False, 0, 0)
        HotKeyEXE="C:\Program Files\AutoHotkey\AutoHotkey.exe"
        HotKeyScript="GRkeys.ahk"
        HotKeyScriptPath="D:\User\MK\Software\Games\GR\Utility\"

        
; ----- Start it and wait -----

        Run("C:\Program Files (x86)\NVIDIA Corporation\NVIDIA GeForce Experience\LaunchGFExperience.exe"," -shadowplay")
        WinWaitExist("NVIDIA GeForce Experience - ShadowPlay", -1)
        Delay(1)
        WinActivate("NVIDIA GeForce Experience - ShadowPlay")
        Delay(1)
        MouseMove(34, 120, "NVIDIA GeForce Experience - ShadowPlay", "")
        MouseClick(@LClick, 0)
        Delay(1)
        WinClose("NVIDIA GeForce Experience - ShadowPlay")

        DirChange(GamePath)
 
        Run(GameEXE,"")
        RunShell(HotKeyEXE, HotKeyScript, HotKeyScriptPath, @Normal, @NOWAIT)
 
        WinWaitExist(GameName, -1)
        Delay(10)
 
        While WinExist(GameName)
 
          DirCount=ItemCount(GameSavePaths, @TAB)
          For DirIndex = 1 to DirCount
            GameSavePath=ItemExtract(DirIndex, GameSavePaths, @Tab)

            CurrentDir=DirGet()
            DirChange(GameSavePath)
            ShotFileName=FileItemize(GameSaveQuick)
            If ShotFileName<>"" Then
              Delay(2)
              Base=TimeYmdHms()
              NewBase1=StrSub(Base, 3, 17)
              NewBase2=StrReplace(NewBase1, ":", "_")
              NewBase3=StrCat(NewBase2, ".sav")
              FileRename(ShotFileName, NewBase3)
              Beep()
            End IF
            DirChange(CurrentDir)
          Next

 
          ErrorMode(@OFF)
          FileMove ("E:\Games\GhostRecon\ScreenShot0.bmp", "E:\Games\GhostRecon\ScreensGR\", @TRUE)
          ErrorMode(@ON)
          
          CurrentDir=DirGet()
          DirChange("E:\Games\GhostRecon\ScreensGR")
          ShotFileName=FileItemize("ScreenShot0.bmp")
          If ShotFileName<>"" Then
            Delay(1)
            Base=TimeYmdHms()
            NewBase1=StrSub(Base, 3, 17)
            NewBase2=StrReplace(NewBase1, ":", "_")
            NewBase3=StrCat(NewBase2, ".bmp")
            FileRename(ShotFileName, NewBase3)
            Beep()
            Delay(1)
            Beep()
          End IF
          DirChange(CurrentDir)
 
          TimeDelay(Interval)
 
        End While

        Run("C:\Program Files (x86)\NVIDIA Corporation\NVIDIA GeForce Experience\LaunchGFExperience.exe"," -shadowplay")
        WinWaitExist("NVIDIA GeForce Experience - ShadowPlay", -1)
        Delay(1)
        WinActivate("NVIDIA GeForce Experience - ShadowPlay")
        Delay(1)
        MouseMove(34, 120, "NVIDIA GeForce Experience - ShadowPlay", "")
        MouseClick(@LClick, 0)
        Delay(1)
        WinClose("NVIDIA GeForce Experience - ShadowPlay")
        Delay(1)
        Run("C:\Program Scripts\Windows7 Remap Keys.exe","")

Edited by MarkShot
Link to post
Share on other sites

The above has no impact on the game as it even runs on a different processor than the game.

The code below does something really cute.  Heroes Unleashed seems to offer hundreds of kits.  It is a painful number of mouse click to select a kit.  However, what is done below is that the RIGHT ARROW key has been made to repeat left mouse clicks; a click roughly every 1/10 second.  Thus, position the mouse and press the right arrow.  The choices speed by with just enough delay to find what you are looking for (you can fine tune after with the mouse).  Kit selection takes well under half a minute.

; Rapid weapon scroll for Ghost Recon mission setup
;
; 04/10/16 (revised 04/10/16)

#NoTrayIcon
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

SetTitleMatchMode 3
SetKeyDelay, 100, -1,

#SingleInstance force
#Persistent
Sleep, 5000
SetTimer, ScriptDone, 100
Return

ScriptDone:
IfWinNotExist,Ghost Recon,
  ExitApp
Return

#IfWinActive,Ghost Recon,

; Right
  Right::
  {
    MouseClick, Left, , , 1, 1, D,
    Sleep 75
    MouseClick, Left, , , 1, 1, U,
    Return
  }

Edited by MarkShot
  • Like 2
Link to post
Share on other sites

Scrolling through the kits in the platoon setup screen. From what I understand this is programming the right arrow key to replace all the clicks to make a kit selection. I'm a complete noob when it comes to programming or assigning macros to the KB so any explanation you give may fly over my head. :-)

Link to post
Share on other sites

The above has no impact on the game as it even runs on a different processor than the game.

The code below does something really cute.  Heroes Unleashed seems to offer hundreds of kits.  It is a painful number of mouse click to select a kit.  However, what is done below is that the RIGHT ARROW key has been made to repeat left mouse clicks; a click roughly every 1/10 second.  Thus, position the mouse and press the right arrow.  The choices speed by with just enough delay to find what you are looking for (you can fine tune after with the mouse).  Kit selection takes well under half a minute.

Sounds cool, but would it be possible to use the mouse scroll wheel instead of the right arrow key ? 

Link to post
Share on other sites

There are hundreds of  kits.  So, you really need something which pulses clicks very rapidly.  Also, you don't want to define anything which already has been used in the game.  The scroll wheel is already use for binoculars and gun sights.

I could have used both the left and right arrow key and not required positioning the mouse pointer.  How?  You send the mouse pointer to the exact coordinates prior to the click.  It takes a little more work on capture the right coordinates, code, and test.  However, it is dependent on the particular screen resolution in use.

I have bundled it as a mod and given it to Rocky.  If he likes it, he will make it available.  However, it is not really a mod, but more correctly a stand alone utility to run alongside GR.

  • Like 2
Link to post
Share on other sites

Yeh thanks, I will post it up later this week, as you know I failed at my first attempt to try it out lol.

I'll add it to downloads and give it some coverage on the news page on Thursday, nice bit of coding!!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...