BUG: If you create a file that consists only constants, the compiler ignores to constants and creates an empty file. This will result in a crash when launching the game.
QUESTION: Why are all trigger initializations run via the "Invoke" function? This feels awefully uneffective...
I made my own markup for the coloring of text. As of now I think just using strings to define your texts is the easiest.
My solution:
Create a format function that replaces parts of your string with the codes used for textformatting. In this case Y means make yellow.
Format("Access your inventory by pressing #Y>I<#Y or clicking on ...")becomes"Access your inventory by pressing <c val=\"FDF000\">I</c> or clicking on ..."
Other codes would be #G> and <#G for green #IMG> and <#IMG for images and so on. This has the advantage that you can globaly define the colors that you are using. If you dont use a replace function and concatenate the strings ala
"Access your inventory by pressing "+cYellow+"I"+cYellowEnd+" or clicking on ..."
at some point you will get an directory overflow error from the script because galaxy has to use too many brackets.
Edit:
Another matter: In galaxy++ the function UnitGetTag(unit):int does not seem to be avaliable, but it's important! (Edit: Nevermind that, seems to be a general issue)
Right, declaring multiple variables works. I tried it before and it didn't. No clue what happened. Awesome when problems solve themselves!
Edit: Declaring multible variables only works inside functions, not for global variables.
Bugreport: I have accidentially overwritten the "Color" function which is probably defined in some native library. After I removed my function the compiler couldnt find the original anymore. Had to restart to fix it.
Thanks Slarti, that worked well. This way of initializing the array does not originate from c, does it? It looks funny ;)
I have another troublesome matter. How do you effectively work with the galaxy++ editor and text? The StringExternal function makes the code so unreadable and I didn't even figure out how to add a text element to the map using the original editor...
Also, group initialization of variables of the same kind woul be nice. Like: int a, b, c;
If I continue to create an entry and store it in the array this will be translated using the DataTableSet... function. This is not really what I want. How can I define an array so it will be used as an array?
-BUG: UnitGetOwner(unit):int is unknown to the compiler.Edit: Never mind that.
BUG: If you create a file that consists only constants, the compiler ignores to constants and creates an empty file. This will result in a crash when launching the game.
QUESTION: Why are all trigger initializations run via the "Invoke" function? This feels awefully uneffective...
Another awesome feature would be the foreach loop for unitgroups and playergroups!
Edit: Summing up!
1) declaring multiple GLOBAL variables like "int a, b, c;";
2) initializing string arrays like "string[3] names = { "Hodor", "Brandon", "Robb" };
3) foreach for player/unit-groups
Apart that, I must say this tool is awesome! I definantly like the namespace feature most.
I made my own markup for the coloring of text. As of now I think just using strings to define your texts is the easiest.
My solution: Create a format function that replaces parts of your string with the codes used for textformatting. In this case Y means make yellow.
Other codes would be #G> and <#G for green #IMG> and <#IMG for images and so on. This has the advantage that you can globaly define the colors that you are using. If you dont use a replace function and concatenate the strings ala
at some point you will get an directory overflow error from the script because galaxy has to use too many brackets.
Edit:
Another matter: In galaxy
++
the function UnitGetTag(unit):int does not seem to be avaliable, but it's important! (Edit: Nevermind that, seems to be a general issue)@DieHappy1234: Go
Right, declaring multiple variables works. I tried it before and it didn't. No clue what happened. Awesome when problems solve themselves!
Edit: Declaring multible variables only works inside functions, not for global variables.
Bugreport: I have accidentially overwritten the "Color" function which is probably defined in some native library. After I removed my function the compiler couldnt find the original anymore. Had to restart to fix it.
Thanks Slarti, that worked well. This way of initializing the array does not originate from c, does it? It looks funny ;)
I have another troublesome matter. How do you effectively work with the galaxy
++
editor and text? The StringExternal function makes the code so unreadable and I didn't even figure out how to add a text element to the map using the original editor...Also, group initialization of variables of the same kind woul be nice. Like: int a, b, c;
I stumbled on another problem, probably my fault hough.
The code above does not create an array in the output script but this:
If I continue to create an entry and store it in the array this will be translated using the DataTableSet... function. This is not really what I want. How can I define an array so it will be used as an array?
@Zecknaal: Go
I had tried both of your ideas already - without luck.
Hi, just started converting my 17600 lines of autogenerated crap into nice code. Is there a away to initialize a string array with values?
This does not work :(