Alright, I'm new to the Galaxy Editor in SC2 (hence my avatar), and instead of flooding the forum with my dozens of questions, I figured I'd consolidate them here.
Background
I've messed around with the SC and War3 editors, so I am familiar with the trigger system and how it works. I also have programming experience, though I'm not looking to delve into the Galaxy Scripting just yet (soon).
Question 6 - Understanding Morphs
Alright, so I've taken it upon myself to understanding morphs. In particular, complicated morphs such as Baneling from Burrowed Zergling. I was drawn to this one because there are several units involved: Zergling, Baneling Cocoon, Baneling.
The first thing I gleaned from this is that order does matter! The morph starts with the initial unit (which we don't see here, a burrowed zergling), and ends with the final unit.
Zergling
Cocoon
Baneling
SOLVED Question 5 - Functions
Can user-defined functions not be called from an initial action, but only be used as parameters?
SOLVED: Use a custom action instead of a custom function.
Instead of passing the struct itself you can make arrays of your struct-type, then return the integer index of the struct.
That's the only way right now, I think.
PS: Since Blizzard disabled pointer functionality in patch 9 there's only two options:
1: They comepletely threw away the idea of passing structs.
2: It'll come later (probably much later).
Question 3 - Label in Dialog Not Changing Color
Created a label and set the text color to red via the label parameter, but when displayed in the dialog box the text color is the default (white). However I can force it to red if I modify the value explicitly via the hard-coded styles <c=FF0000>red</c>. So does the color parameter to the label just not work?
SOLVED Question 2 - Converting String To File - Image
I have an image path that I grabbed from a unit in the data editor, and I want to use it. However, Catalog Field Value Get only returns a string, and I can't seem to find a way to convert the String image path into an actual "File - Image" type. Being the good forumite, I've done some searching and found an example of what I'm trying to accomplish. However, the poster seems to return the icon path as an image, whereas I cannot since the "icon path" in my editor is of type String and the function expects File - Image. The relevant part of the example is below:
Basically trick the editor into thinking the variable is of the correct type (because, well, it is). This can work for any 2 types that are "essentially" the same (that is, the underlying type is the same). Take the following example below:
SOLVED (?) Question 1 - The Red Dot over some Trigger Icons
UPDATE: It seems that the red dot means the trigger is half-disabled... hmm.
UPDATE 2: Opened the editor this morning, no problems. Editor bug I guess?
Starting off with an easy one. One of my functions has a red dot over the question mark, and so do some of the actions in that function. I would assume that's indicative of an error, but no only do I not see one, the function works as intended. Any ideas? Here's the function - it takes a CamelCased word and turns it into Camel Cased. The first 2 "General" triggers (For and IfThenElse) both have red dots, and the function itself in the left sidebar has a red dot over the question mark.
CamelCasetoSpacedOptions:FunctionReturnType:StringParametersCamelCasedStr=""<String>GrammarText:CamelCasetoSpaced(CamelCasedStr)HintText:(None)CustomScriptCodeLocalVariablesn=0<Integer>StrLen=0<Integer>SpacedStr=""<String>CurrentCharacter=""<String>LastCharacter=""<String>ActionsVariable-SetStrLen=(LengthofCamelCasedStr)General-Foreachintegernfrom0toStrLenwithincrement1,do(Actions)ActionsVariable-SetCurrentCharacter=(Substring(CamelCasedStr,n,n))General-If(Conditions)thendo(Actions)elsedo(Actions)IfOrConditions------- Current character is not uppercaseCurrentCharacter!=(String(CurrentCharacter)asUpperCase)n==0LastCharacter==" "ThenVariable-SetSpacedStr=(Combine(SpacedStr,CurrentCharacter))ElseVariable-SetSpacedStr=(Combine(SpacedStr," ",CurrentCharacter))Variable-SetLastCharacter=CurrentCharacterGeneral-ReturnSpacedStr
SiNiquity's Consolidated Thread of Q&A
Alright, I'm new to the Galaxy Editor in SC2 (hence my avatar), and instead of flooding the forum with my dozens of questions, I figured I'd consolidate them here.
Background
I've messed around with the SC and War3 editors, so I am familiar with the trigger system and how it works. I also have programming experience, though I'm not looking to delve into the Galaxy Scripting just yet (soon).
Question 6 - Understanding Morphs
Alright, so I've taken it upon myself to understanding morphs. In particular, complicated morphs such as Baneling from Burrowed Zergling. I was drawn to this one because there are several units involved: Zergling, Baneling Cocoon, Baneling.
The first thing I gleaned from this is that order does matter! The morph starts with the initial unit (which we don't see here, a burrowed zergling), and ends with the final unit.
Zergling
Cocoon
Baneling
SOLVED Question 5 - Functions
Can user-defined functions not be called from an initial action, but only be used as parameters?
SOLVED: Use a custom action instead of a custom function.
Question 4 - Using Record Type as Parameter
WORKAROUND
Question 3 - Label in Dialog Not Changing Color
Created a label and set the text color to red via the label parameter, but when displayed in the dialog box the text color is the default (white). However I can force it to red if I modify the value explicitly via the hard-coded styles <c=FF0000>red</c>. So does the color parameter to the label just not work?
SOLVED Question 2 - Converting String To File - Image
I have an image path that I grabbed from a unit in the data editor, and I want to use it. However, Catalog Field Value Get only returns a string, and I can't seem to find a way to convert the String image path into an actual "File - Image" type. Being the good forumite, I've done some searching and found an example of what I'm trying to accomplish. However, the poster seems to return the icon path as an image, whereas I cannot since the "icon path" in my editor is of type String and the function expects File - Image. The relevant part of the example is below:
SOLUTION
Basically trick the editor into thinking the variable is of the correct type (because, well, it is). This can work for any 2 types that are "essentially" the same (that is, the underlying type is the same). Take the following example below:
The editor will accept this because IconPath is of the correct type. Now, change IconPath to type String and you're done!
SOLVED (?) Question 1 - The Red Dot over some Trigger Icons
UPDATE: It seems that the red dot means the trigger is half-disabled... hmm.
UPDATE 2: Opened the editor this morning, no problems. Editor bug I guess?
Starting off with an easy one. One of my functions has a red dot over the question mark, and so do some of the actions in that function. I would assume that's indicative of an error, but no only do I not see one, the function works as intended. Any ideas? Here's the function - it takes a CamelCased word and turns it into Camel Cased. The first 2 "General" triggers (For and IfThenElse) both have red dots, and the function itself in the left sidebar has a red dot over the question mark.
More to come... <3
Shameless bump :D
Helpful :)