Hello all, I've been playing WC and SC for a long time - mainly custom maps - and I've always been very interested in creating maps of my own. Very soon I will begin doing some reading into programming (C#) and it got me to realizing that creating a map would be an excellent exercise (I also have many fun ideas I'd like to try to adapt into custom maps).
I was reading through the tutorials to try and figure out the first of many obstacles I've come across and I realized that I 'felt' as if I was in over my head. So, I was wondering if there would be someone kind enough as to point me in the right direction as far as tutorials/knowledge goes so that I know I'm not floundering in the dark.
Here is what I wanted to do:
Create a Dialog button that will generate 3 random integers from 1-4.
Create a table where these 3 integers will be displayed
Alternatively – See Below
Create a Table with 3 random integers from 1-4.
Create a Dialog button that will destroy and recreate said table.
Then
Create New Dialog and buttons to assign one of the integers to a stat (str,dex,int)
Make integers able to be switched between stats before locked in
Create an “accept” button for lock in.
Later
Show different hero options based on the stats generated and assigned
Assign stats to the picked hero
The Idea:
The game will start with each player rolling for their stats (similar to a DnD game) and then being given different options for their 'hero' based on the picked stats. The Heroes will all be blank slates, however, and their stats will be the numbers generated by the player.
Any guidance or even criticism(constructive) is greatly appreciated. As I mentioned earlier I will be thankful for even just a link to a tutorial (or multiple) that would lead me in the right direction.
I learned this the hard way (holy crap that was a frustrating week), but when you create a new Variable (and you're going to create lots of them), don't forget to set what type of Variable it is. Just to the left of the Initial Value field is a drag down menu of different Types to set the variable to. This is how you make your variables visible when you're trying to hook things up; doing functions with Units require Unit Variables like doing functions with Unit Types require Unit Type Variables like doing functions with Integers require Integer Variables, and so on.
As far as what to really investigate, it seems like the most complicated part of your system is going to be the Dialog work; just going to be lots of computing the "rolled" integers, setting the acceptable stat thresholds to make your Heros visible and actually hooking it all up via Dialog Items. You're probably going to create 1 or 2 Dialogs and then constantly switch out the Dialog Items within it.
Beyond that I'd recommend researching Arrays, because learning what an Array is and how to utilize it will save you a lot of time and effort and create cleaner code. For example, if you're planning on a party of 4 players, you would have a Player_Stat Array that is 2 dimensions deep - [4][3]. Then you can use those indexes in the Array to store the randomly generated integers and every time a player clicks Reroll, run the random integer Trigger again and continually rewrite over the applicable player's array indexes. (Indexes are basically coordinates in an Array, and I visualize an Array in my head like tournament brackets. Not everyone does, so your mileage may vary)
Also another thing that will be of super, great, ultra, mega, hyper, giga importance to getting started and making tangible progress early on is learning how to debug your work. You could spend hours implementing something, thinking it's going to work because it appears logically sound in your mind and then when you go to test it - it doesn't work and you have no idea why. First thing you want to do is get familiar with how your system is actually working, so whenever you are performing Actions through your Triggers, make one more Action at the very end that is simply Action - Text Message. Print out a helpful message to the chat that lets you know during testing when something just happened. If you're expecting a message to fire and it doesn't, you at least know the last message (Trigger) that fired properly. This will save you lots of time in hunting down the cause of the bug.
If you're looking at, say, knowing what value something is, you can create a Text Message, then do a function called Combine Text and then put your first Text as "Number of Apples: " then make the second piece of text a Convert Integer to Text and plug in your AppleCount variable into it. There is a debugger tool that comes with the editor itself (that you'll hear about when you watch Beider's Trigger Debugging video) that will let you see the values of variables in real time, but know that the debugger is going to make your game slower andl once you really start getting something complex going, it can run at less than 1fps and take forever for some things to test. If you just need to do quick tests, and the game runs that slow, you can use Combine Text's on a Periodic Timer Event to constantly output a variable's count without slowing the game down through the debugger and wasting time.
Take it very slow and methodical; try to accomplish a little, then test it to make sure it's working as intended, then go back to the trigger editor and iterate a little more from there, fire up the map to test it, rinse, lather, repeat.
Also if you make SC2 open in a window and just leave that window open in the background, you'll save a lot of time when you're compiling your map to test it.
I'm still pretty green myself, but this is how I make progress. Beyond that, it's an ocean of knowledge trying to learn exactly how to make what you want to have happen with the editor, but most of that comes through just learning and knowing your way around the editor itself.
(Jesus, I'm sorry this all ended up so long winded...)
Nothing to be sorry about, your post really illuminated a lot. I have been watching/reading tutorials and I will make sure to research arrays/dialogs as per your suggestion! Excellent reply, thank you muchly
One more piece that I've been working on tonight, even, is creating a good test environment.
Right now it's temporary (I haven't even started researching how the Battle.net Lobby will interface with my map, so it's kind of jury rigged at the moment) but when the player selects their race from a dialog at the start of the game, I added a few triggers to give each race like 9000 minerals/gas so you're never stuck waiting for resources to begin testing a specific case scenario.
I've also begun filling out a Debug folder full of other useful triggers to help expedite testing such as one that whenever a unit begins construction, set the construction progress to 100% so buildings finish instantly. Also when a unit takes damage to kill it since you always start with a worker.
If I want to test my systems against different scenarios, having the money right off the bat and the ability to build and kill things instantly saves loads of time. Getting these debug triggers up and running is really helping my testing out a ton. Though technically my debug tools aren't complete yet... now I'm stuck trying to figure out how to handle the snowflake Zerg... I've spent hours searching and I can't find an elegant way to make the starting Hatchery spawn with full creep spread out or 3 larva. (Or just have all creep "build" instantaneously) There's actually a thread on the front page right now addressing the 3 larva spawn issue, but trying his method, I haven't been able to get it to work. >_<
So the ultimate purpose of this map is to be a blank canvas, so to speak; when I begin constructing a new system, I can do so in this fresh, modularized test bed and save the map as a different name to store just my work pertaining to the specific system I'm building. When I've finished construction of it and it's ready to go, I can just collapse a folder and copy/paste it into my main map. From there it's just making sure I hook up all the systems to be able to communicate with one another and it saves me a lot of headache by being able to get each component up and running on its own before adding it to the machine.
Honestly I've restarted this project from scratch like 6 times now because I keep learning more about the editor and finding more efficient ways of handling my systems. I think this modular template system is going to save me a lot of time, headache and confusion in the long run, so it may be something worth considering. :)
And one last thing - I found that creating a diagram has helped me plan out my systems immensely. I currently am using my closet doors (ceiling high mirrors) like whiteboards to brainstorm on, then I picked up a little freeware program called Diagram Designer off of Tucows and I begin "sketching" out the system there. Sculpting out a model of the intended system design has helped me a lot when it's time to get into the thick of things, especially when you take a break and do something called "sleeping" that interrupts your thought process for several hours on end. Having a diagram of what to do makes it much easier to get back into the groove.
Hello all, I've been playing WC and SC for a long time - mainly custom maps - and I've always been very interested in creating maps of my own. Very soon I will begin doing some reading into programming (C#) and it got me to realizing that creating a map would be an excellent exercise (I also have many fun ideas I'd like to try to adapt into custom maps).
I was reading through the tutorials to try and figure out the first of many obstacles I've come across and I realized that I 'felt' as if I was in over my head. So, I was wondering if there would be someone kind enough as to point me in the right direction as far as tutorials/knowledge goes so that I know I'm not floundering in the dark.
Here is what I wanted to do:
Then
Later
The Idea: The game will start with each player rolling for their stats (similar to a DnD game) and then being given different options for their 'hero' based on the picked stats. The Heroes will all be blank slates, however, and their stats will be the numbers generated by the player.
Any guidance or even criticism(constructive) is greatly appreciated. As I mentioned earlier I will be thankful for even just a link to a tutorial (or multiple) that would lead me in the right direction.
I moved this to the trigger forum for you as you're more likely to get an answer there.
Welcome to SC2mapster :)
Thank you muchly :D
@Frethen: Go
All seems fairly "easy". http://wiki.sc2mapster.com/galaxy/tutorials/ would probably be where you'd want to start looking at tutorials.
I learned this the hard way (holy crap that was a frustrating week), but when you create a new Variable (and you're going to create lots of them), don't forget to set what type of Variable it is. Just to the left of the Initial Value field is a drag down menu of different Types to set the variable to. This is how you make your variables visible when you're trying to hook things up; doing functions with Units require Unit Variables like doing functions with Unit Types require Unit Type Variables like doing functions with Integers require Integer Variables, and so on.
As far as what to really investigate, it seems like the most complicated part of your system is going to be the Dialog work; just going to be lots of computing the "rolled" integers, setting the acceptable stat thresholds to make your Heros visible and actually hooking it all up via Dialog Items. You're probably going to create 1 or 2 Dialogs and then constantly switch out the Dialog Items within it.
Beyond that I'd recommend researching Arrays, because learning what an Array is and how to utilize it will save you a lot of time and effort and create cleaner code. For example, if you're planning on a party of 4 players, you would have a Player_Stat Array that is 2 dimensions deep - [4][3]. Then you can use those indexes in the Array to store the randomly generated integers and every time a player clicks Reroll, run the random integer Trigger again and continually rewrite over the applicable player's array indexes. (Indexes are basically coordinates in an Array, and I visualize an Array in my head like tournament brackets. Not everyone does, so your mileage may vary)
Also another thing that will be of super, great, ultra, mega, hyper, giga importance to getting started and making tangible progress early on is learning how to debug your work. You could spend hours implementing something, thinking it's going to work because it appears logically sound in your mind and then when you go to test it - it doesn't work and you have no idea why. First thing you want to do is get familiar with how your system is actually working, so whenever you are performing Actions through your Triggers, make one more Action at the very end that is simply Action - Text Message. Print out a helpful message to the chat that lets you know during testing when something just happened. If you're expecting a message to fire and it doesn't, you at least know the last message (Trigger) that fired properly. This will save you lots of time in hunting down the cause of the bug.
If you're looking at, say, knowing what value something is, you can create a Text Message, then do a function called Combine Text and then put your first Text as "Number of Apples: " then make the second piece of text a Convert Integer to Text and plug in your AppleCount variable into it. There is a debugger tool that comes with the editor itself (that you'll hear about when you watch Beider's Trigger Debugging video) that will let you see the values of variables in real time, but know that the debugger is going to make your game slower andl once you really start getting something complex going, it can run at less than 1fps and take forever for some things to test. If you just need to do quick tests, and the game runs that slow, you can use Combine Text's on a Periodic Timer Event to constantly output a variable's count without slowing the game down through the debugger and wasting time.
Take it very slow and methodical; try to accomplish a little, then test it to make sure it's working as intended, then go back to the trigger editor and iterate a little more from there, fire up the map to test it, rinse, lather, repeat.
Also if you make SC2 open in a window and just leave that window open in the background, you'll save a lot of time when you're compiling your map to test it.
I'm still pretty green myself, but this is how I make progress. Beyond that, it's an ocean of knowledge trying to learn exactly how to make what you want to have happen with the editor, but most of that comes through just learning and knowing your way around the editor itself.
(Jesus, I'm sorry this all ended up so long winded...)
Nothing to be sorry about, your post really illuminated a lot. I have been watching/reading tutorials and I will make sure to research arrays/dialogs as per your suggestion! Excellent reply, thank you muchly
@Frethen: Go
One more piece that I've been working on tonight, even, is creating a good test environment.
Right now it's temporary (I haven't even started researching how the Battle.net Lobby will interface with my map, so it's kind of jury rigged at the moment) but when the player selects their race from a dialog at the start of the game, I added a few triggers to give each race like 9000 minerals/gas so you're never stuck waiting for resources to begin testing a specific case scenario.
I've also begun filling out a Debug folder full of other useful triggers to help expedite testing such as one that whenever a unit begins construction, set the construction progress to 100% so buildings finish instantly. Also when a unit takes damage to kill it since you always start with a worker.
If I want to test my systems against different scenarios, having the money right off the bat and the ability to build and kill things instantly saves loads of time. Getting these debug triggers up and running is really helping my testing out a ton. Though technically my debug tools aren't complete yet... now I'm stuck trying to figure out how to handle the snowflake Zerg... I've spent hours searching and I can't find an elegant way to make the starting Hatchery spawn with full creep spread out or 3 larva. (Or just have all creep "build" instantaneously) There's actually a thread on the front page right now addressing the 3 larva spawn issue, but trying his method, I haven't been able to get it to work. >_<
So the ultimate purpose of this map is to be a blank canvas, so to speak; when I begin constructing a new system, I can do so in this fresh, modularized test bed and save the map as a different name to store just my work pertaining to the specific system I'm building. When I've finished construction of it and it's ready to go, I can just collapse a folder and copy/paste it into my main map. From there it's just making sure I hook up all the systems to be able to communicate with one another and it saves me a lot of headache by being able to get each component up and running on its own before adding it to the machine.
Honestly I've restarted this project from scratch like 6 times now because I keep learning more about the editor and finding more efficient ways of handling my systems. I think this modular template system is going to save me a lot of time, headache and confusion in the long run, so it may be something worth considering. :)
And one last thing - I found that creating a diagram has helped me plan out my systems immensely. I currently am using my closet doors (ceiling high mirrors) like whiteboards to brainstorm on, then I picked up a little freeware program called Diagram Designer off of Tucows and I begin "sketching" out the system there. Sculpting out a model of the intended system design has helped me a lot when it's time to get into the thick of things, especially when you take a break and do something called "sleeping" that interrupts your thought process for several hours on end. Having a diagram of what to do makes it much easier to get back into the groove.