There are 4 teams of 2 players each.
Each player starts with a marine spawning at a point every 3 seconds.
Throughout the game players can buy upgrades from their CC (named Guard Post in this scenario) to have War Pigs (Heavy Guards) or Marauders (Armored Guards) spawn as well.
When the heavy guard upgrade is purchased a war pig will spawn every 15 seconds in addition to the marine.
When the armored guard upgrade is purchased a marauder will spawn every 30 seconds in addition to the marine and war pig.
Now, you can probably tell I'm totally new to this by how I've done all this. I am, but once I learn a concept, I retain it. I just need help learning it.
ULTIMATELY, what I'm trying to achieve is something that works more like this:
There are 4 teams of 2 players each.
Each player starts with a marine spawning at a point every 3 seconds.
Players can pay minerals to upgrade their spawns by adding a war pig every 15 seconds or a marauder every 30 seconds.
Other players can pay minerals to turn off portions (or all) of another players spawn (either indefinitely or temporarily).
I know there's a better way to write this code and I think it has something to do with Booleans(?) or Arrays(?) but I don't know what they are or how to use them. Perhaps maybe there's a much better way I don't know about. I guess what I need is a way to dynamically turn spawns on and off in game by paying minerals at your command center.
Can someone help me with a tutorial for this? And if someone would be willing to actually tutor me and help me with the entire map I'd be grateful for that also. I have a lot more concepts for the map as a whole and will have to learn all kinds of things to finish it.
War Pig Spawn
Every 15 seconds of Game Time
Pick Each Player in (Active Players)
If
Conditions
Upgrade Level Of (War Pig Upgrade) for (Picked Player) > 0
Actions
[Put your spawn code here]
As you can see it's much easier to have a single trigger that iterates through all active players than to make a separate trigger for each player. That would be exceedingly time consuming.
If you're having trouble with that I think rather than trying to make your own map for now you'd be best served finding and following some of the very basic tutorials available.
Firt you need to understand if that if many players work the same way, you don't need to repeat the code for each one, as each player is referenced with a number, and you can use many loops to do the work for you.
For example if you wanna spawn a marine each 3 seconds, you can do:
That way you don't have to copy/paste the same code 8 times, one per player. Spawn Point is the point where do you wanna them to spawn. As is variable with players, you need to use an array (search a tutorial if you want). In that variable, in each slot you'll have the point you want. For example in Spawn Point[1] you save the point for player 1, and so on.
Then, for the upgrades, I suposse you'll save the upgrades in an array variable, so you simply check that variable, for example:
There are two variables that are booleans, Heavy_Guard_Upgrade and Armored_Guard_Upgrade. Currently, they are both set to true. I'd like to set them initially to false instead. Then I'd like to have purchasable upgrades at the Guard Posts (Command Centers) that, when purchased turned on the spawning of these units by changing the value for that play to true.
Could any one possibly lead me in the right direction on what I need to learn next to be able to do this?
So this is what I'm trying to do:
There are 4 teams of 2 players each. Each player starts with a marine spawning at a point every 3 seconds. Throughout the game players can buy upgrades from their CC (named Guard Post in this scenario) to have War Pigs (Heavy Guards) or Marauders (Armored Guards) spawn as well. When the heavy guard upgrade is purchased a war pig will spawn every 15 seconds in addition to the marine. When the armored guard upgrade is purchased a marauder will spawn every 30 seconds in addition to the marine and war pig.
This is how I have it set up so far:
http://img690.imageshack.us/f/scedit0001.png/ http://img251.imageshack.us/f/scedit0002.png/ http://img695.imageshack.us/f/scedit0003.png/ http://img838.imageshack.us/f/scedit0004.png/ http://img243.imageshack.us/f/scedit0005.png/ http://img340.imageshack.us/f/scedit0006.png/
Now, you can probably tell I'm totally new to this by how I've done all this. I am, but once I learn a concept, I retain it. I just need help learning it.
ULTIMATELY, what I'm trying to achieve is something that works more like this:
There are 4 teams of 2 players each. Each player starts with a marine spawning at a point every 3 seconds. Players can pay minerals to upgrade their spawns by adding a war pig every 15 seconds or a marauder every 30 seconds. Other players can pay minerals to turn off portions (or all) of another players spawn (either indefinitely or temporarily).
I know there's a better way to write this code and I think it has something to do with Booleans(?) or Arrays(?) but I don't know what they are or how to use them. Perhaps maybe there's a much better way I don't know about. I guess what I need is a way to dynamically turn spawns on and off in game by paying minerals at your command center.
Can someone help me with a tutorial for this? And if someone would be willing to actually tutor me and help me with the entire map I'd be grateful for that also. I have a lot more concepts for the map as a whole and will have to learn all kinds of things to finish it.
Thanks.
Do something like this:
War Pig Spawn
Every 15 seconds of Game Time
Pick Each Player in (Active Players)
If
Conditions
Upgrade Level Of (War Pig Upgrade) for (Picked Player) > 0
Actions
[Put your spawn code here]
As you can see it's much easier to have a single trigger that iterates through all active players than to make a separate trigger for each player. That would be exceedingly time consuming.
You're going to have to go deeper than that I'm afraid.
@Endureth:
If you're having trouble with that I think rather than trying to make your own map for now you'd be best served finding and following some of the very basic tutorials available.
Firt you need to understand if that if many players work the same way, you don't need to repeat the code for each one, as each player is referenced with a number, and you can use many loops to do the work for you.
For example if you wanna spawn a marine each 3 seconds, you can do:
That way you don't have to copy/paste the same code 8 times, one per player. Spawn Point is the point where do you wanna them to spawn. As is variable with players, you need to use an array (search a tutorial if you want). In that variable, in each slot you'll have the point you want. For example in Spawn Point[1] you save the point for player 1, and so on.
Then, for the upgrades, I suposse you'll save the upgrades in an array variable, so you simply check that variable, for example:
Thanks for that FrodoBolson. I think I might understand a little better now, I played around with it using your advice. I got it to work.
Is there any way to condense this even more? Here's what all that mess has been shortened to:
http://img33.imageshack.us/f/scedit0001.png/ http://img841.imageshack.us/f/scedit0002.png/ http://img440.imageshack.us/f/scedit0003.png/ http://img826.imageshack.us/f/scedit0004.png/ http://img693.imageshack.us/f/scedit0005.png/ http://img835.imageshack.us/i/scedit0006.png/
Next, I'd like to do this:
There are two variables that are booleans, Heavy_Guard_Upgrade and Armored_Guard_Upgrade. Currently, they are both set to true. I'd like to set them initially to false instead. Then I'd like to have purchasable upgrades at the Guard Posts (Command Centers) that, when purchased turned on the spawning of these units by changing the value for that play to true.
Could any one possibly lead me in the right direction on what I need to learn next to be able to do this?
Thanks in advance.