CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5
WCSharp template
If you're totally new to mapmaking in C#, you'll need to download and install Visual Studio 2022 first. You can simply download the Community version.
If you already have Visual Studio installed, note that WCSharp is built for .NET 6 and requires v17.0 or higher.
When installing visual studio, select the following workloads:
- Desktop & Mobile > .NET Desktop development
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 dummy unit type that is required by WCSharp.Dummies.
If you are not interested in some or all of the WCSharp packages, the fastest way to remove them is by simplying opening the Source/Source.csproj
file and removing all the lines along the lines of <PackageReference Include="WCSharp.Buffs" Version="x.y.z" />
. Alternatively, use the NuGet Package Manager described in the below "Updating" section. Do NOT remove War3Api.
Before launching the project, ensure that the Warcraft III executable path is correctly defined in Launcher/app.config
. Aside from that, this map template should work out-of-the-box. All you need to do after opening it up in Visual Studio is right click on the "Launcher" project, select "Set as Startup Project", and execute the project (F5).
Here are a number of other useful features contained in the map template:
- The Source project contains imports for War3Api and all WCSharp packages. The Launcher project contains an import for WCSharp.ConstantGenerator.
- A .gitignore file for source control.
- The Launcher project contains an app.config file which contains a "wc3exe" key that you should configure to lead to your Warcraft III executable. The .gitignore file is set to ignore this file, allowing every person working on your map to define their own app.config file and set their own executable location.
- The Source project contains 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. Follow the link for more details.
- Has the IsExportMetadata property of the compiler set to true so that WCSharp.DateTime, WCSharp.JsonConvert, WCSharp.SaveLoad and WCSharp.Sync will work. If you are not interested in any of these packages, you can set this to false to slightly reduce your map size and startup time.
Before using the WCSharp template, I always recommend checking for updates, as the package references in the template are not guaranteed to be the most up to date. To do so, right click on either the "Launcher" or "Source" project and select "Manage NuGet Packages" to open the NuGet Package Manager. From here you can manage the packages that your project uses, including updating or uninstalling them.
The WCSharp template comes with an empty map already, but in case you want to set up a new one, the process is quick:
- Open the WCSharp template map. You can open it by simply dragging the source.w3x folder onto the Warcraft III Editor.
- Go to the unit editor and copy the Dummy unit
- Create a new map as you like and paste the Dummy unit into it
- Go to Scenario > Map Options and set Script Language to Lua.
- Save the map as Warcraft III Scenario Folder - Expansion
March 1, 2024
- Upgraded to use WCSharp.Api instead of War3Api.
- Updated dependencies.
September 24, 2023
- Removed the mostly useless Assets folder/functionality.
- Updated dependencies.
December 31, 2022
- Updated dependencies to fix an error with how interpolated strings were being decompiled. See this issue for more information.
December 23, 2022
- Upgraded to .NET 6
- Updated dependencies
April 7, 2021
- Fixed an issue where not all imports were being included
- Updated dependencies
- Home
- WCSharp template
- Release notes
- Desyncs
- Upgrading to War3Net v5.x
- WCSharp.Api
- WCSharp.Buffs
- WCSharp.ConstantGenerator
- WCSharp.DateTime
- WCSharp.Dummies
- WCSharp.Effects
- WCSharp.Events
- WCSharp.JsonConvert
- WCSharp.Knockbacks
- WCSharp.Lightnings
- WCSharp.Missiles
- WCSharp.SaveLoad v1.x
- WCSharp.SaveLoad v2.x
- WCSharp.Shared
- WCSharp.Sync
- WCSharp.W3MMD