if(i==Foo_index){UIDisplayMessage(PlayerGroupAll(),c_messageAreaDebug,StringToText("Galaxy++ Error: Unable to allocate more than 5 dynamic Foo types."));IntToString(1/0);}
Why the division by zero (autogenerated from struct pointer allocation)?
Edit: Another minor irritating bug:
It seems that when you compile sometimes, the current active/selected/used tab is switched to another.
There is no way to continue from there.. Normally, an exception would be thrown, but since galaxy don't support exceptions, I do a zero division. That will cause the cpu to complain to SC2, who will be forced to stop execution of that trigger. So in short, to skip all remaining actions of the trigger.
Right, although, I'd rather see it return -1 or something. Then again, the consequence would be that it would probably yield a "array index out of bounds" later, so, I guess never mind. It might just be confusing for the developer to interpret its meaning.
Well, if I just did a return, it would only stop the current function - not the entire trigger.
Fixed those 2 bugs for next version, got some new features I want done before release though. A temporary fix for 2nd bug would be to put all static fields after nonstatic ones.
It results in two compiler errors for both the constants - I can't use them inside the struct if they also are declared inside the struct. However, since they are static, that error should not occur.
Hmm. when I test it I get that it works as it should for methods and structs, but for some reason, fields will never be removed.
This is the code I used to test
intfoobar;intfoo(inti){//Do something to not be automatically inlinedi*=i;i*=i;returni;}structbar{intfoo;intbar;}
Interesting, well, yeah so far I'm agreeing, testing that code, it behaves just like you said.
But it is still weird, since neither of my options was checked to remove code, yet it did. The time it didn't was when it was actually used the code in a Trigger or Initializer, and at other cases when it used any blizzard-declared function.
My programming design choices have been to declare a struct, put everything inside the struct (fields, properties, members, methods), and then call a static init method from an Initializer. Could all that stuffing of the struct be related as well?
Well, struct methods are pulled outside before the removal process, so at that point, there shouldn't be a difference between struct methods and normal methods.
Could it just be because the compiler is inlining some of your small methods? Does it say as a warning that the method was unused? It might be easier if you could give me a piece of code that misbehaves.
Well, it stopped behaving errorenous, as I'm using the code now:P
I'll report back if it gets buggy again, and post what.
Speaking of unused, if you have a struct only providing static variables, then the compiler will show that as a warning, that the struct isn't used. And well, it's right I suppose, since the static fields are just global variables (but still). Would this be fixed or alternatively, allow a static identifier allowed before struct declarating? I'd see potential in that, say if you would like to have a monostate class/struct.
I ran into errors extracting the nativelibs correctly for andromeda, and now I am stuck with not being able to continue to rewrite the automatic triggers generated to more sane code.
I just copypasted the initial triggers i had in my map which made andromeda compile until the point where he started encountering unknown native calls, but otherwise it would compile it, and tried it in G+ + - but there I get only an error. Now I am not sure, does G+ + actually work with copypasted scriptfiles from galaxy itself?
And is there any tool which extracts the latest native libs from all the patches automatically?
Apparently, vanilla galaxy supports for - loops now (did I miss a changelog or something?), so you could make your compiler use that instead of a while loop.
When the native lib is updated, I extract it manually, precompile it for g++, and ship that with the released version. So essentially, it just has a list of everything defined in the native lib (assuming campaign dependancies enabled).
Of course, it will complain if your code conflicts with the code from the native lib. You are gonna have to be more specific with your script and the error, if you want more help resolving it.
Hey, first i want to thank you for your work i do love this edior :)
I have noticed a crash while compiling.
Somehow after i did some work and tried to compile it a critical error appears. After 1 hour check i found the Problem:
voidfubi(){int.ist=2;// this crashesif(1==unit.doof){// also this}}
this error is rare but i did used "unit" as a namespace and deleted it today but forgot one of his remaining links, maybe you can show of an error instead of a crash ? :)
Well, i have found another problem, i tried to recreate it with simple code but, I just dont know when the problem occurs. So i will try to explain it:
I have an struct that is only used in an class as a normal struct ( so not an Pointer ) somehow like this :
Only this code will work perfectly, but in my script it happens that a Syntax Error appears in Sc2. So I checked the whole OutputScript.
The problem was that my struct was written far below my class so sc2 couldnt know if this was a struct. It looked like this in the output.galaxy:
structfoobar{intsomevars;intsomevars2;intmad;foobug[3]data;// sc2 dont know foobug -> syntax error};......structfoobug// now sc2 knows it but tooo late{intsomethingtodo;};intfoobar_Constructor(intcurrentStruct){foobar_array[currentStruct].data[0].somethingtodo=3;foobar_array[currentStruct].data[1].somethingtodo=3;foobar_array[currentStruct].data[2].somethingtodo=3;returncurrentStruct;}
I could fix the bug in a strange way, i put the whole struct into another project file. The code of this file was the first compiled code in the output. So now also my struct will get compiled in the first 100 lines.
If you want some more info about that I can upload my whole project, where you can simply change the position of the struct and see that it will crash ingame.
I haven't been able to reproduce your bug.. but I have been aware for some time that that section of the compiler is not implemented in the best possible way.. Guess I was just waiting for someone to tell me it's broken :)
As you guys might have noticed I released a new version.. And then I got my first error report :)
"Could not load file or assembly 'Microsoft.Xna.Framework (...)"
Anyone else who get this.. Could you try and run the installer instead? I think it should install all dependencies. ftp://46.163.69.112/Releases/
If it works / doesn't work, please let me know.
By setting the value of your pointer to your variable
And before you do that you will have to allocate the pointer value (if you haven't already)
Why the division by zero (autogenerated from struct pointer allocation)?
Edit: Another minor irritating bug: It seems that when you compile sometimes, the current active/selected/used tab is switched to another.
@Mexaprone: Go
There is no way to continue from there.. Normally, an exception would be thrown, but since galaxy don't support exceptions, I do a zero division. That will cause the cpu to complain to SC2, who will be forced to stop execution of that trigger. So in short, to skip all remaining actions of the trigger.
Bug thingy - hmm. okay.
Right, although, I'd rather see it return -1 or something. Then again, the consequence would be that it would probably yield a "array index out of bounds" later, so, I guess never mind. It might just be confusing for the developer to interpret its meaning.
Another bug, and this is the code I have:
It says that DeltaTime isn't used, and when I doubleclick the warning, it displays an error dialog box: "Could not open file".
Edit: More errors. Assume this:
Crashes the editor, but if I place the Foo*as a global variable, or if "i = 0;" is commented out, it wont crash.
Well, if I just did a return, it would only stop the current function - not the entire trigger.
Fixed those 2 bugs for next version, got some new features I want done before release though. A temporary fix for 2nd bug would be to put all static fields after nonstatic ones.
Hi!
Another error (I think)
I had this scenario:
It results in two compiler errors for both the constants - I can't use them inside the struct if they also are declared inside the struct. However, since they are static, that error should not occur.
Regards
It should be fixed in the latest version
Alright, another bug:
In the options, it seems that the checkboxes under "Unused declarations" is giving the opposite result you want.
Looking at the generated mapscript, checking "Remove unused methods/fields/structs" will not remove code, while unchecking will have code removed.
Hmm. when I test it I get that it works as it should for methods and structs, but for some reason, fields will never be removed.
This is the code I used to test
Interesting, well, yeah so far I'm agreeing, testing that code, it behaves just like you said.
But it is still weird, since neither of my options was checked to remove code, yet it did. The time it didn't was when it was actually used the code in a Trigger or Initializer, and at other cases when it used any blizzard-declared function.
My programming design choices have been to declare a struct, put everything inside the struct (fields, properties, members, methods), and then call a static init method from an Initializer. Could all that stuffing of the struct be related as well?
Well, struct methods are pulled outside before the removal process, so at that point, there shouldn't be a difference between struct methods and normal methods.
Could it just be because the compiler is inlining some of your small methods? Does it say as a warning that the method was unused? It might be easier if you could give me a piece of code that misbehaves.
Well, it stopped behaving errorenous, as I'm using the code now:P
I'll report back if it gets buggy again, and post what.
Speaking of unused, if you have a struct only providing static variables, then the compiler will show that as a warning, that the struct isn't used. And well, it's right I suppose, since the static fields are just global variables (but still). Would this be fixed or alternatively, allow a static identifier allowed before struct declarating? I'd see potential in that, say if you would like to have a monostate class/struct.
I ran into errors extracting the nativelibs correctly for andromeda, and now I am stuck with not being able to continue to rewrite the automatic triggers generated to more sane code.
I just copypasted the initial triggers i had in my map which made andromeda compile until the point where he started encountering unknown native calls, but otherwise it would compile it, and tried it in G+ + - but there I get only an error. Now I am not sure, does G+ + actually work with copypasted scriptfiles from galaxy itself?
And is there any tool which extracts the latest native libs from all the patches automatically?
Apparently, vanilla galaxy supports for - loops now (did I miss a changelog or something?), so you could make your compiler use that instead of a while loop.
@g4borg: Go
As long as you paste valid galaxy code, it should work.
@g4borg: Go
When the native lib is updated, I extract it manually, precompile it for g
++
, and ship that with the released version. So essentially, it just has a list of everything defined in the native lib (assuming campaign dependancies enabled).Of course, it will complain if your code conflicts with the code from the native lib. You are gonna have to be more specific with your script and the error, if you want more help resolving it.
@Kueken531: Go
Yeah, I could.. then again - it ain't broke.
Hey, first i want to thank you for your work i do love this edior :)
I have noticed a crash while compiling. Somehow after i did some work and tried to compile it a critical error appears. After 1 hour check i found the Problem:
this error is rare but i did used "unit" as a namespace and deleted it today but forgot one of his remaining links, maybe you can show of an error instead of a crash ? :)
Actually, the crash occurs when creating the error report :) It'll be fixed for next version
sounds great :)
Well, i have found another problem, i tried to recreate it with simple code but, I just dont know when the problem occurs. So i will try to explain it: I have an struct that is only used in an class as a normal struct ( so not an Pointer ) somehow like this :
Only this code will work perfectly, but in my script it happens that a Syntax Error appears in Sc2. So I checked the whole OutputScript. The problem was that my struct was written far below my class so sc2 couldnt know if this was a struct. It looked like this in the output.galaxy:
I could fix the bug in a strange way, i put the whole struct into another project file. The code of this file was the first compiled code in the output. So now also my struct will get compiled in the first 100 lines.
If you want some more info about that I can upload my whole project, where you can simply change the position of the struct and see that it will crash ingame.
Been a bit awol playing swtor beta..
I haven't been able to reproduce your bug.. but I have been aware for some time that that section of the compiler is not implemented in the best possible way.. Guess I was just waiting for someone to tell me it's broken :)
As you guys might have noticed I released a new version.. And then I got my first error report :)
"Could not load file or assembly 'Microsoft.Xna.Framework (...)"
Anyone else who get this.. Could you try and run the installer instead? I think it should install all dependencies.
ftp://46.163.69.112/Releases/
If it works / doesn't work, please let me know.
Edit: Looks like it doesn't install it. You can find it at
http://www.microsoft.com/download/en/details.aspx?id=15163