Coder Social home page Coder Social logo

war3net's Introduction

War3Net

A .NET implementation of Warcraft III related libraries

GitHub stars GitHub forks


What is War3Net?ProjectsContributingLicense


What is War3Net?

War3Net is a collection of libraries for Warcraft III modding.

Projects

Project Summary NuGet
War3Net.Build Generate Wacraft III map script and MPQ archive, by reading from C#/vJass source code and war3map files. VBuild
War3Net.Build.Core Parsers and serializers for war3map files. VBuildCore
War3Net.CodeAnalysis Helper methods for Pidgin parsers. VCode
War3Net.CodeAnalysis.CSharp deprecated VCodeCSharp
War3Net.CodeAnalysis.Decompilers Regenerate war3map files from a Warcraft III map script. VCodeDecomp
War3Net.CodeAnalysis.Jass War3Net.CodeAnalysis.Jass is a library for parsing and rendering JASS source files. VCodeJass
War3Net.CodeAnalysis.Transpilers Transpiles JASS source code to C# or lua. VCodeTrans
War3Net.Common Contains some methods used by several other War3Net projects. VCommon
War3Net.Drawing.Blp War3Net.Drawing.Blp is a library for reading files with the ".blp" extension. VBlp
War3Net.IO.Casc Class library for opening CASC archives. Coming soon
War3Net.IO.Compression Decompression and compression algorithms for compression methods commonly used in MPQ archives. VCompress
War3Net.IO.Mpq Class library for opening and creating MPQ files. VMpq
War3Net.IO.Slk Library for opening and creating files in SLK format. VSlk
War3Net.Modeling Read and write .mdl and .mdx files. Coming soon
War3Net.Rendering Renders Warcraft III models using Veldrid. Coming soon
War3Net.Replay Parse replay (.w3g) files. Coming soon
War3Net.Runtime Uses NLua to run JASS and lua map scripts. Coming soon
War3Net.Runtime.Core C# implementation of Warcraft III's backend code. Coming soon
War3Net.Runtime.Api.Blizzard The Blizzard.j API implemented in C#. Coming soon
War3Net.Runtime.Api.Common API for War3Net.Runtime.Core, similar to War3Api.Common. Coming soon

Some of the above projects are based on code from other repositories:

Contributing

GitHub issues GitHub pull requests

License

GitHub license

War3Net is licenced under the MIT license. Projects from NuGet packages and submodules may have a different license.

war3net's People

Contributors

drake53 avatar speige avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

war3net's Issues

Compiler can crash rather than offering error message

I ran into an issue with CSharp.lua that was creating an error during compilation.

However, it was tough to track down because when I use Map.CompileScript, it gives a rather opaque error message:

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=War3Net.Build
  StackTrace:
   at War3Net.Build.CompileResult..ctor(EmitResult emitResult)
   at War3Net.Build.Extensions.MapExtensions.CompileScript(Map map, Compiler compiler, MapScriptBuilder mapScriptBuilder, IEnumerable`1 luaSystemLibs, String commonJPath, String blizzardJPath)
   at War3Net.Build.Extensions.MapExtensions.CompileScript(Map map, Compiler compiler, IEnumerable`1 luaSystemLibs, String commonJPath, String blizzardJPath)
   at Launcher.Program.Build(Boolean launch) in C:\Users\Thomas\Desktop\WCSharpTemplate\Launcher\Program.cs:line 98

My guess is that there's a CompilationErrorException during compilation here and for whatever reason, e.EmitResult is null, and contains no information. That then gives the NullReferenceException in the CompileResult constructor. But I don't have an internal stack trace, so I can't be sure.

Anyway, the error I hit was an unusual one, so maybe it's handled differently, but you can reproduce it like I described here. I'm using WCSharp's template.

Thanks as always for your work - this is a great tool!

Unable to parse value '0.15'

Hi, I am getting a very obscure error when some of my developers try to build run my Warcraft 3 map. This is the error:
image

I have never experienced this error myself. The only developers on my team who get the error have their Windows operating system language set to something other than English. I can therefore only assume that this is a locale error.

I understand that this is a very vague report but I'm hoping you might have some leads. If not, no worries, I will keep digging. I think my next step is to set up a VM with a different language so I can test it on another locale.

Thankyou.

Implement .wgc

Finished description here: https://github.com/Luashine/WC3MapSpecification/blob/pr-gameconfig/GameConfiguration/1.md

It's been a while since 2007:

  1. https://www.hiveworkshop.com/threads/how-to-run-maps-with-high-gamespeed.37255/
  2. https://www.wc3maps.com/InsideTheW3M.html

PS: Turns out I'm getting increasingly worse at reading comprehension, the wc3maps page has a complete format description, I thought it lacked the full description of player slot flags... That could've spared me an hour testing that bitfield.

War3 Server

Hi,I want to get rid of Battle.Net to play games ,any good advice?pvpgn also seems to download Battle.Net

SylkTable.Parse cannot parse the comment(s) field in unitweapons.slk

I noticed this while trying out the current iteration of War3Api.Object.Generator and thought it might be a 1.32 specific issue. I get the exception System.NotSupportedException: Can only parse strings, integers, floats, and booleans. I can share my unitweapons.slk file if that would be helpful. I tried parsing every other .slk file in the "units" folder and everything else worked.

can't build

I cloned the code locally, but most projects can't be build

Severity Code Description Project File Line Suppression State Tool Error CS0117 'MapEnvironment' does not contain a definition for 'Default' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Environment\MapEnvironmentTests.cs 32 Active Compiler Error CS0103 The name 'StreamExtensions' does not exist in the current context War3Net.Replay C:\Users\chriscp\source\repos\War3Net\src\War3Net.Replay\ReplayParser.cs 43 Active Compiler Error CS0117 'MapEnvironment' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Environment\MapEnvironmentTests.cs 28 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Environment\MapEnvironmentTests.cs 55 Active Compiler Error CS0117 'MapEnvironment' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Environment\MapEnvironmentTests.cs 58 Active Compiler Error CS0117 'MapEnvironment' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Environment\MapEnvironmentTests.cs 67 Active Compiler Error CS0103 The name 'MapFileFactory' does not exist in the current context War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Environment\MapPreviewIconsTests.cs 36 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Info\MapInfoTests.cs 28 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Default' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Info\MapInfoTests.cs 32 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Info\MapInfoTests.cs 124 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Info\MapInfoTests.cs 134 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Info\MapInfoTests.cs 153 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Info\MapInfoTests.cs 156 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\CampaignObjectDataTests.cs 26 Active Compiler Error CS0103 The name 'CampaignObjectData' does not exist in the current context War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\CampaignObjectDataTests.cs 29 Active Compiler Error CS0103 The name 'CampaignObjectData' does not exist in the current context War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\CampaignObjectDataTests.cs 36 Active Compiler Error CS0103 The name 'CampaignObjectData' does not exist in the current context War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\CampaignObjectDataTests.cs 41 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\MapObjectDataTests.cs 26 Active Compiler Error CS0103 The name 'MapObjectData' does not exist in the current context War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\MapObjectDataTests.cs 29 Active Compiler Error CS0103 The name 'MapObjectData' does not exist in the current context War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\MapObjectDataTests.cs 36 Active Compiler Error CS0103 The name 'MapObjectData' does not exist in the current context War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Object\MapObjectDataTests.cs 41 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\ParseTestHelper.cs 57 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\ParseTestHelper.cs 84 Active Compiler Error CS1503 Argument 2: cannot convert from 'System.Text.Encoding' to 'bool' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\ParseTestHelper.cs 85 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Script\MapCustomTextTriggersTests.cs 61 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Script\MapTriggersTests.cs 60 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.Build.Map' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 36 Active Compiler Error CS1503 Argument 1: cannot convert from 'War3Net.Build.ScriptCompilerOptions' to 'string' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 37 Active Compiler Error CS1503 Argument 2: cannot convert from 'string' to 'War3Net.IO.Mpq.MpqArchiveCreateOptions' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 37 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Parse' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 52 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.Build.Map' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 61 Active Compiler Error CS1503 Argument 1: cannot convert from 'War3Net.Build.ScriptCompilerOptions' to 'string' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 62 Active Compiler Error CS1503 Argument 2: cannot convert from 'string' to 'War3Net.IO.Mpq.MpqArchiveCreateOptions' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 62 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Default' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 83 Active Compiler Error CS0117 'MapEnvironment' does not contain a definition for 'Default' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 84 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.Build.Map' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 93 Active Compiler Error CS1503 Argument 1: cannot convert from 'War3Net.Build.ScriptCompilerOptions' to 'string' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 94 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Parse' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 113 Active Compiler Error CS0117 'MapInfo' does not contain a definition for 'Default' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 117 Active Compiler Error CS0117 'MapEnvironment' does not contain a definition for 'Parse' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 146 Active Compiler Error CS0117 'MapEnvironment' does not contain a definition for 'Default' War3Net.Build.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Tests\MapBuilderTest.cs 150 Active Compiler Error CS0103 The name 'JassPidginParser' does not exist in the current context War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 30 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'arguments' of 'JassInvocationExpressionSyntax.JassInvocationExpressionSyntax(JassIdentifierNameSyntax, JassArgumentListSyntax)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 38 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 39 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 39 Active Compiler Error CS1729 'JassInvocationExpressionSyntax' does not contain a constructor that takes 3 arguments War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 40 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 40 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 40 Active Compiler Error CS1729 'JassInvocationExpressionSyntax' does not contain a constructor that takes 3 arguments War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 41 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 41 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 41 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 53 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 53 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 58 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 64 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 65 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'fracPart' of 'JassRealLiteralExpressionSyntax.JassRealLiteralExpressionSyntax(string, string)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 116 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'fracPart' of 'JassRealLiteralExpressionSyntax.JassRealLiteralExpressionSyntax(string, string)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 117 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'fracPart' of 'JassRealLiteralExpressionSyntax.JassRealLiteralExpressionSyntax(string, string)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 118 Active Compiler Error CS0117 'JassNullLiteralExpressionSyntax' does not contain a definition for 'Null' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 139 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 145 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 146 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'arguments' of 'JassInvocationExpressionSyntax.JassInvocationExpressionSyntax(JassIdentifierNameSyntax, JassArgumentListSyntax)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 151 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'arguments' of 'JassInvocationExpressionSyntax.JassInvocationExpressionSyntax(JassIdentifierNameSyntax, JassArgumentListSyntax)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 152 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'arguments' of 'JassInvocationExpressionSyntax.JassInvocationExpressionSyntax(JassIdentifierNameSyntax, JassArgumentListSyntax)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 153 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'arguments' of 'JassInvocationExpressionSyntax.JassInvocationExpressionSyntax(JassIdentifierNameSyntax, JassArgumentListSyntax)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 169 Active Compiler Error CS7036 There is no argument given that corresponds to the required formal parameter 'arguments' of 'JassInvocationExpressionSyntax.JassInvocationExpressionSyntax(JassIdentifierNameSyntax, JassArgumentListSyntax)' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 178 Active Compiler Error CS1729 'JassInvocationExpressionSyntax' does not contain a constructor that takes 3 arguments War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 187 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 189 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 190 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 202 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 205 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 244 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 252 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 253 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 262 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 265 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 268 Active Compiler Error CS1503 Argument 1: cannot convert from 'string' to 'War3Net.CodeAnalysis.Jass.Syntax.JassIdentifierNameSyntax' War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\ExpressionParserTests.cs 269 Active Compiler Error CS0103 The name 'JassPidginParser' does not exist in the current context War3Net.CodeAnalysis.Jass.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.CodeAnalysis.Jass.Tests\SyntaxAssert.cs 40 Active Compiler Error CS5001 Program does not contain a static 'Main' method suitable for an entry point War3Net.Drawing.Blp.Benchmarks C:\Users\chriscp\source\repos\War3Net\perf\War3Net.Drawing.Blp.Benchmarks\CSC 1 Active Compiler Error CS0246 The type or namespace name 'SkiaSharp' could not be found (are you missing a using directive or an assembly reference?) War3Net.Drawing.Blp.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Drawing.Blp.Tests\BlpImageTest.cs 22 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'FileExists' War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\FileProviderTests.cs 24 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\FileProviderTests.cs 33 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\FileProviderTests.cs 40 Active Compiler Error CS1061 'MpqArchive' does not contain a definition for 'HashTableSize' and no accessible extension method 'HashTableSize' accepting a first argument of type 'MpqArchive' could be found (are you missing a using directive or an assembly reference?) War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqArchiveTests.cs 129 Active Compiler Error CS1061 'MpqArchive' does not contain a definition for 'HashTableSize' and no accessible extension method 'HashTableSize' accepting a first argument of type 'MpqArchive' could be found (are you missing a using directive or an assembly reference?) War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqArchiveTests.cs 129 Active Compiler Error CS1501 No overload for method 'FileExists' takes 2 arguments War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqArchiveTests.cs 140 Active Compiler Error CS1061 'MpqArchive' does not contain a definition for 'HashTableMask' and no accessible extension method 'HashTableMask' accepting a first argument of type 'MpqArchive' could be found (are you missing a using directive or an assembly reference?) War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqArchiveTests.cs 145 Active Compiler Error CS1503 Argument 3: cannot convert from 'string' to 'bool' War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqArchiveTests.cs 185 Active Compiler Error CS1501 No overload for method 'FileExists' takes 2 arguments War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqArchiveTests.cs 215 Active Compiler Error CS1061 'MpqArchive' does not contain a definition for 'TryAddFilename' and no accessible extension method 'TryAddFilename' accepting a first argument of type 'MpqArchive' could be found (are you missing a using directive or an assembly reference?) War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqArchiveTests.cs 262 Active Compiler Error CS1503 Argument 1: cannot convert from 'method group' to 'int' War3Net.IO.Mpq.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.IO.Mpq.Tests\MpqFilesTests.cs 30 Active Compiler Error CS5001 Program does not contain a static 'Main' method suitable for an entry point War3Net.Modeling.Benchmarks C:\Users\chriscp\source\repos\War3Net\perf\War3Net.Modeling.Benchmarks\CSC 1 Active Compiler Error CS0006 Metadata file 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Replay\bin\Debug\net5.0\ref\War3Net.Replay.dll' could not be found War3Net.Replay.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Replay.Tests\CSC 1 Active Compiler Error CS0117 'FileProvider' does not contain a definition for 'GetFile' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Script\MapTriggerStringsTests.cs 27 Active Compiler Error CS0117 'MapTriggerStrings' does not contain a definition for 'Parse' War3Net.Build.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Build.Core.Tests\Script\MapTriggerStringsTests.cs 30 Active Compiler Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Rendering C:\Users\chriscp\source\repos\War3Net\src\War3Net.Rendering\War3Net.Rendering.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Core C:\Users\chriscp\source\repos\War3Net\src\War3Net.Runtime.Core\War3Net.Runtime.Core.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Api.Common C:\Users\chriscp\source\repos\War3Net\src\War3Net.Runtime.Api.Common\War3Net.Runtime.Api.Common.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime C:\Users\chriscp\source\repos\War3Net\src\War3Net.Runtime\War3Net.Runtime.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Api.Blizzard C:\Users\chriscp\source\repos\War3Net\src\War3Net.Runtime.Api.Blizzard\War3Net.Runtime.Api.Blizzard.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Rendering.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Rendering.Tests\War3Net.Rendering.Tests.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Api.Blizzard.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Runtime.Api.Blizzard.Tests\War3Net.Runtime.Api.Blizzard.Tests.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Core.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Runtime.Core.Tests\War3Net.Runtime.Core.Tests.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Runtime.Tests\War3Net.Runtime.Tests.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Benchmarks C:\Users\chriscp\source\repos\War3Net\perf\War3Net.Runtime.Benchmarks\War3Net.Runtime.Benchmarks.csproj 1 ResolvePackageAssets Error NU1104 Unable to find project 'C:\Users\chriscp\source\repos\War3Net\src\War3Net.Drawing.Tga\War3Net.Drawing.Tga.csproj'. Check that the project reference is valid and that the project file exists. War3Net.Runtime.Api.Common.Tests C:\Users\chriscp\source\repos\War3Net\tests\War3Net.Runtime.Api.Common.Tests\War3Net.Runtime.Api.Common.Tests.csproj 1 ResolvePackageAssets

[Question] How to use predefined regions?

so i have predefined region
image

which is used like

call AddSpecialEffectLocBJ(GetRectCenter(gg_rct_Spawn1Reg), "Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl")

how do i translate it to War3Net api?

i am missing something like :
AddSpecialEffectToCenterOfRegion(string pathToEffect, string knownRegion));

do i have to define the region again even if its in map data? like:

var regionOne = Rect(-2592, -2016, 992, 1568);
AddSpecialEffect(SPECIAL_EFFECT_1, GetRectCenterX(regionOne), GetRectCenterY(regionOne));

All destructible on compiled maps are duplicated

When I build a map using MapBuilder, all destructibles on the resulting map are duplicated.
You can see it in the following gif. When I hit the tree and it shakes, there's another tree inside it.
Animation

If you need me to make a demonstration map I certainly can. Cheers.

MapBuilder method 'AddFiles' fails to add files correctly.

Firstly, this is not an issue when adding files from folder mode maps. This happens when adding files to the builder from a 'MpqArchive' like this:

var map = Map.Open(mapDir);
MapBuilder builder = new MapBuilder(map);
using (Stream s = new FileStream(mapDir, FileMode.Open))
{
    MpqArchive mpq = new MpqArchive(s);
    builder.AddFiles(mpq);
}

I don't know if this is the correct way to do it but I'm sort of stuck.
I end up with green textures in most cases, but as you can see the bottom 'action bar' texture loads fine:

img

This doesn't seem to be exclusive to the file type, because all imported textures in this image are .tga files (don't judge, old map), while the loading screen is .dds which is also not present when loading.
The output mpq also has hundreds of 'File000xxxx'.

I uploaded the map in question in case you want to test this:
https://www.hiveworkshop.com/pastebin/2e34e565526802985f40f7c11146406d.27177

OpenFile() in MpqArchive seems to keep file handle open even when calling Close/Dispose

I have a program where I want to load a bunch of files from the main Warcraft 3 files (specifically War3Patch.mpq from version 1.27), and while I trust that no writing is happening to any files, I decided to copy War3Patch.mpq to a temporary folder and work with it from there, just to make sure ("better safe than sorry" sort of thing).
Obviously, once I'm done working with the copied file, I want to delete it, however, it seems something is left open somewhere after calling OpenFile on an MpqArchive.

This code for example:

var archive = MpqArchive.Open(filePath);
archive.Dispose();

Gives me no issues and I can immediately delete the copied file.

But this code

var archive = MpqArchive.Open(filePath);
var otherStream = archive.OpenFile(@"UI\WorldEditStrings.txt");
otherStream.Close();
archive.Dispose();

Leaves me unable to delete the file with an "UnauthorizedAccessException". (Refactoring it into an "using" statement does not change the behavior)
I realise IOException, is the exception we should be expecting if it's a stream not being closed properly, but looking at File.Delete(String) the 4 cases where UnauthorizedAccessException would be thrown does not seem to apply to my situation:
"The caller does not have the required permission."
Clearly the application must have permission otherwise I shouldn't be able to delete the file in ANY situation, nor would I expect to be able to create the file in my temporary folder in the first place. (I create the temporary folder at runtime as well, so missing permissions seems very unlikely)
"The file is an executable file that is in use." and "path is a directory."
It's not an executable nor is it a directory
(the string I'm providing to File.Delete is @".\TemporaryWorkingFolder\War3Patch.mpq")
"path specified a read-only file."
And it can't be a read only file, because again, I can delete the file just fine when I don't call OpenFile. Also checking the file in windows when the exception is thrown shows that the file is not marked read only.

To further cement this theory of mine, I downloaded Process Explorer from Sysinternals and looked for the file handle, and it is indeed still open by my application even though calling Close/Dispose should be closing that handle (or atleast I expect it to).

So I tried recompiling just the Mpq aspect of War3Net where I removed the check on _stream.Close() in

public override void Close()
{
    base.Close();
    if (_isStreamOwner)
    {
        _stream.Close();
    }
}

And just ALWAYS close it, and while that "fix" allowed me to delete the file, it also leaves me unable to close individual streams on the go until I'm completely done.
I can work with my fix, since it basically just means I only need to call dispose at the end, but I thought I'd open an issue so a potential proper fix could be looked at.

Cannot cast Char to Tileset & anything to enum really

Using custom tileset.
When loading map with Map.Open("path/to/map.w3x") it throws this error.
Everything else is fine (abil data, object data etc loads correctly).

Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.Char' to type 'War3Net.Build.Common.Tileset'.
   at War3Net.Common.EnumConvert`1.FromChar(Char value):line 110
   at War3Net.Build.Info.MapInfo.ReadFrom(BinaryReader reader)
   at War3Net.Build.Info.MapInfo..ctor(BinaryReader reader)
...

Zopfli Compression

Can you add Zopfli compression? Zopfli has better compression ratio then zlib and it can output as a deflate or a zlib format (but in this case we use zlib output format). It should be an easy job to do, since it only compresses not both compress and decompress.

Expose more should be internal API to become public

I'm currently hit the limitation of war3net on building my own w3x file. So, can you expose more of the internal API to public so that people can build their own w3x file without the need of a world editor? For now, i has created a fork with modification, maybe if i can made it work i would send you the pull request.

6109 not defined Editor Version.

While trying to open a frozen Throne Blizzard map ((4)iceforge.w3x), I am getting the following error:

System.IO.InvalidDataException: 'Value '6109' is not defined for enum of type EditorVersion.'

Reverting to version 5.4.2 fixed the error.
I am not sure if this is the right place to post it, given my limited experience with Github.

BLP files shown not as expected

I use War3Net.Drawing.Blp (and also War3Net.Common of course) to show BLP image in WPF.
It is Maive's skin from war3x.mpq/Textures/IronRaven.blp of game Warcraft III The Frozen Throne .

  • It show some thing like:
    image
  • While the expected is as below:
    IronRaven

There must be something wrong, could anybody help ?

Map.Open does not read object names or tooltips

When I use Map.Open, the resulting UnitObjectData collection does not contain the names, tooltips, models, icons, etc of my custom units. The issue extends to all object types aside from Doodad, and seems to apply to all fields in which the user can type a string.

I am able to see the issue using this code, which fails to display the mentioned fields:

      var map = Map.Open(baseMapPath);
      var unitObjectData = map.UnitObjectData;
      foreach (var newUnit in unitObjectData.NewUnits)
      foreach (var mod in newUnit.Modifications)
        Console.WriteLine(mod.Value);

I'm using the latest Warcraft 3 version. Please let me know if you need any more information.

Throwing warnings on "item with same key" instead of exception

I'm getting the following error when I try to build my map. This only happens to the Azeroth Wars map; it doesn't occur if I do the same operation on another source .w3x.

I don't doubt that the error is correct; my map data is probably broken in some respect. But I also don't have any way to fix that data, so I wonder - can this exception be changed to a warning instead of a program-stopping exception?

   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at War3Net.CodeAnalysis.Transpilers.JassToLuaTranspiler.RegisterVariableType(IVariableDeclaratorSyntax declarator, Boolean isLocalDeclaration)
   at War3Net.CodeAnalysis.Transpilers.JassToLuaTranspiler.Transpile(IVariableDeclaratorSyntax declarator, Boolean isLocalDeclaration)
   at War3Net.CodeAnalysis.Transpilers.JassToLuaTranspiler.Transpile(JassGlobalDeclarationSyntax globalDeclaration)
   at War3Net.CodeAnalysis.Transpilers.JassToLuaTranspiler.<Transpile>b__52_2(IGlobalDeclarationSyntax declaration)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at CSharpLua.LuaAst.LuaSyntaxList`1.AddRange(IEnumerable`1 collection)
   at War3Net.CodeAnalysis.Transpilers.JassToLuaTranspiler.Transpile(JassCompilationUnitSyntax compilationUnit)
   at War3Net.Build.Extensions.MapExtensions.CompileScript(Map map, Compiler compiler, MapScriptBuilder mapScriptBuilder, IEnumerable`1 luaSystemLibs, String commonJPath, String blizzardJPath)
   at War3Net.Build.Extensions.MapExtensions.CompileScript(Map map, Compiler compiler, IEnumerable`1 luaSystemLibs, String commonJPath, String blizzardJPath)
   at AzerothWarsCSharp.Launcher.Program.Build(String baseMapPath, String projectFolderPath, Boolean launch) in C:\Users\Zak\source\repos\AzerothWarsCSharpNew\src\AzerothWarsCSharp.Launcher\Program.cs:line 131
   at AzerothWarsCSharp.Launcher.Program.MakeDecision() in C:\Users\Zak\source\repos\AzerothWarsCSharpNew\src\AzerothWarsCSharp.Launcher\Program.cs:line 80
   at AzerothWarsCSharp.Launcher.Program.Main() in C:\Users\Zak\source\repos\AzerothWarsCSharpNew\src\AzerothWarsCSharp.Launcher\Program.cs:line 59

Build?

So what do i need to build War3Net?

It seems to fail (beside many other minor stuff failing to build) on building submodule CSharp.lua

2>C:\Users\Bia\Source\Repos\War3Net\submodules\CSharp.lua\CSharp.lua\XmlMetaProvider.cs(269,73,269,86): error CS0103: The name 'MetaResources' does not exist in the current context
2>Done building project "CSharp.lua.csproj" -- FAILED.

why does the submodule has to be outdated compared to CSharp.lua ?

BTW: do you have a discord? id have a few questions to ask.

Thanks

It's not very clear

Good day, the library is certainly great, but it is not clear how to use the same blp... It seems to have done everything correctly, but again does not want to open files... None at all... Please tell me if you need a code, I can provide it...

Issues on large mpq files

Problem lies here:
public const int MaxSize = 0x1 << 15;
On my particular mpq file, size is 65536, so << 16

What's the difference between Field/LevelField/ArrayLevelField?

Hi,there:
Just got a bit confused about the difference between those files ended with Field/LevelField/ArrayLevelField. I can see LevelField apparently contain more fields. My question is: how do we qualify a enum(Type in Field files) as a Field Type or a LevelField Type? I'm kind of new in War3 developing . Thanks for any reply!
Best Regards!

[Question] Is there a way to see what went wrong on build?

when compiling with my map

var buildResult = mapBuilder.Build(options, AssetsFolderPath, BaseMapPath);

error W3N1003: An exception occured when trying to parse the 'war3map.w3s' file: Exception has been thrown by the target of an invocation.

I resolved this by deleting sounds, however how can i check what went wrong?

NuGet broken version

Can't build anything since 5.0.0 (take down from nuget unless it's fixed)
MapBuilder throws a lot of nulls.
Furthermore, there are no examples and documentation anywhere for this new Builder.
Internally, code is low standard, for example opening Map through Map.Open preinits arrays with player data, forces etc.
Init modifier needs to be removed in Map class because maps might be just for editing/exploring purposes and not contain required data of forces, players, tech etc.
Right now I have to override it like so for my needs.

            map.Info.Players.Clear();
            map.Info.Players.AddRange(allplayers.ToArray());

LegacyMapBuilder onarchive event doesn't work.

MapBuilder.Build() throws null error.
Map.CompileScript() throws null error.

Some problems about MPQ Library

  1. About MPQ library unable to open the map of large size

  2. MPQ cannot analyze the imported file to make it unable to export, but can export the specified external file

increasing MpqTable.MaxSize?

Any reason this is limited to 0x1 << 16 ?
When packing a larger MPQ archive, i exceed this amount quite quickly by having a bigger HashTable.
Reading an mpq archive also reads it as int32.

Units cannot be retrieved with Csharp.template = xxx

Quite self-explanatory
image
Paladin placed in editor, his selection ID in the editor is Paladin 0007, aka Hpal_0007
In the code

/// @CSharpLua.Template = "Hpal0007"
public static unit Test_Paladin;

In-game call to display unit name generates the following lua code:

NoxRaven.Utils.DisplayMessageToEveryone(GetUnitName(Hpal0007), 100)

However, Paladin never gets written into a variable by the transpiler, the declaration of that paladin after map has been compiled is this:

u = CreateUnit(Player(0), FourCC("Hpal"), 5552.09424, 5121.24951, 214.547562)

From here obviously, I get (null) when I display unitname of Hpal0007
I have tried following CSharpLua overrides with no results

/// @CSharpLua.Template = "Hpal0007"
/// @CSharpLua.Template = "Hpal_0007"
/// @CSharpLua.Template = "gg_unit_Hpal_0007"
/// @CSharpLua.Template = "Hpal 0007"
/// @CSharpLua.Template = "gg unit Hpal 0007"

Issues with exporting to .json

I'm attempting to serialize my map into .json, and it seems to be trying to interpret a field containing the researches Copper Forged Weapon and Copper Armor Plating as an integer, which throws an InvalidOperationException. You can see this below:

image
Please let me know if this image doesn't contain the information you need and I will dig a little deeper for a proper stack trace.

Pls fix

System.Exception
HResult=0x80131500
Message=An exception occured when trying to parse the 'war3map.w3a' file: Exception has been thrown by the target of an invocation.
Source=ZombieSurvivalAlpha.Launcher

Steps to reproduce:
Create map, create custom ability, modify field(-s), save.

Latest version when it works fine 1.3.0
Version when it breaks 1.3.1
Reforged 1.32.6

also w3s, w3u

Invalid Cast Exception (Imported BLPs)

Only thing that's been added is a few BLPs for Icons currently, noticed this problem where it makes the map unable to be built through War3Net if an .imp file exists in my map source

I'm running the latest available builds from NuGet (War3Net.Build 5.5.3) alongside the CSharpLua packages, if I remove the imports file and import the files from external source and let the compiler figure out the rest it works fine, but problem is I still want to have access to this data through the Object Editor in World Editor.

I saw a similar post which mentioned a casting issue in which you said it was fixed in 5.5.4, but that version only currently exists for War3Net.Build.Core

System.InvalidCastException
  HResult=0x80004002
  Message=Unable to cast object of type 'System.Byte' to type 'War3Net.Build.Import.ImportedFileFlags'.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Runtime.CompilerServices.CastHelpers.Unbox(Void* toTypeHnd, Object obj)
   at War3Net.Common.EnumConvert`1.FromByte(Byte value, Boolean allowNoFlags)
   at War3Net.Build.Import.ImportedFiles.ReadFrom(BinaryReader reader) in /_/src/War3Net.Build.Core/Import/ImportedFiles.cs:line 37
   at War3Net.Build.Import.ImportedFiles..ctor(BinaryReader reader) in /_/src/War3Net.Build.Core/Import/ImportedFiles.cs:line 26
   at War3Net.Build.Import.MapImportedFiles..ctor(BinaryReader reader) in /_/src/War3Net.Build.Core/Import/MapImportedFiles.cs:line 28
   at War3Net.Build.Extensions.BinaryReaderExtensions.ReadMapImportedFiles(BinaryReader reader) in /_/src/War3Net.Build.Core/Extensions/BinaryReaderExtensions.cs:line 73
   at War3Net.Build.Map..ctor(String mapName, String mapFolder, MapFiles mapFiles) in /_/src/War3Net.Build.Core/Map.cs:line 135
   at War3Net.Build.Map.Open(String path, MapFiles mapFiles) in /_/src/War3Net.Build.Core/Map.cs:line 467
   at Launcher.Program.Build(Boolean launch) in D:\Development\Warcraft 3\WCSharp - Red Storm\Launcher\Program.cs:line 80
   at Launcher.Program.MakeDecision() in D:\Development\Warcraft 3\WCSharp - Red Storm\Launcher\Program.cs:line 64
   at Launcher.Program.Main() in D:\Development\Warcraft 3\WCSharp - Red Storm\Launcher\Program.cs:line 43
public static TEnum FromByte(byte value, bool allowNoFlags = true) {
	TEnum val = (TEnum)(object)value; <-- Line that's throwing a fit
	
	...
}

Cannot access a closed stream

Hi, getting this error when I try to build my map.

Unhandled exception. System.ObjectDisposedException: Cannot access a closed Stream. at System.IO.MemoryStream.Seek(Int64 offset, SeekOrigin loc) at War3Net.IO.Mpq.MpqStream.LoadSingleUnit() at War3Net.IO.Mpq.MpqStream.BufferData() at War3Net.IO.Mpq.MpqStream.ReadInternal(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BinaryReader.InternalRead(Int32 numBytes) at System.IO.BinaryReader.ReadInt32() at War3Net.Build.Info.MapInfo.ReadFrom(BinaryReader reader) at War3Net.Build.Info.MapInfo..ctor(BinaryReader reader) at War3Net.Build.Extensions.BinaryReaderExtensions.ReadMapInfo(BinaryReader reader) at War3Net.Build.Extensions.MpqArchiveBuilderExtensions.SaveWithPreArchiveData(MpqArchiveBuilder mpqArchiveBuilder, String fileName, MpqArchiveCreateOptions createOptions) at War3Net.Build.MapBuilder.Build(String path, MpqArchiveCreateOptions createOptions) at AzerothWarsCSharp.Launcher.Program.Build(String baseMapPath, String projectFolderPath, Boolean launch) in C:\Users\Zak\source\repos\AzerothWarsCSharpNew\src\AzerothWarsCSharp.Launcher\Program.cs:line 146 at AzerothWarsCSharp.Launcher.Program.MakeDecision() in C:\Users\Zak\source\repos\AzerothWarsCSharpNew\src\AzerothWarsCSharp.Launcher\Program.cs:line 83 at AzerothWarsCSharp.Launcher.Program.Main() in C:\Users\Zak\source\repos\AzerothWarsCSharpNew\src\AzerothWarsCSharp.Launcher\Program.cs:line 59

This issue is new as of 5.4.2. If I downgrade to 5.4.1 the problem goes away.

Value '3' is not defined for enum of type ObjectDataFormatVersion

Perhaps unsurprisingly, the latest WC3 update broke the tool. When I attempt to build a map that has been edited with the latest Warcraft 3 editor, I get this:

Please type the number of your desired action: 2Unhandled exception. System.IO.InvalidDataException: Value '3' is not defined for enum of type ObjectDataFormatVersion. at War3Net.Common.Extensions.BinaryReaderExtensions.ToEnum[TEnum](Int32 i) at War3Net.Build.Object.AbilityObjectData.ReadFrom(BinaryReader reader) at War3Net.Build.Object.AbilityObjectData..ctor(BinaryReader reader) at War3Net.Build.Object.MapAbilityObjectData..ctor(BinaryReader reader) at War3Net.Build.Extensions.BinaryReaderExtensions.ReadMapAbilityObjectData(BinaryReader reader) at War3Net.Build.Map..ctor(String mapName, String mapFolder, MapFiles mapFiles) at War3Net.Build.Map.Open(String path, MapFiles mapFiles) at Launcher.Program.Build(Boolean launch) in C:\Users\zakar\RiderProjects\Autobattle\Launcher\Program.cs:line 77 at Launcher.Program.MakeDecision() in C:\Users\zakar\RiderProjects\Autobattle\Launcher\Program.cs:line 58 at Launcher.Program.Main() in C:\Users\zakar\RiderProjects\Autobattle\Launcher\Program.cs:line 43

Access to compiled script before it is added to mpq

I'd like to be able to grab map script at the time when it has been compiled, but the mpq archive has not yet been built.
Right now you suggest the following code structure:

BuildResult br = mapBuilder.Build(scriptCompilerOptions, buildInfo.GetMapFolder);

if (br.Success) <.....>

I'd very much like there would be another step, so I can run lua obfuscator/minifier in this intermediate step.
For example something like

MapBuilder mapBuilder = new MapBuilder("compiled_war3map.w3x")

mapBuilder.compiledScript = NodeBridge.Providers.Execute<string>("LuaMinify", mapBuilder.compiledMapScript)

BuildResult br = mapBuilder.Build(scriptCompilerOptions, buildInfo.GetMapFolder);

if (br.Success) <.....>

Map builder broken

After updating to the latest War3Net packages my map does not build properly.

None of the 'war3mapSkin' files are present in the output archive and all custom data is reset like unit names, models, icons, gold cost, requirements, abilities, upgrades etc. etc. (all data as far as I can tell).

I'm using Map.Open(mapDir) to load the map directory from scratch and MapBuilder.Build(path) to build the MPQ archive.
There's no loss of data when saving an archive with Blizzard's editor, so it's not my map that is broken.

I'm on the latest WC3 version btw.

Is there any way to code C# to compile to jass/lua script for a war3map?

Hey there. I'm a C# programer. I'm surprised to discovery a project that I never seen before, which can use C# language to code trigger scripts for develop war3map. But I found that it's not like an offical project by blizzard, which is developing by personal developer. It's a magical project that I found. But I am heavy to starting coding, which is the problem that I don't know how to create an trigger and call functions for my idea. Is there any guide to use those Api in this project? Thinks for your reply.

Unloadable MPQ - Possibly (hash table) decryption wrong

I currently have a wow-patch.mpq which is not properly loaded.
Viewing the hash table with Ladik's MPQ Editor shows the first entry should be mostly filled with 0xff.
War3Net displays some random (mis-decrypted?) values here.
Im quite unsure why and how it happens and trying to debug that somehow.
If im able find out the cause, ill comment on this issue about what i found out.

The file itself is the wow-patch.mpq from "wow-1.12.1.5875-to-1.12.2.6005-enGB-patch.zip" also sometimes named "wow-1.12.1-to-1.12.2-enGB-patch.zip", which can be downloaded for example from here: https://www.getmangos.eu/downloads/file/64-wow-1121-to-1122-dede-engb/

1.33 maps new object data format version

Loading maps saved with the 1.33 editor (PTR) throws the following exception:

'Value '3' is not defined for enum of type ObjectDataFormatVersion.'

It looks like Blizzard updated the format version for multiple object data files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.