Some years ago I published a map to Battle.net using the GAx3 dependency. Now that dependency is no longer available. However, some game patches have caused bugs in my map, which I would like to fix.
This means I need to re-create all the functionality that I was using from GAx3 for myself. I was wondering if anyone knows how I can obtain the galaxy code for the functions defined in GAx3, perhaps by extracting something from the GAx3.SC2Mod file, which I was able to find on this site and open with Ladik's MPQ editor. I looked around for the code there, but it seems it may be saved in an XML format instead, or somewhere else. I'm not exactly sure where it is. If anyone could point me in the right direction, that would be great.
Is the file named "Triggers" (no extension) just an XML encoding of the source code? Perhaps I should attempt to decode that and then I would be able to recreate the functions I need.
Edit: I've looked a bit more into the Triggers XML file, I think it's just declaring all the functions and parameters, but not defining them. So where is the source code?
Triggers file defines all the elements which are present in Triggers component of the Editor, and as such it is file exclusive to the editor, it is ignored by the game if present - the process of generating Galaxy code is done by editor.
What you probably did, thus I'm kind of confused why you're saying it has no *.galaxy file included. Perhaps you were looking in root directory for MapScript.galaxy? In case of libraries the file is put into Base.SC2Data subdirectory, i.e. Base.SC2Data/LibGAx3.galaxy.
Keep in mind that the version of GAx3 linked above is very old and likely not up to date.
But most importantly, GAx3 is still up on Battle.net:
There are some copies, but always look for the one from the author itself - Renee.
It was even updated this month, what indicates any bugs introduced by recent SC2 patches were addressed.
You probably just need to link it again into your map.
Oh wow! Thanks Talv. I tried various options on that pulldown menu and couldn't find it, but I didn't try "Map/Mod Name" for some reason.
If that's really the library source, is it being obfuscated in a sneaky way? I read through that file pretty carefully before, it looks something like this for me:
// Custom Script: Custom Script //-------------------------------------------------------------------------------------------------- include "TriggerLibs/GAx3"
There's another Galaxy file, where all the functions are actually declared.
It's because author coded it all by hand, and in Triggers there are just metadata definitions of these functions - pretty much like you've said. So they can be accessed from the GUI. But actual function declarations are in this custom file.
Oh dear me, I thought I had checked both files... Aieee
Ahah! Now I see the issue. I really hoped I wasn't that stupid... The first line of that file is hiding almost all the function definitions. At least on my system (Windows 10, Notepad++), line 1 is 18K+ characteres long. I scrolled right past all the important code.
Yeah, this file was mostly stripped from newlines.. and whitespaces in general. I don't know why he did that.
Anyway, I guess you don't really need to modify it, since you can just re-link the dependency that's still up on bnet, right? If no, I could fix the file for you (in the past I wrote some scripts for cases like this).
Thanks for all your help, I already wrote a quick script to clean up that file. (Of course I can re-link the GAx3 on Battle.net, this is more for educational purposes.)
input_filename = 'GAx3.Galaxy'
output_filename = 'GAx3_formatted.Galaxy'
TAB = '\t'
indent_level = 0
line_buffer = ''
with open(input_filename, 'r') as fin:
with open(output_filename, 'w') as fout:
for line in fin:
for c in line:
if line_buffer == '':
if c.strip() == '':
continue
else:
line_buffer += TAB*indent_level
if c == ';':
line_buffer += c
fout.write(line_buffer + '\n')
line_buffer = ''
elif c == '{':
line_buffer += c
fout.write(line_buffer + '\n')
line_buffer = ''
indent_level += 1
elif c == '}':
indent_level -= 1
line_buffer = line_buffer[:-len(TAB)]
line_buffer += c
fout.write(line_buffer + '\n')
if indent_level == 0:
fout.write('\n')
line_buffer = ''
elif c == ',':
line_buffer += c + ' '
else:
line_buffer += c
if line_buffer.strip():
fout.write(line_buffer + '\n')
line_buffer = ''
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello,
Some years ago I published a map to Battle.net using the GAx3 dependency. Now that dependency is no longer available. However, some game patches have caused bugs in my map, which I would like to fix.
This means I need to re-create all the functionality that I was using from GAx3 for myself. I was wondering if anyone knows how I can obtain the galaxy code for the functions defined in GAx3, perhaps by extracting something from the GAx3.SC2Mod file, which I was able to find on this site and open with Ladik's MPQ editor. I looked around for the code there, but it seems it may be saved in an XML format instead, or somewhere else. I'm not exactly sure where it is. If anyone could point me in the right direction, that would be great.
Is the file named "Triggers" (no extension) just an XML encoding of the source code? Perhaps I should attempt to decode that and then I would be able to recreate the functions I need.
Edit: I've looked a bit more into the Triggers XML file, I think it's just declaring all the functions and parameters, but not defining them. So where is the source code?
Previously known as: SomeoneTookMyNameTT
Oh wow! Thanks Talv. I tried various options on that pulldown menu and couldn't find it, but I didn't try "Map/Mod Name" for some reason.
If that's really the library source, is it being obfuscated in a sneaky way? I read through that file pretty carefully before, it looks something like this for me:
It really doesn't seem to be doing much, but I could have missed something.
Yep, you did miss an include statement:
// Custom Script: Custom Script
//--------------------------------------------------------------------------------------------------
include "TriggerLibs/GAx3"
There's another Galaxy file, where all the functions are actually declared.
It's because author coded it all by hand, and in Triggers there are just metadata definitions of these functions - pretty much like you've said. So they can be accessed from the GUI. But actual function declarations are in this custom file.
Previously known as: SomeoneTookMyNameTT
Oh dear me, I thought I had checked both files... Aieee
Ahah! Now I see the issue. I really hoped I wasn't that stupid... The first line of that file is hiding almost all the function definitions. At least on my system (Windows 10, Notepad++), line 1 is 18K+ characteres long. I scrolled right past all the important code.
Yeah, this file was mostly stripped from newlines.. and whitespaces in general. I don't know why he did that.
Anyway, I guess you don't really need to modify it, since you can just re-link the dependency that's still up on bnet, right? If no, I could fix the file for you (in the past I wrote some scripts for cases like this).
btw. If you wanna work with Galaxy code I recommend this : https://marketplace.visualstudio.com/items?itemName=talv.sc2galaxy :p
Although the feature which you would need right new - that is pretty print/format code is not yet finished.
Previously known as: SomeoneTookMyNameTT
Thanks for all your help, I already wrote a quick script to clean up that file. (Of course I can re-link the GAx3 on Battle.net, this is more for educational purposes.)