Maybe I am doing things the hard way, but it works great except for compile time. Let me explain what I am doing.
I write programs with visual studio that write galaxy code. So if I want to make a huge amount of entries into the data table. I write a program that will write the custom scripts to paste into the galaxy editor custom script. Omg this already sounds convoluted but let me continue.
For example I wrote a program that makes planets and planet values randomly but realistically. All I needed was a list of planet names, and it generated all the information for the planets, as data entries into the data table. It also created a list of elements, and what elements where available on each planet. I took the complete list of star trek planets, about 1800 if I remember correctly, and generated their values. This worked great only the pasting into the galaxy editor was slow, and limited. I had to reduce how much was pasted into each custom script. I think for this routine I could only paste 300 planets at a time. When it was said and done I had fuctioning dialog for all planets, and a game with about 16,000 lines of code, one day of work. Also and here is my question, the galaxy editor would compile the code as I pasted it, and takes about 5-8+ min to compile on paste.
I completed this project by pasting and play sc2 on a different computer. It’s slow and laborious to say the least. Now I have a new thing I’m working on that has 500,000 words that are reduced to list limited to strings of 2000 character. I am finding that I can only paste 30 groups of 2000 character strings into a custom script at a time, and then I wait for the compile.
“Is there a way to stop the sc2 galaxy editor from compiling? Or even stop it temporally, and then compile it after I have done all my pasting?”
Thanks in advance. And I am interested in joining a group if they have needs for large data pre processing. And have the means to put their good idea forward.
Unfortunately I don't know of a reliable and easy way to circumvent that. The only thing I know of is to open the map in a MPQ Editor and directly insert the code into the mapscript.galaxy.
But I think as soon as you open the map in the editor again, it'll cause troubles with the trigger information and it'll get deleted ..
The best way I've found to get around this is to put all of your stuff in a .galaxy file and import it into your map. You'll need to get it included in your main mapscript.galaxy file somehow though - you could probably do this with a custom script in the GUI editor if you are still using triggers for other things as well. This way you get around that very slow line by line checking that happens when you paste.
I have attached an example of my successful proof of concept.
I took a little different approach with the same result minus the compile time. I first created the custom script I wanted, manually in a library. Then exported it, and viewed it in note pad. I was delighted to see it was an export in the format of XML, a very readable language. So I tried pasting more than one line of custom script, aka more string entrees into the data table. I was successful, and attached that file to my original post for others to view.
Some critical notes:
Blizzard has written their own xml file parser. They are not reading in the data flat, some consideration has to be taken for this fact. I found that for some reason, they don’t read between <><> and take it as is. So in order to get everything to come in nice, you need to make sure everything lines up. That means any tabs or spaces before your script need to be repeated for each line of script. Otherwise it will cut off the beginning of your script. This is very poor programming on their behave. Only dealing with their own internal ideal situation is sloppy, and “hard coded”. A better approach with XML, and I’ve learned the hard way too. Ignore spaces and tabs, and read the data in as blocks of stream.
Anyways, Thanks for the help, it made me look deeper cause I at first thought I was missing something. So now I have shifted my approach into having my programs write library files for import. This is actually a lot better now.
I have been reaching all kinds of upper limits now that I have things working. First I had to change my method from inserting library custom scripts to triggers that contain custom scripts. This works perfectly now, as I get a functioning trigger, and it enters a mass amount of strings into the data tables.
I am trying to get the whole English language (British, Canadian, and American) into the data string tables. I am limited to string length of about 300 before it gets truncated based on trigger groups of 500. So I add limit to 285, and add spaces between words. I name the data table entries as A1, A2, A3…B1, B2, B3, and I intend to use “Word of String” in order to find if the word is located in the specific data table. The English language is huge, a little under 500,000 words.
Everything imports fine. But now I am getting an error message that the web, and this site has no history of. When saving I get “Insufficient Buffer size” the crash is around the Letter “T” entries, 85% done. So what are we saying? Galaxy Language can’t handle English?
I am now forced, and looking at adding compression to my Strings. Something I wanted to avoid all together due to performance, and script handling.
Anyways, I am thinking about a lot of ideas based on my English Data Table Map. I might tackle making Scrabble Wars. But I don’t think you can fit “pneumonoultramicroscopicsilicovolcanoconiosiss” on the Scrabble board. Oh well, I still want the English language to be complete. So string compression here I come!
Ha-ha if you’re wondering…
Pneumonoultramicroscopicsilicovolcanoconiosis is, according to the Oxford English Dictionary, "a factitious word alleged to mean 'a lung disease caused by the inhalation of very fine silica dust, causing inflammation in the lungs.'" A condition meeting the word's definition is normally called silicosis.
“Kind of funny I found this. I added a few lines of code to find the biggest word in my dictionary file. And that word showed up, also it seems MS Office can’t spell it right. (Pneumonoultramicroscopicsilicovolcanokoniosis)”.
It occurs chiefly as an instance of a very long word. The 45-letter word was coined to serve as the longest English word and is the longest word ever to appear in an English language dictionary. It is listed in the current edition of several dictionaries.
Well I am very disappointed to say the least. I managed to get my compression ratio down to about 50%, and that’s pretty good when you are not working with bytes, and you plan on using galaxy to decompress. Anyways, the error message that the buffer it too small to save, even though the whole library loaded is not the end of problems. After refining my compression so tight, I found a new limitation, too much script. So I have to now scrap my idea of an English dictionary in SC2 map. Everything is not a loss though. It was a good exercise on seeing how I can get large amount of code into the data tables, pre-processed information.
It has me thinking about a lot of different topic. For instance, pre-calculated first and third person games, with zero lag issues. Even simple games like Tetris could be made by pre calculating the possibilities. It’s a bad example maybe because you can code it, but for say visualizing.
I've been trying to find a galaxy environment template for visual studio all morning, sort of for this purpose.
It seems a lot of people on this site claim to be using .NET to generate code, when all they do though is have it create their data.
Perhaps look into T4 Text Templates. I think for your example, you can even skip making runtime, but one could actually make an app that fills in the code as the user enters it. If you google T4 templates there is tons of info.
I will probably be working on a generic template, as everything seems to be copy-paste or a separate editor.
an example from your file: lib.SC2lib
this one is done using visualBasic, and won't run out of box or anything. Plus i'm just recently learning of templates.
DataTableSetString(true, "A<#= number #>", "<#wordData(number-1)#>);
that would be entire file, if not less, before you put data into it.
then just a template.transform() from your app once you get variables set, like GalaxyHeader, and your words into list.
After transform you end up with same output you had, but this is cleaner beforehand, and can easily be setup for you to
edit data beforehand (and no copy pasting). The biggest deal is you just use same template over and over, if done correctly (replace 20 with variable),
A few more tweaks, and you have a 20line file or so that can chug out galaxy libs that declare any number of variables of the type of your choosing, filling them with any data that visual studio has access to.
I'm just now learning this stuff though, but I'm very suprised it hasn't been done.
I think a well done template can basically turn any Visual Studio app solution into a custom made editor,
and I believe same is true for python (i believe they use templates as well).