• Are you planning to upload your awesome tool to Hive? Please review the rules here.
    July 9, 2018: The rules for the Tool Section have been revised. Please be sure to read the revisions.

W3MS - MoonScript Development in Warcraft III

This bundle is marked as pending. It has not been reviewed by a staff member yet.
logo.png
W3MS is a Python script that enables you to do MoonScript development for Warcraft III in Sublime Text.

Requirements

  • Windows 10 64-bit
  • Python 3
  • Sublime Text 3
  • Warcraft III

Features


07dad3267dea37af77e986feee38ba74.gif

Showcasing completions.

Completions are invoked by pressing Tab while having selected the desired completion from the completion list. You can jump between function parameters with Tab and Shift+Tab.

2672452432a6dc9702dc4bac8beaf081.png

Accessing MoonScript from Lua.

You can access MoonScript modules from within your Lua code. This is enabled by `require` function, as demonstrated above.

222ab267b146a247a590c06a895985a2.gif

Upon error, the client is closed and relevant code line is highlighted.

W3MS will watch `Documents\Warcraft III\CustomMapData` for an error file that's dumped by the code in case of a failed `pcall`. In such event, Warcraft III is closed and Sublime Text will open war3map.lua at the failed line.

Installation & usage
  1. Make sure you have up-to-date Warcraft III, Python 3 and Sublime Text 3 installations.
  2. Run the .py file; post any errors you get here.
  3. Have a project folder inside which resides exactly one .w3x scenario folder open in Sublime Text.
    • Building: Select W3MS from `Tools/Build System`. Press Ctrl+B. Post any errors you get here.
    • Syntax recognition: Save your files with .moon extension. Click the syntax label at bottom-right corner. Select MoonScript from `Open all with current extension as...`.
Contents

W3MS - MoonScript Development in Warcraft III (Binary)

Level 4
Joined
Oct 22, 2019
Messages
32
Update:
  • More code parameter wrappers for catching Lua errors.
  • Lua files from the project directory are also imported.
  • Module initializer is now invoked on `__call`s as well.
Here's a knockback function I did:
upload_2019-11-8_21-51-23.png
e9778e878a90a1d5729389ba394c7b8c.gif

Update 11.11.2019:
  • Every module is now initialized before a call to `InitGlobals`.
 
Last edited:
Level 4
Joined
Oct 22, 2019
Messages
32
In case someone wants to work with Reforged, an additional -launch flag is required, otherwise it brings you to the Battle.net app.
Press Win+R, type: notepad "%APPDATA%\Sublime Text 3\Packages\User\W3MSBuild.py"
Change line 60 to: U=E.Popen([C.w3app,'-launch','-loadfile',N])
 
Level 4
Joined
Oct 22, 2019
Messages
32
I've been working on an update for this for roughly a month now. One can (hopefully, and at their own discretion) install it already from the repo by cd'ing to the project root and running `python setup.py install`. You need Visual C++ build tools and 64-bit Win10.
The version here doesn't mandate using `require` for importing modules, and also initializes every module by default. This is no longer the case with the new version.
It still integrates to Sublime Text which is admittedly suboptimal, so I'll look into migrating over to VS Code.
upload_2020-9-14_1-10-6.png Object editing: `python -m w3ms build -x ...`
Note that it'll overwrite/remove any existing W3U, W3T, W3B, W3D, W3A, W3H, W3Q files in the map dir. I'll look into changing this behavior.

upload_2020-9-14_1-32-30.png
Unit tests: python -m w3ms test <files...>
 
Top