WC3 Modding Information Center

Warcraft (WC3) Modding => Warcraft III Resources => WC3 Editing Tools => Topic started by: WC3Mod on May 17, 2016, 10:20:13 PM


Average Score - 5 / 5

« Created: January 24, 2017, 02:39:15 AM by huntress_88 »

Average Score - 5 / 5

« Created: May 17, 2016, 10:25:56 PM by moyack »
Title: SharpCraft, a managed replacement for Reinventing the Craft
Post by: WC3Mod on May 17, 2016, 10:20:13 PM
Keywords: sharpcraft, custom natives, jass
Operating System (OS):
  • Windows XP
  • Windows Vista
  • Windows 7
  • Windows 8
  • Windows 10
Tool Category: Jass Scripting, Specific WE Module as a Standalone App, World Editor (WE) Add on or plugin
Rating: 5
Warcraft III Tool resource
Some of you might have heard about Reinventing the Craft. It's an old project I initially started in 2007 and worked extensively on for several years along with SFilip. Reinventing the Craft changed goals several times, but in the end, the idea was that we wanted to provide a stable API for extending Warcraft III with new natives and features. Sadly, due to limited coding experience and time, the project ended up collecting dust.

Since we stopped working on it, I've been contacted several times by people asking for the source, but I was reluctant to release because of the mess it was and all the experimental features it had. On top of that, it was nearly impossible to maintain if an update were released.

This got me to slowly work on a replacement. The new goal for the replacement was that it should be easier to use and it should prioritize maintainability in favor of features, and above all, it should be open source. Over the past few years I've worked on and off on project SharpCraft.

SharpCraft is written from scratch in C# and using EasyHook to inject into Warcraft III, I'm able to do what Reinventing the Craft did. Likewise as Reinventing the Craft only worked with Windows, so does SharpCraft. If enough interest is shown in the future, I might be able to look into how to make a version for Mac. For the time being, the whole project relies heavily on Windows APIs though.

I've finally reached a point where I feel confident in calling it usable and as such, I wanted to announce it.

 * Updated for 1.27a.

 * Added support for placing SharpCraft in a Warcraft III folder. It'll search the parent folder for war3.exe and use that if possible.
 * Changed the plugin system a bit again. Sorry. <3

 * Fixed .zip reading error.

Everything is back to basics. SharpCraft now only has the core plugin functionality. All the advanced features will come as separate plugins.

 * Expanded the managed JASS type wrappers.
 * Implemented script-side events (issue #4)
 * Implemented new method for calling natives with strings, resulting in more speed, since we're avoiding conversion.
 * Implemented a better method for adding trigger actions.
 * Implemented a few more Jass types.
 * Minor improvement for the InternalNatives.JassStringHandleToString if check.
 * Added missing DelegateAction type.
 * Included commit number in the version number.
 * Fixed a bug with returned JassStrings when calling natives directly.

 * Giant refactor. Too many changes to list them all.
 * Added three new base classes for scripting.
 * * FullPluginBase; // This class is for plugins that need full access, which means file writing and more.
 * * SafePluginBase; // This class is for plugins that only need safe access.
 * * MapScriptBase;  // This class is for internal war3map.cs scripts. It is similar to SafePluginBase.
 * The sandbox milestone reached 100%, meaning more safety.
 * Interplugin usage it possible through simple dependency.

 * Fixed type return bug in CDestructable, CItem and CUnit.

 * Fixed a directory launcher issue.
 * Fixed version reporting.
 * Added several unmanaged classes to tinker with at your own risk.
 * Improved launcher error reporting.

 * Refactored the API. It will be backwards compatible until v2.
 * Added Input API for detecting keyboard and mouse input.
 * Added Interface API for detecting FPS and writing messages.
 * Added events for initializing systems that needs the JASS virtual machine ready.
 * Improved on various Jass types.
 * Improved on core functionality.

 * Improved the missing assembly loader.
 * Added casting from Int32 to JassUnitId.
 * Fixed WarcraftIII.IsMouseOverUI inverted return values.

 * Fixed issue with inferring return types of natives.

 * Fixed an issue with multiple plugins.
 * Fixed an issue with loading Lidgren.Network.

 * Added Lidgren networking support.

 * First stable release

 * Initial prerelease

The tutorials assume a basic understanding of programming.
SharpCraft Development Environment (basic) (), shows how to setup Visual Studio and use SharpCraft.
SharpCraft Native Tutorial (
), shows how to add custom natives using the JassAPI plugin. This assumes you've followed the tutorial above.

SharpCraft binaries and source can be found on GitHub (