Skyrim
0 of 0

File information

Last updated

Original upload

Created by

Athena

Uploaded by

athenadelaenor

Virus scan

Safe to use

About this mod

Single batch file that starts SKSE and prints real-time papyrus log info into a CMD window, accessible during game-play.

Requirements
Permissions and credits





About:

This batch file will start SKSE and print real-time papyrus log info into a CMD window, accessible during game-play.


Came up with this so I won't have to keep opening the papyrus log with notepad, and actually view the log changes as I am playing and installing other mods.

Requires papyrus logs enabled, SKSE, a third party executable called 'tail.exe' and a basic understanding of Skyrim files and directories, batch files, and Windows file system directories.



Warning:

In order for this to work, you will need a third party system32 file called 'tail.exe'. This file can be found at 
http://unxutils.sourceforge.net/ under Latest Updates, or at secondary location  https://www.raymond.cc/blog/download/did/3780/ if you have problems with the program authors page (which is first).

'unxutils' includes many other useful executables, but 'tail.exe' is all that is needed for this batch file.

As an additional option, third party log viewers in real-time can be used such as mTail at http://ophilipp.free.fr/op_tail.htm This batch file will not be of use in that case.



Usage:

This is free to use, modify and whatever. It is a batch file that can be modified, altered, and changed for other uses. The third party file that is linked does not apply, thus why they are linked. That program is free to use, but I have no say so on what you can or can not do with it.




Requirements:

This requires the following:

  • SKSE
  • 'tail.exe' a third party executable installed in 'windows/system32' folder
  • Papyrus logs enabled
  • A decent understanding of Skyrim game files structure and directories.
  • A basic understanding of batch files.
  • A basic understanding of the Windows OS system folders structure.


Installation:

Either download the batch file or copy the code below to create it yourself.

  • Place 'Papyrus Realtime log Viewer.bat' file in the root Skyrim directory, 'Steam\steamapps\common\Skyrim'

  • Place 'tail.exe' from unxutils into the 'c:/windows/system32' folder. (Or place in Skyrim root directory if using TESVSGM to launch the batch file.)


Note: If using this in a new Skyrim install, it may take till after the first same game for papyrus logs to kick in after papyrus logs are enabled.


Compatibility:

Fixed Issue:

If using 
TES V Savegame Manager (TESVSGM), the 'Change Play-Button Link" to start the batch file will start SKSE, but will not keep the cmd window open for the papyrus log. It gives an error failing to find 'tail.exe' To see this error appear, just add 'pause' to the last line in the batch file, then it will pause if any error and tell you what happened.

To avoid this if you like to launch the game through TESVSGM, place a copy of 'tail.exe' in the Skyrim root directory, and have TESVSGM start the batch file as the play button link, then it works as intended.

Otherwise, as a second option, you can designate a save game folder in TESVSGM, then start the batch file, Skyrim should still use the last save game folder you selected with TESVSGM. At least it does this for me.



Updates and Changes:

No major updates, or changes will be made. I may occasionally make small notes, ideas, options, or adjustments if I find a problem. This is mostly just to share a way to view papyrus logs during game-play. Feel free to modify and use as needed. I will not be able to help with any questions or problems. Thanks for understanding.




Batch File Contents and Options:

The most important line is:


tail -n 0 -f "%userprofile%\Documents\My Games\Skyrim\Logs\Script\Papyrus.0.log"

This is what will display the papyrus log as you play.

Below is the batch file code for 'Papyrus Realtime Log Viewer' for do it yourself batch file, or it can be downloaded in files section. The cls at end just clears the screen of anything but the papyrus log lines after it starts.


@echo off
start "SKSE" "skse_loader.exe" -priority realtime
tail -n 0 -f "%userprofile%\Documents\My Games\Skyrim\Logs\Script\Papyrus.0.log"
cls
pause

The pause command at end  will reveal any errors opening the log, and keep the console open. Useful if console is closing for some reason.


pause


The line that starts SKSE can be changed to the following that will leave the SKSE window open as a separate console.


start "SKSE" "skse_loader.exe" -priority realtime -waitforclose -v


Additionally, the '-priority realtime' can be left out. This just sets cpu priority of skse I believe.



Possibilities:

This could potentially be modified to have multiple log files from Skyrim being monitored at the same time in separate console windows simultaneously, which would require a few more lines in the batch file depending on how you wanted them to be displayed. This could even be used for other games theoretically, by changing the game start and log file parameters. I have only tested a few possibilities since the main purpose was for papyrus logs. Should however work with any log file that is plain text based only.

Below is a test example of three logs: Papyrus.0.log, skse.log. and skse_chargen.log.



The batch file had two additional lines added.


@echo off
start "SKSE" "skse_loader.exe" -priority realtime
REM add -waitforclose -v to end of above for a 4th log for skse_loader.log

start cmd.exe /k "tail -n 0 -f "%userprofile%\Documents\My Games\Skyrim\SKSE\skse.log""
start cmd.exe /k "tail -n 0 -f "%userprofile%\Documents\My Games\Skyrim\SKSE\skse_chargen.log""
tail -n 0 -f "%userprofile%\Documents\My Games\Skyrim\Logs\Script\Papyrus.0.log"
cls




Change log:

[ 9-11-2020 ] Found solution to bug when starting batch file through TESVSGM by placing a copy of 'tail.exe' in the Skyrim root directory.
[ 8-30-2020 ] Added 'pause' as last line to prevent console window from closing under rare circumstances.
[ 8-18-2020 ] Added sample code and screenshot of multiple logs running in separate consoles from same batch file.
[ 8-18-2020 ] Updated description page.
[ 8-17-2020 ] Updated description page.
[ 8-17-2020 ] Added video clip of cmd log running.
[ 8-16-2020 ] Updated description page with various edits.
[ 8-15-2020 ] Renamed mod page and file to 'Papyrus Realtime Log Viewer. Removed old original batch file with excess code. Those that           downloaded the original ones, it is still the same basically, does the same thing.