I'd like to help you. Perhaps you could jump on IRC at some point so we can do a little back-and-forth to figure out what's going on? I am virtually always on although I do idle sometimes. Best time is during the evenings (Eastern Time - GMT -5), although I am somewhat available during most days.
Rollback Post to RevisionRollBack
Pocket Warriors - A pokemon-style game with SC2 units and full banking. New demo coming soon!
This is one of the best tutorials i've seen in all my time looking for interesting ideas and good tutorials. It is not only great in its own, but it teaches you alot about dialogs and is very adaptable to many different situations. Great work, keep it up and thanks very much for this awesome tutorial!
I've refactored the way that the Unit Buttons record array is initialized. The way used now is a great deal more robust and doesn't require as much copy/pasting. It is a better way to initalize records overall, so I wanted to start people out on the right foot.
This refactoring also led to a slight change in how nRows was calculated (the +1 part was removed). Several people have asked about this calculation, specifically the use of the "Ceiling" function, so I've added some clarification.
I added an if statement to the dialog creation loop so it doesn't try to draw extra buttons in the event that nUnit Buttons is not directly divisible by nCols.
Finally, I was adding an extra button gap to both the width and height of the dialog. The old calculation was:
This results in a little extra complexity that needs to be explained, but I think it's important to do it right regardless. Currently, the extra gap is barely noticeable (if you look real close you can see it), but becomes much more dramatic if a larger gap is used. Although I have changed all or the code and explanations, I have not changed any of the images of the actual dialogs, and I'm not sure I ever will. The difference just isn't large enough.
If you've already gone through this tutorial, you may wish to look these changes over to see how/if they affect you. I do recommend making these changes, as they will result in better code being written by you in the long run.
That was a most excellent tutorial, I definitely learned quite a bit from what you showed and I can see many uses for this. Unfortunately I did *something* wrong and my dialog does not create extra rows, nor does it display all of the buttons.
I am going to try this - again - and see if I can find where I messed up!
I've got to admit that this is one useful tutorial.
Yet somehow the new height calculation does mess up, though the width is calculated correctly.
Both use the new formula and only differ in the use of nRow and nCol. However the calculation of nRow seems to work correctly, but the Height-calculation seems to fail the addition of any arithmetic operation including nRow.
If anyone could come up with a solution, it'd be much appreciated.
Edit: I'm fiddling around with this at the moment.
First try: Make nRow a global variable, calculated the same way.
... Results are negative.
Second try: Make nRow have a constant value, like nCol.
... Results are positive! I repeat, results are positive! The dialog now shows up correctly!
My advice: Just take your calculator and decide beforehand, somehow GE does not like integers calculated from integers that were converted to reals. Maybe this was due to some patch or anything.
I'm not that much of a triggerguy, so i'm probably just overlooking something.
Edit Edit: Another idea just struck me as i was reading part 2.
It's possible, no it's even likely, that nRow is probably calculated AFTER cHeight is. This would cause Height to reference nRow as 0. I think. Just gonna test it now.
... Result: Affirmative. nRow has to be initiated beforehand. That was the mistake.
@kmkkmk, simply drag nRow to a place top of cHeight. This will fix it.
@jaminv, maybe you should put in this little warning there, too, for us trigger-impaired beginners :)
Just wanted to say fantastic tutorial. I carefully went through every step and it worked perfectly. A great introduction to records, action definitions and parameters for me...all things I have neglected in the project I am working on. I am excited to hop into the next one!
First off wanted to say this is a great tutorial that reflects the programmatic thinking of the creator. Me being new to Starcraft 2 custom maps, this was very useful.
and if you download the map it doesn't display the menu right. to fix it change this:
Dialog Height = (+ (cDialog Extra, (cButton Gap * nRows), (cButton Gap * (nRows - 1)))) <Integer>
I do not this tutorial was good at all, it did not go step by step and explain what everything does. This tutorial is how a person that know how to make dialogs do it step by step but its worthless way to teach other with. After half the tutorial all i had read what "we will take that later" and "you will see later"... i want to learn small parts step by step and understand each part before moving on. Sorry but i did not like this tutorial at all.
This is a somewhat more advanced tutorial, and a very good one at that. The writer assumes that the reader already has a basic understanding of the trigger editor.
Good tutorial, and I know the turtorial is a year old but I found some flaws in your logic which leads to unmatched spacing due to not accounting for the gap on the initial set up of the x and y axis.
Sorry, I'm a detail nut so I noticed. To be 100% correct there are three edits
change the line from:
x = cDialog Border <Integer>
should really become:
x = (cDialog Border +cButton Gap) <Integer>
change the line from:
y = cDialog Border <Integer>
should really become:
y = (cDialog Border + cButton Gap)<Integer>
change the line from:
Variable - Set x = cDialog Border
should really become:
Variable - Set x = (cDialog Border + cButton Gap)
In my version that I use I've actually split the Button size, Icon size and Gap into "Button Width", "Button Height", "Icon Width", "Icon Height", Horizontal Gap" and "Vertical Gap" so I have even more glanular control.
Another necro, but there's an issue with your Dialog Height variable. It calculates using button gap instead of button size, and I think this is the reason why some of people's dialogs fucked up. Easily fixable by changing that button gap variable to button size.
Im trying to download the Attached map but it wont let me, just sends me to a page filled with random code gibberish anyone know how to fix this?
Also im stuck on Displaying the Button, Part 2
"Step 2:
Dialog - Create an image for dialog (Last created dialog)
with the dimensions (cIcon Size, cIcon Size)
anchored to Top Left with an offset of ((+ (x, cButton Inlay)), (+ (y, cButton Inlay)))
setting the tooltip to "" using the image Unit Buttons[iButton].Icon
as a Normal type with tiled set to false tint color White and blend mode Normal
In this step we actually need to add cButton Inlay to our x and y values. If we needed to use this calculation more than once (or if it were much more complicated), we would have pre-calculated it. However, it is fine to do small calculations like these inline.
It's very important to note that tiled is set to false. For most images, this is what you want (and it's not the default). It's no documented very well, but your options are "tiled" or "scaled". To get the image to scale, you set tiled to false. This is a common pitfall new dialog designers run into. We want our icon to scale."
Where it says "setting the tooltip to "" using the image Unit Buttons[iButton].Icon as a Normal type with tiled set to false tint color White and blend mode Normal"
it wont let me change the image used to "Unit Buttons[iButton]" it only lets me pick a spacifit image from the core/assets or what ever
This is a somewhat more advanced tutorial, and a very good one at that. The writer assumes that the reader already has a basic understanding of the trigger editor.
Dont misunderstand me now, i have ok understanding of the trigger editor but when it comes to dialogs i have zero experience. Is there no good tutorial around for those like me where somebody can explain the very basic principles behind making dialogs and how it works?
If you don't understand Dialogs then your Trigger Editor experience must be very low. Dialogs are one of the must used and most needed forms of actions that can be used within the Trigger Editor. If you're looking for something extremely basic try to look for one of OneTwoSC's tutorials either on here or on youtube. He does a good job explaining the basics.
jaminv still dont under stand casue it doesn't display a variable it displays the tool tip and i thats the only options get i dont get a int options
@aczchef: Go
Convert Integer to Text
I'd like to help you. Perhaps you could jump on IRC at some point so we can do a little back-and-forth to figure out what's going on? I am virtually always on although I do idle sometimes. Best time is during the evenings (Eastern Time - GMT -5), although I am somewhat available during most days.
This is one of the best tutorials i've seen in all my time looking for interesting ideas and good tutorials. It is not only great in its own, but it teaches you alot about dialogs and is very adaptable to many different situations. Great work, keep it up and thanks very much for this awesome tutorial!
I've updated the tutorial.
When it should be:
This results in a little extra complexity that needs to be explained, but I think it's important to do it right regardless. Currently, the extra gap is barely noticeable (if you look real close you can see it), but becomes much more dramatic if a larger gap is used. Although I have changed all or the code and explanations, I have not changed any of the images of the actual dialogs, and I'm not sure I ever will. The difference just isn't large enough.
If you've already gone through this tutorial, you may wish to look these changes over to see how/if they affect you. I do recommend making these changes, as they will result in better code being written by you in the long run.
An updated map has been uploaded as well.
This Tutorial is damn good!
Alhough i need dialogs for something totally different, this was a very good first step for me in understanding the making of dialogs!
Keep up the good work!
Should add a section that covers using custom images.
That was a most excellent tutorial, I definitely learned quite a bit from what you showed and I can see many uses for this. Unfortunately I did *something* wrong and my dialog does not create extra rows, nor does it display all of the buttons.
I am going to try this - again - and see if I can find where I messed up!
Hi,
I downloaded your map and the height is too small. This is what it looks like.
I've got to admit that this is one useful tutorial.
Yet somehow the new height calculation does mess up, though the width is calculated correctly.
Both use the new formula and only differ in the use of nRow and nCol. However the calculation of nRow seems to work correctly, but the Height-calculation seems to fail the addition of any arithmetic operation including nRow.
If anyone could come up with a solution, it'd be much appreciated.
Edit: I'm fiddling around with this at the moment.
First try: Make nRow a global variable, calculated the same way.
... Results are negative.
Second try: Make nRow have a constant value, like nCol.
... Results are positive! I repeat, results are positive! The dialog now shows up correctly!
My advice: Just take your calculator and decide beforehand, somehow GE does not like integers calculated from integers that were converted to reals. Maybe this was due to some patch or anything.
I'm not that much of a triggerguy, so i'm probably just overlooking something.
Edit Edit: Another idea just struck me as i was reading part 2.
It's possible, no it's even likely, that nRow is probably calculated AFTER cHeight is. This would cause Height to reference nRow as 0. I think. Just gonna test it now.
... Result: Affirmative. nRow has to be initiated beforehand. That was the mistake.
@kmkkmk, simply drag nRow to a place top of cHeight. This will fix it.
@jaminv, maybe you should put in this little warning there, too, for us trigger-impaired beginners :)
Just wanted to say fantastic tutorial. I carefully went through every step and it worked perfectly. A great introduction to records, action definitions and parameters for me...all things I have neglected in the project I am working on. I am excited to hop into the next one!
First off wanted to say this is a great tutorial that reflects the programmatic thinking of the creator. Me being new to Starcraft 2 custom maps, this was very useful.
and if you download the map it doesn't display the menu right. to fix it change this:
Dialog Height = (+ (cDialog Extra, (cButton Gap * nRows), (cButton Gap * (nRows - 1)))) <Integer>
to this:
Dialog Height = (+ (cDialog Extra, (cButton Size * nRows), (cButton Gap * (nRows - 1)))) <Integer>
Looks like it was just a common mistake.
I do not this tutorial was good at all, it did not go step by step and explain what everything does. This tutorial is how a person that know how to make dialogs do it step by step but its worthless way to teach other with. After half the tutorial all i had read what "we will take that later" and "you will see later"... i want to learn small parts step by step and understand each part before moving on. Sorry but i did not like this tutorial at all.
@Sherlia: Go
This is a somewhat more advanced tutorial, and a very good one at that. The writer assumes that the reader already has a basic understanding of the trigger editor.
Good tutorial, and I know the turtorial is a year old but I found some flaws in your logic which leads to unmatched spacing due to not accounting for the gap on the initial set up of the x and y axis.
Sorry, I'm a detail nut so I noticed. To be 100% correct there are three edits
change the line from: x = cDialog Border <Integer> should really become: x = (cDialog Border +cButton Gap) <Integer>
change the line from: y = cDialog Border <Integer> should really become: y = (cDialog Border + cButton Gap)<Integer>
change the line from: Variable - Set x = cDialog Border should really become: Variable - Set x = (cDialog Border + cButton Gap)
In my version that I use I've actually split the Button size, Icon size and Gap into "Button Width", "Button Height", "Icon Width", "Icon Height", Horizontal Gap" and "Vertical Gap" so I have even more glanular control.
Another necro, but there's an issue with your Dialog Height variable. It calculates using button gap instead of button size, and I think this is the reason why some of people's dialogs fucked up. Easily fixable by changing that button gap variable to button size.
@jaminv: Go
Im trying to download the Attached map but it wont let me, just sends me to a page filled with random code gibberish anyone know how to fix this?
Also im stuck on Displaying the Button, Part 2
"Step 2:
Dialog - Create an image for dialog (Last created dialog) with the dimensions (cIcon Size, cIcon Size) anchored to Top Left with an offset of ((+ (x, cButton Inlay)), (+ (y, cButton Inlay))) setting the tooltip to "" using the image Unit Buttons[iButton].Icon as a Normal type with tiled set to false tint color White and blend mode Normal
In this step we actually need to add cButton Inlay to our x and y values. If we needed to use this calculation more than once (or if it were much more complicated), we would have pre-calculated it. However, it is fine to do small calculations like these inline.
It's very important to note that tiled is set to false. For most images, this is what you want (and it's not the default). It's no documented very well, but your options are "tiled" or "scaled". To get the image to scale, you set tiled to false. This is a common pitfall new dialog designers run into. We want our icon to scale."
Where it says "setting the tooltip to "" using the image Unit Buttons[iButton].Icon as a Normal type with tiled set to false tint color White and blend mode Normal"
it wont let me change the image used to "Unit Buttons[iButton]" it only lets me pick a spacifit image from the core/assets or what ever
@BirdmanEagleson: Go
Right click on the link and click download also known as "Save link as..."
@DarlD: Go
ahh thanks lol
and ive fixed my problem i guess i needed to restart my editor for some reason.
Dont misunderstand me now, i have ok understanding of the trigger editor but when it comes to dialogs i have zero experience. Is there no good tutorial around for those like me where somebody can explain the very basic principles behind making dialogs and how it works?
@Sherlia: Go
If you don't understand Dialogs then your Trigger Editor experience must be very low. Dialogs are one of the must used and most needed forms of actions that can be used within the Trigger Editor. If you're looking for something extremely basic try to look for one of OneTwoSC's tutorials either on here or on youtube. He does a good job explaining the basics.