Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

charlieoctopus5000

Uploaded by

charlieoctopus5000

Virus scan

Safe to use

Tags for this mod

About this mod

The Console's output (the CommandHistory TextField in the code-base) is great, but it has some bugs too.
With an output buffer set to 16384 chars on the Flash side, and with the BGSCodeObj's own buffer limit of 65536 chars per command on the Scaleform side, some output can be truncated.
Here's a simple fix.

Permissions and credits
To fix the bug yourself:

1) Extract Fallout 4 - Interface.ba2 from your installation's Data\ directory, and find Console.swf.
2) Open Console.swf in a flash decompiler, and make the yellow changes to Console.as:

package
{
...   
   public class Console extends MovieClip
   {       
   ...      

private const PREVIOUS_COMMANDS:uint = 8192;  // more than we'll ever use in a session
private var HistoryCharBufferSize:uint = 131072; // one command's output can be ~65536 chars long

...

// remove this setter, we will manage the buffer size internally
//public function set historyCharBufferSize(param1:uint) : *
//   {
//       this.HistoryCharBufferSize = param1;
//   }

...

public function AddHistory(commandOutput:String) : *
{

var command:String = "";
GlobalFunc.SetText(this.CommandHistory,this.CommandHistory.text + commandOutput, false);

// Warn us if the command's output is too close to 65536 chars long. 
// BGSCodeObj will only send complete lines of output. 
// So if an overflow occurred, we'll receive everything up to the first line that went over.

if (commandOutput.length > 65436) 

{ 
command = commandOutput.split("\n")[0];    // pick first line of output
command = command.replace(/\"/g, "");  // replace any quotes

GlobalFunc.SetText(this.CommandHistory, this.CommandHistory.text + 
"Warning - command \'" + command + "\' output length: " + commandOutput.length + 
" is close to maximum buffer size of 65536 chars. Output may be truncated.\n", false);
}

if (this.CommandHistory.text.length > this.HistoryCharBufferSize)
{
GlobalFunc.SetText(this.CommandHistory,
this.CommandHistory.text.substr(-this.HistoryCharBufferSize), false);
}
this.CommandHistory.scrollV = this.CommandHistory.maxScrollV;
   }

...


3) Recompile the changes to Console.swf into your installation's Data\Interface\ directory (create the directory if it doesn't exist).
4) Make sure these changes have been made to Fallout4Custom.ini:

[Archive] 

sResourceDataDirsFinal=STRINGS\,INTERFACE\
[Launcher] 
bEnableFileSelection=1