I've gone through some tutorials on variables but for some reason I just can't get to the point where I can think"I want to do this" and just do it. I have to do things step by step the way they are done in the tutorial.
Anyways here is the issue I need help will, you'll mostly likely laugh at me.
I want a variable to count how many a type of unit are on the field. So if there are 30 zerglings for player 2 the variable will equal 30.
Then*and i can do this part* I make a condition i my spawner that says , spawn a ling every 5 seconds if there is equal or less than 29 lings.
But no matter what I do I can't just set a variable. I try setting it to count a unit group. and then I tried to add all lings on the map to that unit group every 0.1 seconds. but that's not working.
please help this noob with this stupidly easy task : (
Ok this is fairly simple, but I will explain the process.
Event - The trigger event is fired off a timer, I'm not sure what you are wanting to trigger this, that is up to you Local Variables - One Local Variable needed here, and that is a type unit group local variable
Condition - There is no condition to run this trigger Actions
- First of all we pick all the units of type zergling owning to player one in the entire map and add them into a local variable unit group, which I called "Zergling Group"
- After that has run we use a general "if then else" with the if checking to see whether the number of units in our "zergling unit group" is less then or equal to 29
- If this statement is true, then we create a zergling, if its not, which means we have 30 or more zerglings, the trigger will do nothing
Ok this is fairly simple, but I will explain the process.
Event - The trigger event is fired off a timer, I'm not sure what you are wanting to trigger this, that is up to you
Local Variables - One Local Variable needed here, and that is a type unit group local variable Condition - There is no condition to run this trigger
Actions
- First of all we pick all the units of type zergling owning to player one in the entire map and add them into a local variable unit group, which I called "Zergling Group"
- After that has run we use a general "if then else" with the if checking to see whether the number of units in our "zergling unit group" is less then or equal to 29
- If this statement is true, then we create a zergling, if its not, which means we have 30 or more zerglings, the trigger will do nothing
OMG I get it now you don't have to put condition in the "Conditions" spot above actions. You can put them below actions, and the order is important! Some how the tutorials that were really really basicly didn't make this super clear. Thanks : )
also thanks for going through it step by step and not assuming I knew what I was doing : ) It was great that you took the extra time. : )
I lost my programer for my map, so I'm going out on my own to finish it :P
yes think of triggers like a recipe, your going to read through it and do it in order.
the conditions at the top checks to see whether the actions should be run or not. if it fails the main conditions nothing will happen. Same goes for a recipe, if you don't have the right ingredients your not going to continue :P
you can also create several conditions through the trigger using "if then else" statements.
best of luck with your map, don't hesitate to ask questions :)
yes think of triggers like a recipe, your going to read through it and do it in order.
the conditions at the top checks to see whether the actions should be run or not. if it fails the main conditions nothing will happen. Same goes for a recipe, if you don't have the right ingredients your not going to continue :P
you can also create several conditions through the trigger using "if then else" statements.
best of luck with your map, don't hesitate to ask questions :)
Thanks! I will do so : )
the biggest eyeopening was finding that in the actions menu -General and General have different actions >.< lol
I've posted up a list of everything 'm going to try to accomplish this summer in the team recruitment section.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've gone through some tutorials on variables but for some reason I just can't get to the point where I can think"I want to do this" and just do it. I have to do things step by step the way they are done in the tutorial.
Anyways here is the issue I need help will, you'll mostly likely laugh at me.
I want a variable to count how many a type of unit are on the field. So if there are 30 zerglings for player 2 the variable will equal 30.
Then*and i can do this part* I make a condition i my spawner that says , spawn a ling every 5 seconds if there is equal or less than 29 lings.
But no matter what I do I can't just set a variable. I try setting it to count a unit group. and then I tried to add all lings on the map to that unit group every 0.1 seconds. but that's not working.
please help this noob with this stupidly easy task : (
Ok this is fairly simple, but I will explain the process.
Event - The trigger event is fired off a timer, I'm not sure what you are wanting to trigger this, that is up to you
Local Variables - One Local Variable needed here, and that is a type unit group local variable Condition - There is no condition to run this trigger
Actions
- First of all we pick all the units of type zergling owning to player one in the entire map and add them into a local variable unit group, which I called "Zergling Group"
- After that has run we use a general "if then else" with the if checking to see whether the number of units in our "zergling unit group" is less then or equal to 29
- If this statement is true, then we create a zergling, if its not, which means we have 30 or more zerglings, the trigger will do nothing
OMG I get it now you don't have to put condition in the "Conditions" spot above actions. You can put them below actions, and the order is important! Some how the tutorials that were really really basicly didn't make this super clear. Thanks : )
also thanks for going through it step by step and not assuming I knew what I was doing : ) It was great that you took the extra time. : )
I lost my programer for my map, so I'm going out on my own to finish it :P
yes think of triggers like a recipe, your going to read through it and do it in order.
the conditions at the top checks to see whether the actions should be run or not. if it fails the main conditions nothing will happen. Same goes for a recipe, if you don't have the right ingredients your not going to continue :P
you can also create several conditions through the trigger using "if then else" statements.
best of luck with your map, don't hesitate to ask questions :)
Thanks! I will do so : )
the biggest eyeopening was finding that in the actions menu -General and General have different actions >.< lol
I've posted up a list of everything 'm going to try to accomplish this summer in the team recruitment section.