Skip to content
Orden4 edited this page Apr 4, 2021 · 6 revisions

This is a set of libraries designed to assist in the WarCraft 3 mapmaking using C#. For actual compiling and running of a WarCraft 3 map using C#, please refer to the information found in this thread. There is also a quick setup that I use myself that you can find here.

Development

Much of the development on these libraries is currently motivated courtesy of Lord Damage, responsible for various maps such as Desert Smite, Fort Wars and Assault The Throne. The systems used to run these maps is designed by myself, while Lord Damage tends to do most of the map work.

Because of this, I expect some users to be less familiar C# and even programming in general, and try to keep this wiki and the WCSharp systems straightforward to use. Suggestions to improve the understandability are much appreciated.

How do I get started?

For mapmakers who are new to C#, this wiki provides a WCSharp template that requires minimal to no setup and comes with all WCSharp packages installed.

How do I use these libraries/packages?

If you do not have the packages installed yet, you can simply right-click your Source project, or however you named the project containing the code that Warcraft III should execute, and select "Manage NuGet packages". In here, select "Browse" and type in WCSharp to find all available WCSharp packages.

Thanks to the power of NuGet, dependencies are automatically resolved (e.g. WCSharp.SaveLoad depends on WCSharp.Sync and WCSharp.JsonConvert), meaning that you don't have to worry about that.

No further installation is required, as the systems will automatically self-initialise the moment you try to use them. The only exception to this is the dummy system, as this depends on a dummy unit being defined in your map. For more information on this, please see the WCSharp.Dummies documentation.

Aside from that, please refer to the individual wiki pages on how to use each system. In addition to the wiki pages, the systems have extensive documentation via IntelliSense within Visual Studio, allowing you to select/hover over methods, properties and even classes to learn more.

What's this about IsExportMetadata?

A few pages on this wiki have a disclaimer at the top stating that the package requires the compiler to have IsExportMetadata set to true. Enabling this setting makes the compiler output metadata information that is needed for C# Reflection features to work, which is in turn needed for things like JSON conversion to work.

Enabling this setting will increase your map size a little, but the increase in filesize is barely noticeable, so I wouldn't worry about it. Furthermore, this has no impact on the performance of your map.

You can change the IsExportMetadata setting in Launcher/Program.cs of the WCSharp template (true by default).

Versioning

As a result of WCSharp having started development at an early stage of War3Net's development, some older versions have become deprecated and unusable outside of certain War3Net versions. This section tries to shed some light on this.

  • If you're a new mapmaker, simply use the latest separate WCSharp packages, i.e. WCSharp.Buffs, WCSharp.Missiles, etc., as well as the latest War3Net version.
  • The package listed as only "WCSharp" (v1.3.6) is a deprecated all-in-one package. Although you are free to use this package, it is no longer supported and will not work with War3Net v5.x or higher.
  • If you were already using the old save system but want to switch to WCSharp 2.x, there is a WCSharp.SaveLoad v1.4.0 package that you can use to keep the old save system but upgrade other components.
  • For all updates after WCSharp v1.3.6, (including new packages), versioning starts from v2.x.
Clone this wiki locally