1. 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.
    Dismiss Notice
  2. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  3. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  4. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  5. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  6. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  7. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

W3MS - MoonScript Development in Warcraft III

Submitted by kovadarra
This bundle is marked as pending. It has not been reviewed by a staff member yet.
[​IMG]
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


[​IMG]
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.

[​IMG]
Accessing MoonScript from Lua.

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

[​IMG]
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)

  1. kovadarra

    kovadarra

    Joined:
    Oct 22, 2019
    Messages:
    18
    Resources:
    0
    Resources:
    0
    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 [​IMG]


    Update 11.11.2019:
    • Every module is now initialized before a call to `InitGlobals`.
     
    Last edited: Nov 11, 2019
  2. yxq1122

    yxq1122

    Joined:
    Jun 5, 2018
    Messages:
    147
    Resources:
    0
    Resources:
    0
    Awesome tool for developing lua maps with python. Good job!

    I’m just wondering why the Sublime text 3 installation is mandatory. Why not notepad++ or vs code?
     
  3. kovadarra

    kovadarra

    Joined:
    Oct 22, 2019
    Messages:
    18
    Resources:
    0
    Resources:
    0
    Thanks!

    At extras & addons on the MoonScript page it's only advertising Vim and ST support. Perhaps there exist third party solutions, but I didn't feel like looking around for working ones.
     
  4. feber13

    feber13

    Joined:
    Nov 23, 2017
    Messages:
    22
    Resources:
    0
    Resources:
    0
    very good tool
     
  5. kovadarra

    kovadarra

    Joined:
    Oct 22, 2019
    Messages:
    18
    Resources:
    0
    Resources:
    0
    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])
     
  6. kovadarra

    kovadarra

    Joined:
    Oct 22, 2019
    Messages:
    18
    Resources:
    0
    Resources:
    0
    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...>