I am writing a build order tester that does not use supply, but an animated timeline. One problem remain that I can't seem to fix. I need the starting time of a trained unit and the completion time of that unit.
Using these trigger events:
TriggerAddEventUnitTrainProgress(Recorder_tStartTraining, null, c_unitProgressStageStart);
TriggerAddEventUnitTrainProgress(Recorder_tCompleteTraining, null, c_unitProgressStageComplete);
The problem: How do I retrieve the start time of a unit when I get its completion time?
- "EventUnitProgressUnit()" does not seem to work that well. Storing the units start time by identifying it with the unit tag does not work.
Also you can not use the units custom values.
- You can not just save it using the production building, since some can build 2 units at the same time...
I hope someone find an answer, this is an advanced problem (to be shure).
Thanks in advance,
elunder
Hey everyone, it has been a while but I saw a logic game in this forum once. You had to shoot ships with true or false and the would die or explode depending on wether you were right. These ships were logic gaten and boss units were flipflops and stuff.
Does anybody remember the game and especially were to find it??? I ahve to play it again!
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...
That is no solution since the trigger would never fire again -_-
I do need that trigger! And I need it to fire ehenever somebody selects an item of that listbox, but not twice after clearing the box.
Using a condition that terminates the trigger when the selected index is 0 doesn't work, because of threading I guess. When the condition is executed, the selected value is already 1 again...
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?
0
Found it again: http://melosquence.webuda.com/melosquenceEN/1.0b/Melosquencia.html
0
Hi folks!
I am writing a build order tester that does not use supply, but an animated timeline. One problem remain that I can't seem to fix. I need the starting time of a trained unit and the completion time of that unit.
Using these trigger events: TriggerAddEventUnitTrainProgress(Recorder_tStartTraining, null, c_unitProgressStageStart); TriggerAddEventUnitTrainProgress(Recorder_tCompleteTraining, null, c_unitProgressStageComplete);
The problem: How do I retrieve the start time of a unit when I get its completion time? - "EventUnitProgressUnit()" does not seem to work that well. Storing the units start time by identifying it with the unit tag does not work. Also you can not use the units custom values. - You can not just save it using the production building, since some can build 2 units at the same time...
I hope someone find an answer, this is an advanced problem (to be shure). Thanks in advance, elunder
0
Do you know what a logic gate is? Or a ship? ;) Not one of these found in THAT logic game :(
0
Hey everyone, it has been a while but I saw a logic game in this forum once. You had to shoot ships with true or false and the would die or explode depending on wether you were right. These ships were logic gaten and boss units were flipflops and stuff.
Does anybody remember the game and especially were to find it??? I ahve to play it again!
Gratz, elunder
0
-BUG: UnitGetOwner(unit):int is unknown to the compiler.Edit: Never mind that.
0
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...
0
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.
0
That is no solution since the trigger would never fire again -_-
I do need that trigger! And I need it to fire ehenever somebody selects an item of that listbox, but not twice after clearing the box. Using a condition that terminates the trigger when the selected index is 0 doesn't work, because of threading I guess. When the condition is executed, the selected value is already 1 again...
0
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)0
I am using a ListBox and have a trigger set up for it that uses the SelectionChanged Event.
This is what I do: 1. Clear all items in the LB 2. Add new items 3. Select first item
The trigger allways fires twice, both time thinking the selected index is 1 (I know the index gets set to 0 once you clear).
How can I stop the trigger from firing twice?
Thanks for the help, elunder
0
@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.
0
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;
0
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?
0
@Zecknaal: Go
I had tried both of your ideas already - without luck.
0
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 :(