Thanks, guys, you've all been super helpful. The wiki says that the create dialog item thing returns a control, which I had no idea was an int.
So what I did, was change my array to, instead of storing the location id as the index to the array, I've put the dialog items themselves as the index to the array.
So.. now I do array_name[DialogBUtton] = location_index =D
Well (Used Dialog Item) should be an object that is a DialogItem, which is also an object. Since these objects have fields upon creation, the fields should be accessible after creation.
I just wish there was a way to view the documentation for each object in the editor, like any other programming language. =\
0
@Eiviyn: Go
So, I need to manually create the base, and the workers?
There isn't any "Spawn base and workers at this point" function. or anything similar.
0
@TacoManStan: Go
do you know hoW?
0
I put 12 starting locations on my map.
How do I select, in code, which one to spawn at?
0
le bump.
0
Thanks, guys, you've all been super helpful. The wiki says that the create dialog item thing returns a control, which I had no idea was an int.
So what I did, was change my array to, instead of storing the location id as the index to the array, I've put the dialog items themselves as the index to the array.
So.. now I do array_name[DialogBUtton] = location_index =D
le code:
And in the dialog item used event,
thank you all! ♥
0
@b0ne123: Go
Thanks for the parseInt. I'll probs just do parseInt(TextToString(ououaouoeu)) or something like that, if I need to.
I really shouldn't need the loop though.
Like... lets say I have DialogItem a, which has the button text saying "8".
I should be able to do something similar to parseInt(a.text)
I've tried a couple things: .getText(), .text(), buttonText, and .Text()
\
0
@DerNalia: Go
correct Syntax: lv_location = RandomInt(min, max);
0
http://dl.dropbox.com/u/331982/Help/StarCraft/Editor/DiffertiationBetweenButtonsInAnArrayWhenClicked.png
currently, I get a syntax error on the Random BETWEEN line.
What is the proper syntax?
0
@Exaken: Go
It's essentially the same as using a switch statement. Except less lines of code. Same inefficiency though.
0
@s3rius: Go
False. Text can be parsed. Take a look at Java's Integer.parseInt(<string>); or ruby's string.to_i
Shirley, there is something similar in the galaxy editor.
0
@Helral: Go
It was because the Galaxy Editor uses Degrees instead of Radians for Cosine and Sine.
http://www.sc2mapster.com/forums/development/triggers/23563-solved-trying-to-get-positions-along-a-circle-my-expression/
0
@Hobrow: Go
Well (Used Dialog Item) should be an object that is a DialogItem, which is also an object. Since these objects have fields upon creation, the fields should be accessible after creation.
I just wish there was a way to view the documentation for each object in the editor, like any other programming language. =\
EDIT: just found the wiki page for Used Dialog Item: http://www.sc2mapster.com/wiki/galaxy/triggers/used-dialog-item/ But it is incomplete
0
@Hobrow: Go
I don't need to use a switch function, because All I need is the value of the button =D. No point in having 24 lines of extra code.
What I want in my else statement is this:
Somehow set the starting location of the player to the TextToInt value of the button text.
should be a one liner.
0
@Hobrow: Go
http://dl.dropbox.com/u/331982/Help/StarCraft/Editor/DiffertiationBetweenButtonsInAnArrayWhenClicked.png
The part where I need to differentiate between the buttons is in the else block.
Like... If I could do
TextToInt((Used Dialog Item).text)
I would be golden.
0
@Hobrow: Go
But How do I know which Dialog Item was clicked?
Like... If I only use Used Dialog Item, then all my buttons do teh same thing. =\