Skip to content
Orden4 edited this page Mar 31, 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 on the wiki.

In order to use these systems, simply add the WCSharp NuGet package(s) via Visual Studio.

Development

Much of the development on these libraries is currently motivated courtesy of Lord Damage, responsible for various maps such as Desert Smite and Fort Wars. 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 the systems straightforward to use. Suggestions to improve the understandability are much appreciation.

Additionally, a tip for those working with this library, is to go to Tools > Options > Text Editor > C# > Advanced. Scroll down to the bottom, and for When generating properties: select prefer auto properties. This simplifies the process of implementing the abstracts when using the missile and buff systems.

General information

Except for the dummy and save/load system, all systems provided in WCSharp do not require initialisation. They will self-initialise the moment you try to use them. Additionally, these systems only need to be initialised if you actually use them. If you do not, you do not need to do anything whatsoever. If you do, however:

  • For the dummy system, it is only required to create the dummy unit type in your map.
  • For the save/load system, some data is required in order to store the save files. Please refer to the save/load system page.

Map template

A map template is available for download here. This template comes with a Launcher project that will compile your map, a Source project that you can add your map code to, and a default WarCraft III map file containing only the required dummy unit type.

This map template is good-to-go as packaged. All you need to do after opening it up in Visual Studio is right click on the "Launcher" project and choose "Set as Startup Project", then execute the project (F5).

Here are a number of other useful features contained in the map template:

  • An import of the NuGet package of WCSharp, WCSharp.ConstantGenerator and War3Api. I recommend checking for updates first.
  • A .gitignore file for source control
  • The Launcher project contains an app.config file which contains a "wc3exe" key that must lead to your WC3 exe. This app.config file is not included in source control, and every person working on your map will therefore be able to easily set their own exe location.
  • A reference to war3map.lua in case you want to inspect the transpiled code.
  • Upon starting the Launcher, you'll be provided with a few options. One of these is to generate constants. This is done via the WCSharp.ConstantGenerator package. Choosing this option will cause it to read a number of files and generate appropriate constant files. Currently, the following are implemented:
    • Regions.cs - which will create WCSharp Rectangle objects corresponding to the regions defined on your map. The Rectangle class has several methods and properties to simplify working with the regions.
    • Cameras.cs - which will create camerasetup objects corresponding to the cameras defined on your map.
    • Constants.cs - which will define constant integers for all of the custom units/spells, etc. (everything in the object editor) that you have added to your map. NOTE: the name must be different from the base object in order to detect it. If you want to use the original name of the object, please add or modify the editor suffix.
Clone this wiki locally