How to utilise Chat-Logging without the Client Extention
Jan 20, 2017 20:48:17 GMT -5
Fuzz likes this
Post by Kitsunenotsume on Jan 20, 2017 20:48:17 GMT -5
It occurred to me this morning during a discussion that a significant portion of the population may not have chat-logging, either due to not using the Client-Extender or other such reasons.
My presented solution is pretty simple and sustainable, having used it myself for three and a half years until I learned about and got the Client Extender working.
Step 1: Configure the chat-log setting.
Set following flag in the nwn2player.ini in your NWN2 directory in My Documents:
This will result in starting NWN2 to overwrite the current file in
C:\Users\%username%\AppData\Local\Temp\NWN2\LOGS\nwclientlog1.txt
with the console output of the program, which happens to include all the chat-logs we want, plus a bunch of other stuff (more later).
Step 2: Install the Log Cycling Script.
Attached to this post is the file nwn2.vbs, which should contain the following (copypasta if you want). Stick the file in your main NWN2 directory, wherever that may be (mine is in the listed path, yours might be in steam or wherevs), and make sure that the NWN_PATH constant is set to the same location (mind that the quotation marks stay).
The second variable, NWN_PATH_TWO is your own home directory, which is going to need to be altered to a portion of wherever your chatlog in the previous step gets saved to. In most cases, replace %username% with your own user-name, and it should work. If not, PM me and I can help resolve the issue.
Once the script is in place and properly adjusted to your system, you can start NWN2 by running the script. This will then grab whatever the log is and store it in your logs folder by creation date.
Note that it only moves when NWN2 is started, so if you need to access your most recent log you can either run the script again, or head to the file-location described in step 1.
Step 3: Load File-Trimmer
This part is entirely optional, but after a year of using the chat-logger, I realized that there was a good 60-200 KB of server loading dross for every login, which really did NOT help expedite the process of actually reading the logs. So I made my File Fragment Fabricator, which takes most of that programmatic white-noise and removes it, leaving just the actual text you want to read. It should be relatively intuitive, just download the jar and run it*, following the prompt in the popup window. The program will parse ALL the text documents in the origin folder, strip the non-chat text out, put in a bit of space (so you can tell when you switched chars or DCed or W/E), and then place the new file into the destination directory. As a result, do not have the origin and the destination be the same folder, or it will run until it gets a memory fault. I should probably fix that, but it's also easier to know your parsed files are in another location.
References:
I initially located the steps to do this from This Website: talesofmoonsea.com/forums/index.php?topic=5360.0
It's a bit out-dated, since there have been at least three newer versions of Windows since that post was made, so if you need help adapting to your system, just ask.
*: Being a java virtual machine, there is a very stringent set of limitations on what a .jar can do, none of which are actually mucking with your system in case anyone is concerned about running a downloaded file. A Visual Basic Script totally can muck with your system since it runs off command-line level permissions, hence why I am posting the code.
My presented solution is pretty simple and sustainable, having used it myself for three and a half years until I learned about and got the Client Extender working.
Step 1: Configure the chat-log setting.
Set following flag in the nwn2player.ini in your NWN2 directory in My Documents:
[Game Options]
ClientChatLogging=1
This will result in starting NWN2 to overwrite the current file in
C:\Users\%username%\AppData\Local\Temp\NWN2\LOGS\nwclientlog1.txt
with the console output of the program, which happens to include all the chat-logs we want, plus a bunch of other stuff (more later).
Step 2: Install the Log Cycling Script.
Attached to this post is the file nwn2.vbs, which should contain the following (copypasta if you want). Stick the file in your main NWN2 directory, wherever that may be (mine is in the listed path, yours might be in steam or wherevs), and make sure that the NWN_PATH constant is set to the same location (mind that the quotation marks stay).
The second variable, NWN_PATH_TWO is your own home directory, which is going to need to be altered to a portion of wherever your chatlog in the previous step gets saved to. In most cases, replace %username% with your own user-name, and it should work. If not, PM me and I can help resolve the issue.
Once the script is in place and properly adjusted to your system, you can start NWN2 by running the script. This will then grab whatever the log is and store it in your logs folder by creation date.
Note that it only moves when NWN2 is started, so if you need to access your most recent log you can either run the script again, or head to the file-location described in step 1.
'nwn2.vbs
'Folder where NWN is installed
CONST NWN_PATH = "C:\Program Files (x86)\Atari\Neverwinter Nights 2"
'User home directory ##Change This##
CONST NWN_PATH_TWO = "C:\Users\%username%"
'Blah :-)
Dim fso: set fso = createobject("Scripting.FileSystemObject")
Dim sTargetFile, partOne, partTwo, datCreated, datLastModified
'If a log file exists
If fso.FileExists(NWN_PATH_TWO & "\AppData\Local\Temp\NWN2\LOGS\nwclientlog1.txt") Then
'And if it's bigger then 0
if fso.GetFile(NWN_PATH_TWO & "\AppData\Local\Temp\NWN2\LOGS\nwclientlog1.txt").Size > 0 Then
'Make a nice filename based on date for the file
datCreated = fso.GetFile(NWN_PATH_TWO & "\AppData\Local\Temp\NWN2\LOGS\nwclientlog1.txt").DateCreated
datLastModified = fso.GetFile(NWN_PATH_TWO & "\AppData\Local\Temp\NWN2\LOGS\nwclientlog1.txt").DateLastModified
partOne = Year(datCreated) & "_" & Right("00" & Month(datCreated),2) & "_" & Right("00" & Day(datCreated),2) & "_" & Right("00" & Hour(datCreated),2) & Right("00" & Minute(datCreated),2)
partTwo = Year(datLastModified) & "_" & Right("00" & Month(datLastModified),2) & "_" & Right("00" & Day(datLastModified),2) & "_" & Right("00" & Hour(datLastModified),2) & Right("00" & Minute(datLastModified),2)
sTargetFile = partOne & "_to_" & partTwo & ".log"
'Rename the log file
fso.MoveFile NWN_PATH_TWO & "\AppData\Local\Temp\NWN2\LOGS\nwclientlog1.txt", NWN_PATH_TWO & "\Documents\NWN2Chatlogs\" & sTargetFile
End If
End If
'Start NWN
Dim WshShell
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """" & NWN_PATH & "\NWN2Launcher.exe""" <span style="font-family: Verdana, Arial; font-size: 10pt;"> </span>
Step 3: Load File-Trimmer
This part is entirely optional, but after a year of using the chat-logger, I realized that there was a good 60-200 KB of server loading dross for every login, which really did NOT help expedite the process of actually reading the logs. So I made my File Fragment Fabricator, which takes most of that programmatic white-noise and removes it, leaving just the actual text you want to read. It should be relatively intuitive, just download the jar and run it*, following the prompt in the popup window. The program will parse ALL the text documents in the origin folder, strip the non-chat text out, put in a bit of space (so you can tell when you switched chars or DCed or W/E), and then place the new file into the destination directory. As a result, do not have the origin and the destination be the same folder, or it will run until it gets a memory fault. I should probably fix that, but it's also easier to know your parsed files are in another location.
References:
I initially located the steps to do this from This Website: talesofmoonsea.com/forums/index.php?topic=5360.0
It's a bit out-dated, since there have been at least three newer versions of Windows since that post was made, so if you need help adapting to your system, just ask.
*: Being a java virtual machine, there is a very stringent set of limitations on what a .jar can do, none of which are actually mucking with your system in case anyone is concerned about running a downloaded file. A Visual Basic Script totally can muck with your system since it runs off command-line level permissions, hence why I am posting the code.