This utility allows you to generate a .wgc (Warcraft 3 Game Configuration) file according to your settings and launch the game to test a map.
WorldEditor used this only to test AI scripts (in the AI editor) and had a limitation of only allowing melee maps. Annoyingly, this entire functionality seems broken in Reforged (as of 1.32.10).
Features:
set any gamespeed (beyond 25x)
test map in a single click (don't need to launch WE or game manually)
it works (Reforged doesn't)
launch any map, customs too (WE required melee maps only)
test map can be in any directory (WC3 required maps to be in a local path)
Classic and Reforged support
highly configurable, you can set:
player slot, team, race, color, handicap, AI difficulty and AI script path
custom WC3 path
custom game arguments (e.g. -windowed, you can't do this in WE)
enable/disable FoW and win/lose conditions
gamespeed
Usage:
Note: Windows can use backslahes and forward slashes in paths: C:\folder\ is same as C:/folder/. I recommend to always use C:/folder/ to avoid unexpected backslash interpretations and errors.
--gameroot <full path to wc3 root folder>
C:/folder/Warcraft III Reforged/_retail_/ or C:/folder/Warcraft III Classic/
--gameexe <full path to game .exe>
C:/folder/Warcraft III Reforged/_retail_/x86_64/Warcraft III.exe or C:/folder/Warcraft III Classic/War3.exe
--map <path to test map>
--gameargs <custom launch paramters>
Reforged requires -launch to start the game.
--gamespeed <0-n>
Default speed is 1 for 100% speed.
--disable-victory / --enable-victory
Victory conditions enabled by default.
--disable-fow / --enable-fow
Fog of War is enabled by defualt.
--slot <slot config> (repeated x times for players)
This can be repeated any number of times to setup all testing slots. --slot has the following structure:
SlotNUM: 0-11 / 0-23 (Classic/Reforged), 0="red" player
TeamNUM: 0-n
Race NAME:
human
orc
nightelf
undead
random
ColorNUM: 0-11 / 0-23 (Classic/Reforged), 0=red
HealthNUM: 50-100 (handicap, 50 means player's units have 50% hp)
SLOT_TYPE:
human (you as a player)
observer (you as an observer)
aiNUM (default AI player with NUM difficulty)
customaiNUM,scriptpath (custom AI player with NUM difficulty and full OS path to script)
AI difficulty: 0 = easy, 1 = medium, 2 = hard
Note: This script does not strictly check configuration here. You can practically enter any values for testing WC3 or whatever. Totally invalid values will cause the map to not run.
Development only:
--print
Requires a table.serialize(strTableName, tabl) implementation. It is loaded via table.serialize = require("serialize")
--wgc <path to wgc>
Together with --print it'll be used to print .wgc contents to console STDOUT. Otherwise this will be used as path to generate a new .wgc file.
Examples:
OSX / Linux / *nix
For Shell (Bash) create a text file start-map.sh with the following contents:
Lua 5.3 or higher must be installed. It is included for Windows users.
This tool must be able to write to folder <game root folder>/map-wgc-test/ and create new files in there.
You can run as administrator or create this folder yourself with appropriate permissions. Alternatively you can symlink this folder to somewhere else. This is a WC3 limitation.
Thank you very much for the tool! I am trying to create an AI of a custom race and this will be very useful, unfortunately I have not been able to run custom scripts (I tried a simple human script).
Do you have any idea what it could be? I made prints in Lua and I see that the path is working correctly :/
When I run the .ia script directly on the map it works fine, but as it is it works fine, I can test my scripts much faster, thank you very much!
@Cassers do I understand correctly the Lua AI is loaded because the print works?
I don't remember testing the AI much. I don't know if the errors in code will appear in the game's log file too (it's somewhere in Documents/Warcraft 3 folder) because you must make sure it's not erroring. Assert or pcall then print when it catches an error.
Whether or not the game loads the AI code at all: I had used Process Monitor to see if the game was loading the correct path from disk. That's because even with Reforged it only accepted local paths (current working dir of the war3 process) because they didn't update this part of the code.
@Cassers do I understand correctly the Lua AI is loaded because the print works?
I don't remember testing the AI much. I don't know if the errors in code will appear in the game's log file too (it's somewhere in Documents/Warcraft 3 folder) because you must make sure it's not erroring. Assert or pcall then print when it catches an error.
Whether or not the game loads the AI code at all: I had used Process Monitor to see if the game was loading the correct path from disk. That's because even with Reforged it only accepted local paths (current working dir of the war3 process) because they didn't update this part of the code.
:O Thank you very much for your quick response, I had not tried putting the tool inside the game folder, but when I tried it it didn't work either.
I leave a link with the files that I am using to test the bat and the AI, I also leave a map that I used to verify that the script was working well.
As such, the game opens and can be observed correctly, and if I open a custom map I can test the custom AIs that I have initialized with triggers, but I cannot run a script that I pass as a parameter (this would save a lot of time when testing changes in the .ia scripts).
The files are for version 1.27.1.7085, in reforged it doesn't work, right?
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
PD: I am not familiar with the Warcraft III error logs, I checked the C:\Users\S9Ser\OneDrive\Documents\Warcraft III\Errors folder and it is empty.
Hello, thank you for developing this useful mod. Unfortunately it's not working on 1.31 for me even on blizzard maps . It just shows the main menu background with no menu and it gets stuck there . On some maps it shows "Game Over" immediately as soon as you enter the game for some reason . If you could check this out I would appreciate it , it's very useful to speed up the environment since I'm training AI bots using Warcraft 3 .
@Luashine Not really working even with the slots I have tried missing around with the slots. Actually on older versions it worked without using the slots arguments for some reason. Not sure what's with version 1.31.1 . The problem is the I/O library that's written by someone else works only on this version along with an another script that I wrote . Any ideas?
human and observer don't take a number argument. Both human and observer ARE YOU. Only use them once. Human if you want to play, Observer if you want to watch.
replace human1 -> human
replace observer -> ai1
and try again.
This is a very low level utility, WGC wasn't updated for Reforged. It doesn't surprise me the game might have behaved differently.
PS: I had made a mistake. I should've made this tool as a JSON<->WGC converter then you'd just need to update a lobby definition in a text editor.
I don't think the issue is with your script . I tried doing AI tests using the GUI and it shows the same result! I even upgraded to the reforge client but no luck. Do you happen to have a link for a working client? I think this is client related .
@jameeldark2012 found it. The tool will need an udpate after someone (me? not me?) finds the patch that changed the behavior. It has to launch the game version with the path it understands. The workaround works for the 1.31.1 version from Hive.
I recreated the problem and found a fix.
Full .bat file used to create the WGC using my tool. BUT! It will launch 1.31.1 (and some other versions incorrectly) because it gives a RELATIVE PATH to -loadfile:
Pre-Reforged & Reforged: EXPECT FULL PATH IN -LOADFILE
Classic: EXPECT RELATIVE PATH IN -LOADFILE
Workaround:
1. Use my tool once to create the WGC and copy the map file
2. Close the game using ALT+F4 (only shows main menu background)
3. Copy the output of the tool where it shows you the full command line
4. Change the path in -loadfile "..." to be an absolute path.
How I found it: By inspecting the game log and trying a couple times under ProcessMonitor to see which paths the game looks for. Confusingly in this case it did find the .wgc file and read it fully without complaining about anything else. By trial-and-error I noticed the relative path inside -loadfile and changed it to the full path.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.