I'm still pretty new to the SCII editor and I've been having trouble with what should be a simple task. The goal is to use two triggers to spawn 10 zerglings underground and have them unburrow in the specified region and to spawn additional zerglings to replace any zerglings that are killed.
First Trigger
Event
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Room Aliens < 9
Actions
Unit - Create 1 Zergling (Burrowed) for player 1 at (Random point in Room) using default facing (No Options)
Unit Group - Add (Last created unit) to Aliens
Unit - Order (Last created unit) to (Zergling - Unburrow) (Replace Existing Orders)
Variable - Modify Room Aliens: + 1
Second Trigger
Events
Unit - Any Unit dies
Local Variables
Conditions
((Triggering unit) is in Aliens) == true
Actions
Variable - Modify Room Aliens: - 1
I think the problem is that the zerglings are not being added to the unit group "Aliens" but I don't know how to fix it.
Also, how can you tell if you are using the beta version of the SCII editor?
Comparison
Value 1: Number Of Units In Unit Group
Type: Living
Unit Group: Units In Region Matching Condition
Unit Type: Any
Region: RoomAliens
Player: 1
Unit Filter: Excluded: Missile, Dead, Hidden, Invulnerable
Count: Any Amount
Operator: <
Value 2: 9
__________________________________________________________________________________________
Instead of using second trigger just use this as your condition for first trigger
Thanks for the quick reply but that doesn't do exactly what I hoped for. While the zerglings do respawn when they die. Additional zerglings also spawn if the original zerglings leave the region. I want additional zerglings to spawn only when a zergling that is guarding the room is killed that way the total number of zerglings will always be the same.
The thing is, I intend to have multiple rooms each with their own group of zerglings. I was planning for each room to have 10 zergling guards and that if a zergling were to die then it would be replaced in the room it was guarding. But I've found a way to fix the problem if the zerglings left the room. I've made a trigger that will kill any extra zergling in the room so that if the original guards returned and there were now too many zerglings it would automatically bring down the number of guards. Thanks for your help.
You can try adding every zergling you've created in that room to a unit group (a variable called zergling_room1 or something like that) and then base the conditions of your spawn event on how many units are left in that unit group.
Why are you using the beta version of the editor? Whatever... Try something like picking each zergling in the room and setting the variable to that. It might work better.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
@ChronoHydralisk: Go
That's what the triggers in my first post were based around. They would keep track of the number of units in the unit group "Aliens" through the variable "Room Aliens". The problem was that the zerglings weren't being added to the unit group for some reason.
@zeldarules28: Go
I had the beta editor before the game released and now I don't know how to find out if I'm still using it.
Are the models for the heros there? Such as Jim Raynor. If not your using the old one; go to your SC2 folder and use that one instead of the beta one. You should actually uninstall the beta to completely stop any future confusion.
I'm still pretty new to the SCII editor and I've been having trouble with what should be a simple task. The goal is to use two triggers to spawn 10 zerglings underground and have them unburrow in the specified region and to spawn additional zerglings to replace any zerglings that are killed.
First Trigger
Event
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Room Aliens < 9
Actions
Unit - Create 1 Zergling (Burrowed) for player 1 at (Random point in Room) using default facing (No Options)
Unit Group - Add (Last created unit) to Aliens
Unit - Order (Last created unit) to (Zergling - Unburrow) (Replace Existing Orders)
Variable - Modify Room Aliens: + 1
Second Trigger
Events Unit - Any Unit dies
Local Variables
Conditions ((Triggering unit) is in Aliens) == true
Actions Variable - Modify Room Aliens: - 1
I think the problem is that the zerglings are not being added to the unit group "Aliens" but I don't know how to fix it.
Also, how can you tell if you are using the beta version of the SCII editor?
Comparison
Value 1: Number Of Units In Unit Group
Type: Living
Unit Group: Units In Region Matching Condition
Unit Type: Any
Region: RoomAliens
Player: 1
Unit Filter: Excluded: Missile, Dead, Hidden, Invulnerable
Count: Any Amount
Operator: <
Value 2: 9
__________________________________________________________________________________________
Instead of using second trigger just use this as your condition for first trigger
Thanks for the quick reply but that doesn't do exactly what I hoped for. While the zerglings do respawn when they die. Additional zerglings also spawn if the original zerglings leave the region. I want additional zerglings to spawn only when a zergling that is guarding the room is killed that way the total number of zerglings will always be the same.
@Jeetestu:
If you always want set number of zerglings, switch the region to entire map and unit type to zerglings
@Feldeat: Go
The thing is, I intend to have multiple rooms each with their own group of zerglings. I was planning for each room to have 10 zergling guards and that if a zergling were to die then it would be replaced in the room it was guarding. But I've found a way to fix the problem if the zerglings left the room. I've made a trigger that will kill any extra zergling in the room so that if the original guards returned and there were now too many zerglings it would automatically bring down the number of guards. Thanks for your help.
You can try adding every zergling you've created in that room to a unit group (a variable called zergling_room1 or something like that) and then base the conditions of your spawn event on how many units are left in that unit group.
Why are you using the beta version of the editor? Whatever... Try something like picking each zergling in the room and setting the variable to that. It might work better.
@ChronoHydralisk: Go That's what the triggers in my first post were based around. They would keep track of the number of units in the unit group "Aliens" through the variable "Room Aliens". The problem was that the zerglings weren't being added to the unit group for some reason.
@zeldarules28: Go I had the beta editor before the game released and now I don't know how to find out if I'm still using it.
Are the models for the heros there? Such as Jim Raynor. If not your using the old one; go to your SC2 folder and use that one instead of the beta one. You should actually uninstall the beta to completely stop any future confusion.
@7MM3: Go
Got it. Thanks.