-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add VariableFixer script to fix a bug that prevents the game from loa…
…ding
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Made by Creepersbane | ||
ScriptMessage(@"This script will most likely fix data files with the following symptoms: | ||
If, after loading the data file after code editing, any of the following occur: | ||
No window appears at all | ||
""Out of memory!"" error appears while loading | ||
No "".gamelog.txt"" is produced | ||
The "".gamelog.txt"" is produced but appears to fail after Steam initialization. | ||
The game window appears but is frozen indefinitely | ||
"); | ||
Data.GeneralInfo.DisableDebugger = true; | ||
int globalNum = 0; | ||
int selfNum = 0; | ||
foreach(var vari in Data.Variables) | ||
{ | ||
if (vari.InstanceType == UndertaleInstruction.InstanceType.Global) | ||
{ | ||
vari.VarID = globalNum++; | ||
} | ||
else if ((vari.InstanceType == UndertaleInstruction.InstanceType.Self) && (vari.VarID >= 0)) | ||
{ | ||
vari.VarID = selfNum++; | ||
} | ||
} | ||
Data.VarCount1 = (uint)globalNum; | ||
Data.VarCount2 = (uint)selfNum; | ||
|
||
ScriptMessage(@"Complete, please save and run the game now to apply and test your changes."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters