W3LuaEnv: Modular Lua Scripting Without Closing WE

This bundle is marked as pending. It has not been reviewed by a staff member yet.
Hello, Warcraft III modders!

W3LuaEnv
is a free tool that enables modular programming in Lua without needing to close the World Editor. Simply select your main script (defining the project directory), and W3LuaEnv will automatically monitor changes to your code in the background, preparing the final script for integration.

By detecting require statements in your code, the tool automatically manages dependencies between modules. When you're ready to test, just press F9 in the Trigger Editor, and W3LuaEnv will export and execute the updated code in your .w3m map—no extra steps needed.

Lua:
 --main.lua
 
local mod = require('module')
 
local timer = CreateTimer()
 
TimerStart(timer, 0, false, function()
    mod.say_hello()
end)

Lua:
--module.lua
 
M = {}
 
function M.say_hello()
   print('Hello!')
end
 
return M

The require statement can be used in any module of the project, and the modules can be structured into subfolders. You can have a really complex and well-organized codebase.

The module system adheres strictly to standard Lua practices. Specifically:
  • When using require, the module can be assigned to a variable or simply executed, with the assignment being optional.
  • Requiring the same module multiple times does not trigger its re-execution, as it is loaded only once and stored in an internal cache. This allows you to reference the module anywhere in your code without overhead, since the preloaded module is returned preserving its state.
  • You can organize your code into multiple modules distributed across subfolders within your project's directory. This structure enhances code management and scalability, enabling developers to work more efficiently and maintain a clean codebase.
You can edit your modules with your favorite code editor while working with the World Editor. W3LuaEnv will run in the background, allowing for a smooth workflow.

For more details, you can visit: W3LuaEnv - Website.

I hope you find this useful, even though I know many of you prefer JASS. I welcome any suggestions and encourage you to report any errors or provide feedback.
Contents

W3LuaEnv_25.03.21 (Binary)

W3LuaEnv_Map_Example (Binary)

Top