Logs

From Arelith Wiki
Jump to: navigation, search
Chat Logs
Arelithwikilogo.png
Arelith Wiki

Character Creation:
Creation (New Players Guide)
Race - Deity - Class
Gifts - Backgrounds - Alignment
Mark of Destiny - Epic Sacrifice
Customization - Head List - Builds
Character Systems:
Description - Disguise / Covered
Languages - Experience - Quests
Pickpocket - Rest
Death - Lycanthropy - Investigate
Sequencers - Runic Sequencers
World Systems:
Settlements - Factions
Quarters - Shops - Bank
Riding - Sailing
Communication - Portals
Time - Containers/Bags
Radiant Heart - Assassin's Guild
Sencliff's Pirates
Item Creation Systems:
Alchemy - Art Craft - Carpentry
Herb - Smith - Tailor
Dweomercraft - Runes
Armor
Weapons - Melee / Ranged / Siege
Resources - Poison
Arelith Changes:
Classes - Skills - Feats
Spells (list) - Summons
Familiar Reskins - Misc
Help:
Rules - Roleplay - Maps
Console Commands
Common Bugs - Staff
Support Tickets - Character Remake
[The Astrolabe]

Chat logs are a great way to preserve RP, study combat, and have logs for peace of mind in case of report-able issues.


Turn on logging in NWN EE

How to turn on logging in NWN EE.

Choose This Option

Batch files for Windows

Details for making .bat files.

Using steam install, not running through steam

Has the advantage of automatic log re-naming after quitting, but doesn't use Steam Workshop subscriptions

@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\<Your Username Here>\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="C:\Program Files (x86)\Steam\steamapps\common\Neverwinter Nights\bin\win32" 
echo Select a Server
echo 1. NWN: EE Distant Shores
echo 2. NWN: EE Cordor and Planes
echo 3. NWN: EE Surface
echo 4. NWN: EE Underdark
echo 5. NWN: EE Guldorand
echo 6. NWN: Main
echo 7. NWN: PGCC
set /p servervar= Server Number:
if %servervar% lss 8 (
  set logdir=%EEDocDir%
  cd /D %EEInstallDir%
  if %servervar% == 1 start /wait nwmain.exe +connect game.nwnarelith.com:5121
  if %servervar% == 2 start /wait nwmain.exe +connect game.nwnarelith.com:5122
  if %servervar% == 3 start /wait nwmain.exe +connect game.nwnarelith.com:5123
  if %servervar% == 4 start /wait nwmain.exe +connect game.nwnarelith.com:5124
  if %servervar% == 5 start /wait nwmain.exe +connect game.nwnarelith.com:5125
  if %servervar% == 6 start /wait nwmain.exe
  if %servervar% == 7 start /wait nwmain.exe +connect arena.arelith.com:5123
)

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

Using Steam install running through steam

Advantage of using Steam Workshop subscriptions and Steam overlay, but sludgy implementation of automatic chat logging

@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\Matta\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="C:\Users\Matta\Desktop" 

  set logdir=%EEDocDir%
  cd /D %EEInstallDir%
  ".\Neverwinter Nights Enhanced Edition.url"

/wait

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

Explaining the commands

  • @echo off
That turns off the unsightly file path.
  • cd C:\Program Files (x86)\Steam\steamapps\common\Neverwinter Nights\bin\win32
Make sure you have this, the batch doesn't seem to work right unless you set the path before.
  • echo
This is the text that you see.
  • set /p servervar= Server Number:
This is the multiple choice script.
server is the variable a variable and has to be set before anything can be done.
  • if %servervar% == 1 start nwmain.exe +connect game.arelith.com:5121
This called on the servervar variable (HAS to have % on either sides I believe)
And if servervar is set to 1 then it automatically connects to the server.

Bash files for Linux (and possibly macOS)

Details for making .bash files that rotate logs.

Using Steam install

This will normally integrate with Steam to run Neverwinter Nights but you can turn that functionality off by switching ENABLE_STEAM to "false". You can also run it without Steam running and, if your NWN_LAUNCH variable is set correctly, it will launch the game directly.

This is a very rudimentary script that will rotate logs automatically. The way this works is by renaming and filing away the client log each time the game runs. This has an advantage of being very lean, as it doesn't wait for a process to complete. This does mean that you'll have to run the .sh script in lieu of launching Neverwinter Nights normally.

It will sort all the files by year and month, so you'll see /2024/02/<LogFile> in your directories. This is preferable as it makes it less of a blob compared to other log rotators who will save all logs in the same folder.

The top 4 variables need to point in the right directions:

  • NWN_LAUNCH
Point this to where your game process launches out of. Don't edit anything past /steamapps as that should be correct.
  • LOG_INPUT_FOLDER
Point this to where your logs are first created.
  • LOG_OUTPUT_FOLDER
Point this where you want the log files to dump.
  • LOG_MIN_LINES
Set this the minimum number of lines the log needs to be before it will create a dump. I keep this at 100 so it doesn't copy logs for things like quick login-logout scenarios. You could increase this or lower this as you prefer.
  • ENABLE_STEAM
Set this to "false" if you want no Steam integration.
NWN_LAUNCH=<path-to-steam-library>/steamapps/common/Neverwinter\ Nights/bin/linux-x86
LOG_INPUT_FOLDER=~/.local/share/Neverwinter\ Nights/logs
LOG_OUTPUT_FOLDER=~/Documents/nwn-logs
LOG_MIN_LINES=100
ENABLE_STEAM=true

input=$LOG_INPUT_FOLDER/nwclientLog1.txt
line_count=$(wc -l < "$input")
if [ "$line_count" -ge "$LOG_MIN_LINES" ];
then
	year=$(date -r $input +"%Y")
	month=$(date -r $input +"%m")
	day=$(date -r $input +"%d")
	hour=$(date -r $input +"%H")
	minute=$(date -r $input +"%M")
	second=$(date -r $input +"%S")
	outputfolder=$LOG_OUTPUT_FOLDER/$year/$month/
	outputname=$year-$month-$day-$hour:$minute:$second.txt
	echo -e "Copying $input to $outputfolder as $outputname"
	mkdir -p $outputfolder && mv $input $outputfolder$outputname
else
	echo "Skipping log copy. Lines in log are fewer than $LOG_MIN_LINES."
fi

if pgrep -x "steam" >/dev/null && $ENABLE_STEAM = "true"
then
	echo "Steam is running. Running through Steam."
	nohup steam steam://rungameid/704450 &
else
	cd "$NWN_LAUNCH"
	echo "Steam is not running or is disabled. Running directly."
	nohup ./nwmain-linux &
fi
sleep 20
exit