| 01-04-2009, 11:07 AM | #1 |
Introduction Hey folks, I want to present my latest tool GMSI to you. It is an advancement of my old tool GOSI, which I presented here, but I just earned some bad criticism. Well the old tool DID suck I admit. However, it was already mighty enough to help me greatly with making my maps. As you might remember, I am the author of the (more or less) well-known maps Castle Fight and eeve!TD. I have used GOSI for creating those maps and it freaking helped me alot. Okay, before I tell you what the program actually does, I will start with a story how the program evolved to what it is now: History As you might know, in my map 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 ;). 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 Code:
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 Code:
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 Code:
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 :). 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). Links: Download latest version Online Manual SUPPORT FORUM New stuff: The program is now at version 2.1.12. Many things have improved. It is now able to inject itself into JNGP generating a GMSI menu where you can execute the current map's script, taking and cropping a screenshot and opening a color picker. It is able to alter everything. I currently use it for my latest project YouTD. I am currently working on a picture API that allows you to open and save pictures, even in the blizzard used formats blp and tga. Thus it is possible to create and inject the loadingscreen automatically. Just load it from jpg, let the program cut it, save it als blps and import it. New loadscreen with just one click :). Try it and gimme feedback, thanks and best regards ;) |
| 01-04-2009, 01:02 PM | #2 |
Editing the .slk files manually might have been easier than writing an application. That said, this could potentially be extremely useful. And nice manual. |
| 01-04-2009, 01:15 PM | #3 |
This seems really nice but I belive that almost noone will use it since it requires the understanding of a program language that is harder then vJASS. |
| 01-04-2009, 02:17 PM | #4 | |
Quote:
well actually it is C with some syntax changes and some additions. Here in Germany even the predecessor of it (GOSI) was used since it allowed simple tooltip generation. And you don't have to understand each small part of it to be able to write basic scripts like creating nice tooltips. Maybe that manual scared you a bit. Well the Manual is really the full reference for that language, so it has to be compelete and thus big. (Vexorian's JASS Manual is also kinda big, since it is also complete, but JASS is rather simple. Manuals always get large, no matter if the language is hard to learn or not) However, 90% of the time you will only need 20% of GSL's syntax and possiblities. I will write some tutorials, that show beginners for example how to create beautiful tooltips and alter unit values without having to know all the language's syntax. |
| 01-04-2009, 03:35 PM | #5 |
Sounds nifty. Doing item and ability tooltips are no problem, it's the units. I get so much damn processing time after each change... This could solve my woes. |
| 01-04-2009, 05:34 PM | #6 | |
Quote:
it probably does indeed! Check the tooltips in my Castle Fight (get it at www.eeve.org): They contain every detail of a unit including its abilities. Time to create such a tooltip: 0.1 seconds (or probably less). Nothing done by hand, everything done by script. |
| 01-04-2009, 06:43 PM | #7 |
I tested it a bit, the manual wasn't as massive as I first thought but I'm an average C++ use (nothing GUI yet) so I already knew the syntax pretty much, but I think you should create some better examples on how to use this. I'm having problems trying to understand the Tooltip parts and then when someone that only has used JASS tries this then I belive that you will get tons of questions. Oh, I have an suggestion, add a button to "update" filelist so if you create a new script and then press that button it will add the script to the manager instead of requireing the user to restart the program. Edit - I think I found a bug, whenever I press "view source" then I opens notepad++ and views the file named "III" which is an empty file instead of opening up the real source. Edit2 - Some questions: 1. Is there anyway I can loop through the abilities? 2. How do I get the abilities a specific unit has? 3. Is there anyway I can determine if a unit is custom created? |
| 01-05-2009, 12:20 AM | #8 |
Most people here who would get the full use out of this tool already know C, so I don't think thats a problem. View Source button is broken as stated above. Filename needs to be passed inside double quotes. |
| 01-05-2009, 09:44 AM | #9 | |||||||
Quote:
Oh, how could I forget this... Okay new version was just released, which hopefully fixed that bug. Get it at the DL link above. Quote:
Quote:
Quote:
Quote:
First: Get the new version, it fixes a severe bug, my answers will not work on older versions. 1.) Sure, okay I admit that is nowhere in the Manual yet: The objects array is of type <Wc3Obj>. However the objects are not of this type but of derived ones: (Quote from the Wc3MapDefinitions.gsl:) PHP Code:
So you can get all abilities by just looping over all objects and checking wether the variable is an ability using the instanceof operator: (Note that in all my examples you have to replace "yourMap" with the name of your map struct) PHP Code:
Quote:
Oh, that is also missing in the manual^^. You can just refer to each attribute of an Object Editor Object by just writing the raw name (the one that appears when using raw values in the OE) of it. So for the abilities of a unit this would be "abilList" PHP Code:
The abilList (and all other lists the OE uses) are saved as comma separated lists and since the foreach loop syntax allows us to iterate over comma separated lists as well we can just use the list in a foreach loop to get the abilities: PHP Code:
Quote:
PHP Code:
So this loop would loop only over custom created objects: PHP Code:
|
| 01-05-2009, 01:37 PM | #10 | |
Could someone please tell me what I do wrong in this code: PHP Code:
Whenever I try to run it then I get this error: Quote:
Edit - Ah... Artificial helped me to find the error... I didn't typecast my variable to unit. |
| 01-05-2009, 01:50 PM | #11 |
I have just released the second hotfix version for today. v2.0.5 Update IMMEDIATLY if you want to use the tool it fixes a major bug, which changed the button positions of objects! In addition, I have added a new chapter to the manual: 10.) Working with Object Editor Data it explains all the questions you have asked and some more, all concerning mastering object editor values. Read it, it is informative :). |
| 01-05-2009, 01:57 PM | #12 |
Your download link is broken, I was able to download 2.0.5 by changing the URL to http://www.eeve.org/files/GMSI beta v2.0.5.rar but as it is now then it still tries to link to the 2.0.2 version. |
| 01-05-2009, 02:17 PM | #13 | |
Quote:
![]() |
| 01-05-2009, 05:49 PM | #14 |
Found another error: PHP Code:
In my test map I applied that to all units but everything ended up with German names instead of English. Edit - Lol, applied this to all units: PHP Code:
Notice - This bug does not occur on custom units. Edit2 - Am I able to extract the entire map code? Like, setting a string = war3map.j or something similar since I haven't found a way to look through GUI triggers yet as JASS code and I wants to do that. Edit3 - From where do you read the globals? My friend said the he couldn't find the globals he created through vJASS inside the maps variables part. It would be alot better if you could read all the variables from the war3map.j instead of looking through the GUI parts of the map. It would also be nice to add an option to store all "functions" that's found inside the war3map.j in an array so you can loop through them. Edit4 - I opened up my test map in MPQ Master to be sure and the GUI code is saved as JASS code in the war3map.j and so is the global variables so, it would be really nice if you could give us full access to war3map.j and maybe if you wants to code something nicer to make it easier to work with. By coding something nicer I mean like in the edit3 part of my post, an array where all the functions are stored in or something similar. |
| 01-05-2009, 08:14 PM | #15 | ||||
Quote:
Damn :/ I will add an option to resynchronize with WC3, then you can sync with your wc3 files and get the names of your language. I only have the german version :(. Quote:
I didn't read the j file, because every information provided in the j file is also provided somewhere else. You can use the export function in utilities.gsl to export the .j file, but you cannot load that file then yet. However, I am working currently on a library for external file in/output. When it is finished, I will release the next version. There you will be able to just export the .j file and then read it as a string. Quote:
The program doesn't touch trigger jass code itself yet. It just reads the whole custom text section of a trigger and dumps it out into the trigger's code string. vJass created stuff is not in there because it requires a lot more work when wanting to change it: For gui stuff, you just rewrite the trigger file. For (v)Jass stuff, you have to manually modify jass code. If for example someone wants to delete or rename the global then, the script must replace/delete the jass line. You could create such functionalities yourself, but it is really a bunch of work: How to refer with private globals? flag them. this would be hard work. to the functions: you could abuse the matcher for that stuff, like adding a macro rule to the matcher like that: PHP Code:
This should get you the function names in the array functions. I have just tested it, it works. However this one is screwed if you use function interface as the also contain these keywords. Maybe someone is able to write a library to do some stuff with functions: -get a function by its name -remove such a found function -replace the function body with a desired string Since these are only pattern matching and string replacment jobs, it should be doable using matcher.gsl and string.gsl which grant all necessary functions. Quote:
|
