ItsDeltin / Overwatch-Script-To-Workshop

Converts scripts to Overwatch workshops.
210 stars 27 forks source link

No variable by the name of 'Mauga' exists in the enum Hero. #477

Closed youyou-128 closed 8 months ago

youyou-128 commented 8 months ago
An exception was thrown while decompiling: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Deltin.Deltinteger.Decompiler.ElementToCode.WorkshopFunctionDecompileHook.<>c.<.cctor>b__5_10(DecompileRule decompiler, FunctionExpression function) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\ElementToCode\FunctionConvert.cs:line 32
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Decompile(DecompileRule decompiler, Boolean end) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 35
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Deltin.Deltinteger.Decompiler.TextToElement.ITTEExpression.Decompile(DecompileRule decompiler) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 22
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Default(DecompileRule decompiler, Boolean end) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 44
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Decompile(DecompileRule decompiler, Boolean end) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 37
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Deltin.Deltinteger.Decompiler.TextToElement.ITTEExpression.Decompile(DecompileRule decompiler) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 22
   at Deltin.Deltinteger.Decompiler.TextToElement.StringExpression.Decompile(DecompileRule decompiler) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Expressions.cs:line 55
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Default(DecompileRule decompiler, Boolean end) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 44
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Decompile(DecompileRule decompiler, Boolean end) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 37
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Deltin.Deltinteger.Decompiler.TextToElement.ITTEAction.Decompile(DecompileRule decompiler) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 26
   at Deltin.Deltinteger.Decompiler.ElementToCode.WorkshopFunctionDecompileHook.<>c.<.cctor>b__5_21(DecompileRule decompiler, FunctionExpression function) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\ElementToCode\FunctionConvert.cs:line 215
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Decompile(DecompileRule decompiler, Boolean end) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 35
   at Deltin.Deltinteger.Decompiler.TextToElement.FunctionExpression.Deltin.Deltinteger.Decompiler.TextToElement.ITTEAction.Decompile(DecompileRule decompiler) in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\TextToElement\Functions.cs:line 26
   at Deltin.Deltinteger.Decompiler.ElementToCode.DecompileRule.DecompileActions() in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\D
ecompiler\ElementToCode\ElementToCode.cs:line 138
   at Deltin.Deltinteger.Decompiler.ElementToCode.RuleTraveler.Decompile() in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\ElementToCode\ElementToCode.cs:line 221
   at Deltin.Deltinteger.Decompiler.ElementToCode.WorkshopDecompiler.Decompile() in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Decompiler\ElementToCode\ElementToCode.cs:line 65
   at Deltin.Deltinteger.LanguageServer.DeltintegerLanguageServer.<>c__DisplayClass33_6.<AddRequests>b__21() in C:\Users\Cactu\OneDrive\Projects\Overwatch-Script-To-Workshop\Deltinteger\Deltinteger\Language Server\Server.cs:line 275

Here is the code:

rule("33")
{
    event
    {
        Subroutine;
        Sub_menu_1;
    }

    actions
    {
        "伤害属性菜单1"
        If(Event Player.menu == 1031);
            Create In-World Text(Event Player, Custom String("   {0}\r\n下一页", Icon String(Arrow: Right)), Event Player.menu_location[0], 1.800,
                Do Not Clip, None, Color(White), Default Visibility);
            Event Player.memu_word[0] = Last Text ID;
            Create In-World Text(Event Player, Custom String("     {0}\r\n伤害300", Hero Icon String(Hero(Cassidy))),
                Event Player.menu_location[2], 1.800, Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[1] = Last Text ID;
            Create In-World Text(Event Player, Custom String("     {0}\r\n伤害500", Hero Icon String(Hero(Pharah))),
                Event Player.menu_location[3], 2, Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[2] = Last Text ID;
            Create In-World Text(Event Player, Number Of Heroes(Hero(Roadhog), All Teams) < 2 ? Custom String("     {0}\r\n伤害800",
                Hero Icon String(Hero(Roadhog))) : Custom String("      {0}\r\n数量上限", Icon String(No)), Event Player.menu_location[4], 1.800,
                Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[3] = Last Text ID;
            Create In-World Text(Event Player, Custom String("      {0}\r\n伤害1200", Hero Icon String(Hero(Widowmaker))),
                Event Player.menu_location[1], 1.800, Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[4] = Last Text ID;
        "伤害属性菜单2"
        Else If(Event Player.menu == 1032);
            Create In-World Text(Event Player, Custom String("       {0}\r\n伤害1500", Hero Icon String(Hero(Illari))),
                Event Player.menu_location[2], 2, Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[5] = Last Text ID;
            Create In-World Text(Event Player, Custom String("      {0}\r\n伤害2000", Hero Icon String(Hero(Junkrat))),
                Event Player.menu_location[3], 2, Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[6] = Last Text ID;
            Create In-World Text(Event Player, Custom String("       {0}\r\n伤害3000", Hero Icon String(Hero(Bastion))),
                Event Player.menu_location[4], 2, Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[7] = Last Text ID;
            Create In-World Text(Event Player, Custom String("       {0}\r\n伤害5000", Hero Icon String(Hero(Mauga))),
                Event Player.menu_location[1], 2, Do Not Clip, None, Color(Red), Default Visibility);
            Event Player.memu_word[8] = Last Text ID;
            Create In-World Text(Event Player, Custom String("   {0}\r\n上一页", Icon String(Arrow: Left)), Event Player.menu_location[0], 2,
                Do Not Clip, None, Color(White), Default Visibility);
            Event Player.memu_word[9] = Last Text ID;
        End;
    }
}
youyou-128 commented 8 months ago

I think the error occurred in Hero Icon String(Hero(Mauga))

youyou-128 commented 8 months ago

and i got this image

youyou-128 commented 8 months ago

Solved . vscode dont update the server.exe automatically. so you should download the latest released and set it in vscode settings.