A Warcraft 3 map project template using Lua scripting language that allows code splitting and editing code while the World Editor is open. Powered by Node.js.
- Bundling and code splitting (via Luabundle)
- File watcher (via nodemon)
- Bundle contents of the
src/
(andlib/
for external libraries like damage-engine.lua) folder and inject them in themap.w3x/war3map.lua
file - Code minification using Luamin
- Bundle file size check (warning if > 100KB)
- Install Node.js
- Clone or download this repository, or click [https://github.com/rodolfoThePig/war3-lua-seed/generate](Use Template)
- run
npm install
inside the directory - Put your map in
map.w3x/
directory (already comes with an example map)
- run
npm start
to bundle and watch for changes - run
npm run bundle
to bundle only
- run
npm run bundle.prod
to watch for changes with minification enabled - run
npm run watch.prod
to watch for changes with minification enabled
- Map bundle injection or loading may fail if:
- Run Map immediatly after save: World Editor saving takes a small amount of time, and change detection / bundling also has a small execution time. So if you test the map before bundling is done it won't work. Wait a few seconds after save or wait for the
bundling complete
message in the console - TestMap used istead of
map.w3x/
: Unsaved changes in the World Editor cause it to create and run a temporary map TestMap. Since the path to TestMap is not known, it's not injected with lua bundle. Workaround: If you change anything in the World Editor (an asterisk appears on the World Editor window labelmap.w3x*
), then you need to first SAVE in the editor and wait for change detection + compilation (~ 1 second) before clicking Test Map - Map save detection fails: watcher not runnig / watcher didn't wait before map save was complete (thus bundle was overwritten)
- Write was denied:
map.w3x/war3map.lua
file is in use by another process or has read only permissions
- Run Map immediatly after save: World Editor saving takes a small amount of time, and change detection / bundling also has a small execution time. So if you test the map before bundling is done it won't work. Wait a few seconds after save or wait for the
- Files not required by the
src/main.lua
(__root
) module or it's submodules are not included in the bundle, thus not acessible anywhere (including external libs atlib/
)
- Map source backup option
- Use lua Global Initialization instead of hooks
.env
or equivalent- Fix TestMap TempFolder caveat
- Make it easier to include external Lua libraries
- Typescript to Lua
- Make into npm package
- Make into npm package
Createrelease
mode that minifies the map completely (smaller) but is irreversible, and should instead create a new file in a/dist
folder or create a backup file
MIT