Skip to content

Commit

Permalink
Merge pull request #1085 from Jacky720/scriptfixes
Browse files Browse the repository at this point in the history
Attempt fixes to reported erring scripts
  • Loading branch information
Grossley authored Dec 17, 2022
2 parents 5463085 + 9a3a343 commit bf0f80e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
22 changes: 16 additions & 6 deletions UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

EnsureDataLoaded();

// Is actually incompatible. Something broke when I (Space Core) tried to combine the UT and SURVEY_PROGRAM code.
if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2")
{
ScriptError("Error 0: Incompatible with the new Deltarune Chapter 1 & 2 demo");
Expand Down Expand Up @@ -116,7 +117,16 @@ void StringSwap(int n, int k)
Data.Strings[n].Content = value;
}

if (Data.GeneralInfo.Filename.Content.ToLower().Contains("undertale"))
string GameName = Data.GeneralInfo.DisplayName.Content.ToLower();
bool deltamode = false;
if (GameName.Contains("undertale") || GameName.Contains("nxtale"))
deltamode = false;
else if (GameName.Contains("survey_program"))
deltamode = true;
else
deltamode = ScriptQuestion("Is this Deltarune Chapter 1 or a mod thereof?");

if (!deltamode)
{
List<int> choicer_lines = new List<int>();
List<int> final_lines = new List<int>();
Expand Down Expand Up @@ -228,10 +238,10 @@ foreach (var obj in Data.GameObjects)
{
if (!obj.Visible)
continue;
if (obj._Sprite.CachedId >= 0)
obj.Sprite = Data.Sprites[obj._Sprite.CachedId];
if (obj._TextureMaskId.CachedId >= 0)
obj.TextureMaskId = Data.Sprites[obj._TextureMaskId.CachedId];
if (obj._sprite.CachedId >= 0)
obj.Sprite = Data.Sprites[obj._sprite.CachedId];
if (obj._textureMaskId.CachedId >= 0)
obj.TextureMaskId = Data.Sprites[obj._textureMaskId.CachedId];
}

ScriptMessage("* GASTER NOISES *\n\nIT'S DONE");
ScriptMessage("* GASTER NOISES *\n\nIT'S DONE");
11 changes: 0 additions & 11 deletions UndertaleModTool/Scripts/Builtin Scripts/DeltaMILK.csx
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
EnsureDataLoaded();

if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2")
{
ScriptError("Error 0: Incompatible with the new Deltarune Chapter 1 & 2 demo");
return;
}
else if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1&2")
{
ScriptError("Error 1: Incompatible with the new Deltarune Chapter 1 & 2 demo");
return;
}

ScriptMessage("Select the MILK that you prefer\nReplace every non-background sprite with milk (for Deltarune)\nby krzys_h");

var milk = Data.Sprites.ByName("spr_checkers_milk").Textures[0].Texture;
Expand Down

0 comments on commit bf0f80e

Please sign in to comment.