All-Aircraft-Simulations
Possible to have guncam written to ntrk file for replay? - Printable Version

+- All-Aircraft-Simulations (https://allaircraftsimulations.com)
+-- Forum: IL2 MODS Download & Discussion (https://allaircraftsimulations.com/forumdisplay.php?fid=267)
+--- Forum: IL-2 4.09m (https://allaircraftsimulations.com/forumdisplay.php?fid=348)
+---- Forum: IL2 MODS Discussion Section 4.09m (https://allaircraftsimulations.com/forumdisplay.php?fid=292)
+---- Thread: Possible to have guncam written to ntrk file for replay? (/showthread.php?tid=54798)

Pages: 1 2


- Mysticpuma - 19.06.2008

Hi Zephyr, thanks for the reply. What I have found in the past, is the first time I hit the 'record ntrk' button, I get about a 1 second lag. However everytime after that I get no problems?

Maybe just me, but I think if the ntrk is started before combat, it shouldn't be a problem?

Maybe?

cheers, MP.


- gflinchbaugh - 19.06.2008

excuse me for jumping in here, but just wanted to interject my understanding of the way IL2 Implements tracks and recording. From what I understand, a track is recorded sequentialy so there can be a start and a stop, but no start up again, unless a entirely new track is started (i.e. new file name). I guess this could be moded to some extent, I have been happily proved wrong before with the mods for this game. But if you are looking for a single track with only 'gun camera' footage, I do think the sim isn't designed to handle this.

Greg


- JudgeMingus - 19.06.2008

Hi again, all!


Well, I found the time, even though I had to change my fundamental approach twice to get the behaviour of the code right:

Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;                    ;;;;;;;;
;;;;;;;; GUNCAMERA (NTRK recording Script)    ;;;;;;;;
;;;;;;;;                     ;;;;;;;;
;;;;;;;;     Tom "JudgeMingus" Martin, 2008    ;;;;;;;;
;;;;;;;;     Free for non-commercial use :D    ;;;;;;;;
;;;;;;;;                     ;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Version 0.1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;    VARIABLE DECLARATION    ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

GunCam = 0
GunCamRecordingTime = 20000 ;20 seconds
NTRK_key = R    ;the key assigned to "stop/start recording" NTRKs

return

;;;;;;;;;;;;;;;;;;;
;;;   HOTKEYS   ;;;
;;;;;;;;;;;;;;;;;;;

; For the first trigger I have used Joystick 1, button 2 as an example
; replace with your joystick trigger button (look it up in control panel\game ontrollers)
; eg, Joystick 3, button 12 would become  ~3Joy12::
~1Joy2::  
    if GunCam=0
    {
        GunCam=1
        Send {%NTRK_key%}
    }
    ; set a timer to run once after delay
    SetTimer, CameraCutOff, -%GunCamRecordingTime%
    Return

; you probably want it triggered by both MG and Cannon, so here is a second 'trigger' button
; replace the button ID with your own...
~1Joy1::
    if GunCam=0
    {
        GunCam=1
        Send {%NTRK_key%}
    }
    SetTimer, CameraCutOff, -%GunCamRecordingTime%
    Return

;;;;;;;;;;;;;;;;;;;
;;;  FUNCTIONS  ;;;
;;;;;;;;;;;;;;;;;;;

CameraCutOff:
    GunCam=0
    Send {%NTRK_key%}
    Return

How to use this script:
1. Download AutoHotkey from http://www.autohotkey.com and install it.
2. Copy and paste the code into notepad and save (plain text).
3. Make sure that you insert your own Joystick trigger/button IDs and the key assigned to "stop/start recording" in the appropriate locations (read the comments within the script. Comments begin with a semicolon ";" ). You may also, if you wish, change the default 20 second recording/overlap time to whatever you like.
4. Rename the file to something like NTRK-Guncam.AHK and make sure the .txt extension is gone. The file should change appearance to have a large "H" on the icon to show that it is a script associated with AutoHotKey.
5. Run the AHK script (it will pop up in the system tray, where you can right click to exit it)

You may do whatever you like with this script, but please don't sell it...


Please note, there are some IMPORTANT caveats:
- Each burst of fire more than 20 seconds apart will create a new, separate track. This is inherent in the IL-2 NTRK system, and would require serious coding within the game engine to alter.
- If you are already recording a track, this script will STOP THE RECORDING when you fire, and start a new track 20 seconds after you stop (I may address this in a future revision).
- This records a track in the normal manner - from the point of view you were using when recording. If you want to see a different view, you need to enable manual view control before replaying the track, and pause the track as soon as it starts so that you have time to choose your point of view.
- Finally, I have tested this and it seems to work pretty much flawlessly (within the above limitations). I cannot, however, guarantee that it will work fine on any other computer, or that it won't eat your hard drives and release the 'magic smoke' from your CPU. Tongue


- danger - 20.06.2008

try this, i have it and it works just fine , press trigger on j/stick and it records. just like a guncamera
you can also adjust the length of time it records

http://www.growlersoftware.com/


- JudgeMingus - 22.06.2008

Doesn't that do a direct capture from the graphics framebuffer?

I think what was requested was a way of getting a track, so that point of view etc can be changed for replay - this is why I wrote a script rather than recommending FRAPS or another capture tool.


- JudgeMingus - 22.06.2008

Actually, re-reading the thread I have realised that what is really requested is a "marker" point within the NTRK to note guns use, and a way to skip to that point in playback.

That is unfortunately beyond me at my current level of knowledge of the game NTRK recording engine (none).
Nonetheless, I hope that my script will be of some use to someone.