• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Mutator that creates a separate log?

var FileWriter writer;
.....
self.writer = self.Spawn(class'FileWriter');
self.writer.OpenFile("MyFilename", FWFT_Log, ".txt", true, true);
.....
self.writer.Logf("My Text Here");
.....
self.writer.CloseFile();


Logf is probably pretty slow, so it may not be a good idea to write something every tick :D
But I guess, you need something into file on round start/end.
 
Upvote 0
var FileWriter writer;
.....
self.writer = self.Spawn(class'FileWriter');
self.writer.OpenFile("MyFilename", FWFT_Log, ".txt", true, true);
.....
self.writer.Logf("My Text Here");
.....
self.writer.CloseFile();


Logf is probably pretty slow, so it may not be a good idea to write something every tick :D
But I guess, you need something into file on round start/end.

Out of the box you can't use it in the tick event. It doesn't write anything there unless you set property bTickIsDisabled to false (default value is true), though it's not recommendable due to the hight frequency of disk access, however that can be controlled by setting bFlushEachWrite to false (default value is true). If done, then a call to Logf won't directly result in a disk write. Instead it will be written to a RAM buffer and flushed when either the buffer is full or when the file is closed.

In code it looks like:
Code:
self.writer.bTickIsDisabled = false;
self.writer.bFlushEachWrite = false;
 
Upvote 0