• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

GMSI v2.1.16

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
Introduction
This is Gex's Map Script Interpreter, an interpreter for the script language GSL (Gex's Script Language).

History
As you might know, in Castle Fight there are 10 races with over 100 buildings and over 70 units.
I was getting tired of writing the tooltips for these units. So I made a program that could resolve Object Editor data in unit tooltips.
So I could just put some keywords in the tooltip and my tool unfolded them to the actual unit values.
So I just made one generic tooltip and added it to all units.
Then I thought: Why adding the tooltip to every unit? Can't I just make my program pick every unit and inject the tooltip into it? Well I could.

Next step:
There are many values which stay the same for every building. However, when I created new buildings I often forgot to change the values to these standards, which caused strange bugs.
So I thought:
If my program already picks all buildings and injects tooltips into them, can't I make to program also be able to change the unit values to what I want. It took some time then it worked.
The next thing was:
Every building has to be inserted with some parameters into an initialization trigger. That was damn copy and paste work for new buildings and I often forgot to change the parameters to the ones of the new building, so again, it caused strange bugs. Hell, can't also do my program that for me? ...*codecode*... well, now it can do it
icon_wink.gif
.

Finally I thought: Okay, now my program can alter triggers, arbitrary object editor data, can even create new objects. Why not take the final step and let the program be able to alter EVERYTHING in the map? After around one additional month of work it is now able to alter EVERYTHING in the map. It can alter object editor data, triggers, placed units/doods, regions, general map information, even the heightmap of the map. And that is GMSI now.

So you might ask? Okay, sounds like a GUI where you can change everything in a map. But isn't that just another world editor?
And the answer is of course no. The program has no GUI (well, it has, but not for editing maps). It is just an interpreter for a script language. This script language has the tools to load and save maps and alter them.

So what does the tool do?
It is just an interpreter for the script language called GSL. Before you start screaming: "What? Yet another scriptlanguage to learn?". NO, this script language is basically C with some small changes. So if you know C or JAVA you will need less than one hour to completely understand this language.

This script language is designed for altering wc3 maps exetremely simple and fast. To convince you that it is actually really useful, let me show you a few examples of how fast it can alter big parts of the map (remember the syntax is just like JAVA/C):

Examples
PHP:
Map map = loadMap("myMap.w3x");      //Loads a map to the struct Map
map.objects.hpea.Ubertip = "test";   //sets the peasant's ("hpea") ubertip to test
saveMap(map,"myChangedMap.w3x");     //Saves the map to a file
As you can see, loading and saving a map is done in one line with the language. Doing a change is also done with one line by just accessing the members (and their submembers) of the struct Map.

Next example: altering many units using the foreach syntax lended from JAVA:
PHP:
Map map = loadMap("myMap.w3x");  //Loads a map to the struct Map
for(string s: map.objects){      //A loop iterating over the objects of the map
    if(map.objects[s].HP != null)//Test if this object has Hitpoints (i.e. if it is a unit or item)
map.objects[s].HP = 50;          //Change its HP to 50
}
saveMap(map,"myChangedMap.w3x"); //Saves the map to a file
These 4 lines of code change the hitpoints of ALL units in your map to 50.
Okay that is silly but I can think of many useful scenarios:
Think of a Towerdefense where you want to set the hitpoints of lets say 100 waves of creeps to a formula like: LEVEL²+10*LEVEL+100.
This would again be around 5-10 lines of code, you just have to filter units that are your creep waves (for example by checking if they are from a specified race), then getting their level and setting their hitpoints according to the formula.

Next example: Exchanging data between maps
PHP:
Map map = loadMap("myMap.w3x");  //Loads a map
Map map2 = loadMap("mySecondMap.w3x");
map.objects.h002 = map2.objects.h005;
saveMap(map,"myChangedMap.w3x"); //Saves the map to a file
This would take the user defined unit "h005" out of map2 and insert it with the id "h002" into the map "map".
So since we can load arbitrary many maps, we can transfer data between them as we want.

So without giving you the code for it, since you can alter anything in your map, let me think of some more examples:
-Generating random terrain by setting the heights/textures in an area and putting different doodads on it.
-Gathering information from many maps and assembling it to one map. This would be interesting for teamprojects, where one creates the triggers, the other one creates objects, the next one the landscape and so on. The script would then be a "makefile" that assembles all the data from the members to one map.
-Setting the map version / authors homepage: Maybe your map version / homepage is written in your load screen in the questlogs, somewhere in the GUI and in a welcome message. With a script you could change all these when the version/homepage changes.
-Creating beautiful generic tooltips (which the program was originally designed for)

Quick usage:
If I could convince you that this is useful indeed, and you want to try it, writing your own script then do the following:

Download the program and unzip it anywhere.
Start the GMSI.jar / GMSI.bat in the main directory.
Note that the program is written in Java, so you need an up to date JRE for it.
Choose a script and execute it.
Or write your own scripts and execute them
icon_smile.gif
.
The program contains some small scripts to show you what is possible, like a "remove unused imports" script, that checks for every import your map has, if it is referenced somewhere in your map. If it isn't then it is removed.

For a full documentation on the Syntax and all possiblities the scriptlanguage/program offers, check the online manual (the manual is also included in the program's doc folder).

This is one of the first releases, so if you find any bugs, let me know.

Links:
Download latest version


Online Manual
Support forum

Please note that I'm not the author of this program, the developer of GMSI is geX. I just help to post this powerful tool here.
Contents

GMSI v2.1.16 (Binary)

GMSI v2.1.20 (Binary)

Reviews
eejin
GMSI v2.1.20: This tool seems very useful in theory, but unfortunately I didn't get it to work. I tried removing unused imports from a map and listing function, but got a missing .dll error. After placing that DLL from a subfolder directly next to the...
I got this error when I tried to open my own map, here's the log at the point of the error:

Code:
Trying to extract war3map.wct from E:\Warcraft III 1.26 -IceBlitz\GMSI v2.1.16\temp\in\0\My map - update.w3x --> found
Evaluation Error at line 50 in file wc3MapIO.gsl:
Unknown GUI Function: "LoadIntegerBJ"
At code: native void loadTriggers(Map map);
Call stack:
called by line: 74, file: wc3MapIO.gsl, code: loadTriggers(result)
called by line: 87, file: wc3MapIO.gsl, code: loadMap(mapName,true,true,true,true,true,true,true,loadEnvironment,loadUnchangedObjects)
called by line: 97, file: wc3MapIO.gsl, code: loadMap(mapName,false,true)
called by line: 12, file: executeMap.gsl, code: loadMap(@map)
--- Execution was aborted due to an error ---
 
Level 7
Joined
Jun 5, 2018
Messages
180
I got this error when I tried to open my own map, here's the log at the point of the error:

Code:
Trying to extract war3map.wct from E:\Warcraft III 1.26 -IceBlitz\GMSI v2.1.16\temp\in\0\My map - update.w3x --> found
Evaluation Error at line 50 in file wc3MapIO.gsl:
Unknown GUI Function: "LoadIntegerBJ"
At code: native void loadTriggers(Map map);
Call stack:
called by line: 74, file: wc3MapIO.gsl, code: loadTriggers(result)
called by line: 87, file: wc3MapIO.gsl, code: loadMap(mapName,true,true,true,true,true,true,true,loadEnvironment,loadUnchangedObjects)
called by line: 97, file: wc3MapIO.gsl, code: loadMap(mapName,false,true)
called by line: 12, file: executeMap.gsl, code: loadMap(@map)
--- Execution was aborted due to an error ---
Please try the latest version that can be downloaded from the above link.
You can also get more information from the support forum.
 

eejin

Tool Moderator
Level 12
Joined
Mar 6, 2017
Messages
221
GMSI v2.1.20: This tool seems very useful in theory, but unfortunately I didn't get it to work. I tried removing unused imports from a map and listing function, but got a missing .dll error. After placing that DLL from a subfolder directly next to the .jar I got a different error. According to this thread it might be an issue having to do with it being executed in 64 bit mode instead of 32 bit.
upload_2018-6-18_0-17-56.png

I am on Java 8 Update 171.

Also please pack the program in a .zip instead of a .rar for people without an archive manager.
 
Level 12
Joined
Jan 30, 2020
Messages
875
I tried to use this tool.

I don't want to install Java RE on my laptop, but I use the portable version from PortableApps.com - Portable software for USB, portable, and cloud drives, and it has worked quite nicely so far. Unfortunately for some reasons when I try to start the execution of the .jar file, the portable version on the runtime simply closes with no warning. I tried both the 32 and 64bit versions of java.

Although I use Reforged and am unsure this tool would work with reforge, I also have an old 1.26 local installation of TFT lying around, and I wanted to extract my old map from 2004's object data, if this tool could help me do that.

But as I can't even start it, I would not know.

I don't believe old tools are obsolete, as they can still be used for those using older versions of wc3, but for once the problem here was not Reforged at all !
 
Top