irswat Posted January 27, 2017 Share Posted January 27, 2017 I want to write papyrus trace logs to a log folder specific to my mod for alpha testing purposes. function DumpLog() float time string log string timeLogFileName string filePath time=Utility.GetCurrentRealTime() timeLogFileName=(time as string) string sDatafileName ;gets My documents location Console("Bat GetPath.bat") sDatafileName = "SVCE/filePath.txt" if MiscUtil.FileExists(sDatafileName) debug.trace("File found: reading file.") filePath = MiscUtil.ReadFromFile(sDatafileName) endif ;sets path to papyrus trace log filePath = filePath + "\My Games\Skyrim\Logs\Script\Papyrus.0.log" sDatafileName = filePath ;dumps contents of tracelog to a string if MiscUtil.FileExists(sDatafileName) debug.trace("File found: reading file.") log = MiscUtil.ReadFromFile(sDatafileName) endif ;sets write file path to current time stamp debug.trace("dumping from " + sDatafileName + "/logs/ to " + time) sDatafileName = "SVCE/logs/" + timeLogFileName + ".txt" ;writes log to timstamped file in SVCE folder WriteToFile(sDatafileName, log, false, false) endFunction this line is throwing a bunch of errors:filePath = filePath + "\My Games\Skyrim\Logs\Script\Papyrus.0.log" Starting 1 compile threads for 1 files...Compiling "SVCE_ParserEngine"...C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,24): mismatched character '\' expecting '"'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,34): mismatched character 's' expecting '\n'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,41): mismatched character 'l' expecting '\n'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,46): mismatched character 's' expecting '\n'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,53): mismatched character 'p' expecting '\n'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,63): required (...)+ loop did not match anything at character 'l'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,25): no viable alternative at input 'My'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,42): required (...)+ loop did not match anything at input 'ogs'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,54): required (...)+ loop did not match anything at input 'apyrus'C:\Games\steamapps\common\skyrim\Data\Scripts\Source\SVCE_ParserEngine.psc(3475,63): no viable alternative at input 'log'No output generated for SVCE_ParserEngine, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on SVCE_ParserEngineAm I allowed to concatenate strings like this? Link to comment Share on other sites More sharing options...
irswat Posted January 27, 2017 Author Share Posted January 27, 2017 SOLVED: the function requires back slashes not forward slashes Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 27, 2017 Share Posted January 27, 2017 In case you were not aware, papyrus has a way of creating mod specific logs. See TraceUser for more details. Link to comment Share on other sites More sharing options...
irswat Posted January 27, 2017 Author Share Posted January 27, 2017 that is very good to know! Link to comment Share on other sites More sharing options...
Recommended Posts