Page 2 of 2

Re: NWN:EE bat files

Posted: Tue Jun 05, 2018 8:33 am
by milkshake
*worked amazingly untill the update a fiew days ago; now gets "Could not translate error"*

Re: NWN:EE bat files

Posted: Tue Jun 05, 2018 6:19 pm
by triaddraykin
See previous post. Which version are you using? If you post yours (remove and personal information if you want) I can adapt it so that it just launches the main NWN file without using the currently-broken +connect feature, so that it still produces logs.

Re: NWN:EE bat files

Posted: Tue Jun 05, 2018 7:50 pm
by Dragonovith
triaddraykin wrote:
Tue Jun 05, 2018 6:19 pm
See previous post. Which version are you using? If you post yours (remove and personal information if you want) I can adapt it so that it just launches the main NWN file without using the currently-broken +connect feature, so that it still produces logs.
It's working, thank you. Also, I think (I know it is obvious, but...) you should mention separately that you have to launch the fourth option in the .bat file, "NWN: Main", and not the other three, which connect directly to the specified server.

Re: NWN:EE bat files

Posted: Wed Aug 22, 2018 12:24 am
by El-Ravioli
I play Nwn: EE through steam and used the bat file to create a link to the nwn executable in the steam apps server. However, going that way, none of my workshop subscribed Overrides load ....

Is there a way of a) using the bat file and b) still get the overrides? Or are they mutually exclusive?

Re: NWN:EE bat files

Posted: Wed Aug 22, 2018 12:58 am
by Rigela
I've manually placed the files in the correct folder (override in documents) and they work for me at least.

Re: NWN:EE bat files

Posted: Wed Aug 22, 2018 1:41 am
by El-Ravioli
WHOOOT !!! Thanks @Symphony !!!!

In order to use the BAT for log rotation, as well as loading the steam workshop overrides and always have them up to date without having to manually put stuff in your overrides folder, the following steps need to be done:

- In steam, create a desktop shortcut for NWN
- in the BAT file, change everything that says nwnmain.exe to the URL of that shortcut
- that will cause the steam loader to launch NWN, rather than it being loaded without the launcher and it will correctly use the workshop subscription.

My BAT file looks as follows:

Code: Select all

@echo off
::Your NWNL:EE log directory location on the next line.
set EEDocDir="C:\Users\user\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="C:\Users\user\Desktop"
::The location of your logs folder of your 1.69 install on the next line
set NWN169Dir="E:\GalaxyClient\Games\NWN Diamond"
:: Your 1.69 nwmain.exe install directory on the next line, only modify if it's different location from your logs folder
set NWN169GameDir=%NWN169Dir%
echo Select a Server
echo 1. NWN: EE Distant Shores
echo 2. NWN: EE Cities and Planes
echo 3. NWN: EE Surface
echo 4. NWN: 1.69 PGCC Arena
echo 5. NWN: 1.69 FL
set /p servervar= Server Number:
if %servervar% lss 4 (
  set logdir=%EEDocDir%
  cd /D %EEInstallDir%
  if %servervar% == 1 start /wait steam://rungameid/704450 +connect game.arelith.com:5121
  if %servervar% == 2 start /wait steam://rungameid/704450 +connect game.arelith.com:5122
  if %servervar% == 3 start /wait steam://rungameid/704450 +connect game.arelith.com:5123
)


if %servervar% gtr 3 (
  set logdir=%NWN169Dir%
  cd /D %NWN169GameDir%

  if %servervar% == 4 start /wait steam://rungameid/704450 +connect arena.arelith.com:5121
  if %servervar% == 5 start /wait steam://rungameid/704450 +connect fl.arelith.com:5121

)

for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set TODAY=%YYYY%-%MM%-%DD%
set NOW=%HH%-%Min%-%Sec%
move %logdir%\logs\nwclientLog1.txt %logdir%\logs\log-%TODAY%-%NOW%.txt


Re: NWN:EE bat files

Posted: Thu Aug 23, 2018 1:53 am
by triaddraykin
So it doesn't rotate the log until I start up the game next time, instead of right at the end of the session. It also doesn't connect directly to any server, instead launching the full game each time, so the +connect game.arelith.com:5121 might as well not be there.
Followed the instructions there. I have a shortcut on my desktop that's just "steam://rungameid/704450".
The code is:

Code: Select all

@echo off
::Your NWNL:EE log directory location on the next line.
set EEDocDir="C:\Users\Triaddraykin\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="C:\Users\Triaddraykin\Desktop" 
::The location of your logs folder of your 1.69 install on the next line
set NWN169Dir="E:\GalaxyClient\Games\NWN Diamond"
:: Your 1.69 nwmain.exe install directory on the next line, only modify if it's different location from your logs folder
set NWN169GameDir=%NWN169Dir%
echo Select a Server
echo 1. NWN: EE Distant Shores
echo 2. NWN: EE Cities and Planes
echo 3. NWN: EE Surface
echo 4. NWN: 1.69 PGCC Arena
echo 5. NWN: 1.69 FL
set /p servervar= Server Number:
if %servervar% lss 4 (
  set logdir=%EEDocDir%
  cd /D %EEInstallDir%
  if %servervar% == 1 start /wait steam://rungameid/704450 +connect game.arelith.com:5121
  if %servervar% == 2 start /wait steam://rungameid/704450 +connect game.arelith.com:5122
  if %servervar% == 3 start /wait steam://rungameid/704450 +connect game.arelith.com:5123
)


if %servervar% gtr 3 (
  set logdir=%NWN169Dir%
  cd /D %NWN169GameDir%

  if %servervar% == 4 start /wait steam://rungameid/704450 +connect arena.arelith.com:5121
  if %servervar% == 5 start /wait steam://rungameid/704450 +connect fl.arelith.com:5121

)

for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set TODAY=%YYYY%-%MM%-%DD%
set NOW=%HH%-%Min%-%Sec%
move %logdir%\logs\nwclientLog1.txt %logdir%\logs\log-%TODAY%-%NOW%.txt
For reference, what I have that DOES work, it's slightly modified as I don't have any 1.69 installation anymore:

Code: Select all

@setlocal enableextensions enabledelayedexpansion
@echo off
::Your NWNL:EE docoument directory on the next line, the location of your logs directory and nwnplayer.ini
set EEDocDir="C:\Users\Triaddraykin\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="D:\SteamLibrary\steamapps\common\Neverwinter Nights\bin\win32" 
echo Select a Server
echo 1. NWN: EE Distant Shores
echo 2. NWN: EE Cities and Planes
echo 3. NWN: EE Surface
echo 4. NWN: Main
set /p servervar= Server Number:
if %servervar% lss 5 (
  set logdir=%EEDocDir%
  cd /D %EEInstallDir%
  if %servervar% == 1 start /wait nwmain.exe +connect game.arelith.com:5121
  if %servervar% == 2 start /wait nwmain.exe +connect game.arelith.com:5122
  if %servervar% == 3 start /wait nwmain.exe +connect game.arelith.com:5123
  if %servervar% == 4 start /wait nwmain.exe
)

for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set TODAY=%YYYY%-%MM%-%DD%
set NOW=%HH%-%Min%-%Sec%
move %logdir%\logs\nwclientLog1.txt %logdir%\logs\log-%TODAY%-%NOW%.txt

Re: NWN:EE bat files

Posted: Sat Nov 17, 2018 12:42 pm
by Morderon
It's possible to get the game to remember your login AND get it to prompt you to change it.

Edit nwnplayer.ini

Set Player Name= to your most common login with a ? at the end, or any other character that's invalid in user names.

For example I could use Player Name=Morderon?

When logging into the server I'll be able to confirm I want to use Morderon or change it to something else.

Just saves you some time from typing your most common login while keeping it easy to change.

This works for any NWN: EE launching method.

Re: NWN:EE bat files

Posted: Sun Dec 16, 2018 7:49 pm
by Mattamue
I have the steam version of the EE and I'm having some trouble finding nwnplayer.ini to enable logging. Where should this be located in a default install?

Re: NWN:EE bat files

Posted: Mon Dec 17, 2018 1:22 am
by Fionn
I flipped this over to PS1 for those on Windows (or PowerShell Core). No 169 support. You'll want to verify/edit lines 1, 5 & 33. Let me know if I fat fingered anything.

Code: Select all

#Your NWNL:EE docoument directory on the next line, the location of your logs directory and nwnplayer.ini
$EEDocDir = Get-Item "$env:HOMEDRIVE$env:HOMEPATH\Documents\Neverwinter Nights"
$EELogDir = "$EEDocDir\logs"

#Your EE nwmain.exe install directory on the next line
$EEInstallDir = Get-Item "D:\SteamLibrary\steamapps\common\Neverwinter Nights\bin\win32" 
$nwmain = Get-Item "$EEInstallDir\nwmain.exe"

#set nwnplayer.ini & player name
$playerIni = 'nwnplayer.ini'
$playerBak = 'nwnplayer.bak'
Push-Location $EEDocDir
$playerName = (Get-Item $playerIni | Select-String '^Player Name=.*').Matches.Value.Split('=')[-1]
$newPlayerName = Read-Host -Prompt "Enter new player name (Enter to keep $playerName)"
if ($newPlayerName -eq '') {$newPlayerName = $playerName}
Pop-Location


#update player name
if($newPlayerName -ne $playerName){
    Rename-Item $playerIni $playerBak -ErrorAction Stop
    Get-Content $playerBak |%{
        if ($_ -match '^Player Name=.*'){
            Write-Output "Player Name=$newPlayerName"
        } else {
            Write-Output $_
        }
    } | Out-File -Encoding ascii -Append $playerIni
    if(Test-Path $playerIni) {Remove-Item $playerBak}
}

#backup logs
$numberToKeep = 50
$dateStamp = Get-Date -Format 'yyyyMMddHHmmss'
Push-Location $EELogDir
Rename-Item nwclientLog1.txt "nwclientLog_$dateStamp.txt"
$logs = (Get-ChildItem nwclientLog_*.txt)
if ($logs.Count -gt $numberToKeep){
    $numberToDelete = $logs.Count - $numberToKeep
    (0..(--$numberToDelete))|%{$logs[$_].Delete()}
}
Pop-Location

#select a server
$prompt = @"
Select a Server
1. NWN: EE Distant Shores
2. NWN: EE Cities and Planes
3. NWN: EE Surface

"@
$server = Read-Host -Prompt $prompt

#launch NWN
if ($server -lt 4) {
    Push-Location $nwmain.DirectoryName
    Start-Process -FilePath $nwmain.FullName -ArgumentList "+connect game.arelith.com:512$server"
}

Re: NWN:EE bat files

Posted: Tue Apr 09, 2019 6:32 am
by Skarain
Hello. A friend guided me to this thread, when I asked about how to record chat logs in NWN.

However, I understand nothing about this. I tried reading the thread over and over, first post and comments, but I still have no idea where to put the file for it to work.

Re: NWN:EE bat files

Posted: Tue Apr 09, 2019 7:50 am
by Drowble Oh Seven
Hullo!

I wrote a guide on setting this up for an older version of the bat files a while back. You'll need to replace the code you're copying and pasting with the bits from the first post of this topic to make sure you're getting the latest, but the principles should still be the same.

We probably don't need the 1.69 info in there anymore, but I don't think anyone's got around to tidying it up yet.

Re: NWN:EE bat files

Posted: Fri Aug 09, 2019 5:15 am
by Aelryn Bloodmoon
Before I go and give this a try, I've noticed all the information in this thread references steam directories - other than changing my game directory to fit my personal machine and install, does the fact that I got the game directly from Beamdog and launch through the Beamdog client rather than the steam client require any changes to the .bat files?

Re: NWN:EE bat files

Posted: Fri Aug 09, 2019 5:23 am
by Drowble Oh Seven
It shouldn't do - provided you're pointing it at whatever install directory it is that has your nwmain.exe in it. I'm not familiar with how it's laid out for the beamdog version, but the script pretty much bypasses launchers.