Page 1 of 1

Kill one unit = create a whole bunch How??

Posted: Wed Aug 20, 2008 10:48 am
by lobski
Basically, I want every Overlord made from a larvae to die, and converted into Drones, which get created at a location I've written down. It works fine when I make overlords one at a time, but when I make more then 2 or more at the same time, only one drone appears. I want the same number of drones to be created! Not just one...

Here is my code:


Trigger("Player 1"){
Conditions:
Bring("Player 1", "Zerg Overlord", "entire", At least, 1);

Actions:
Kill Unit("Player 1", "Zerg Overlord");
Create Unit("Player 1", "Zerg Drone", 0, "Location 0");
Comment("You got a Drone!");
Preserve Trigger();
}





Anything I can do to make the game spawn the same number of overlords that has been made and killed?

Re: Kill one unit = create a whole bunch How??

Posted: Wed Aug 20, 2008 11:23 am
by Lavarinth
No where in your trigger did you mention Larvae.. So I'm going to make it easier and assume your trigger only means "bring Overlord here, create Drone over here." Must simpler. Have you attempted created the trigger with switches and actual locations?

Such as.. Condition:
- Player 1 has at least 1 Overlord
- Switch Kill Overlord is Off
Action:
- Move Location "Overlord Location" to Overlord
- Turn On switch Kill Overlord
- Preserve Trigger

Condition:
-Switch Kill Overlord is On
Action:
- Kill 1 Unit Overlord at "Overlord Location"
- Create 1 Unit Drone at "Location 0"
- Comment "You got a Drone!"
- Turn Off switch Kill Over
- Preserve Trigger

There's probably something wrong and I'm missing something here.

Re: Kill one unit = create a whole bunch How??

Posted: Wed Aug 20, 2008 2:32 pm
by Thalraxal
Use the 'Kill Unit at Location' action instead of the 'Kill Unit'.  The 'Kill Unit' action kills all units of that type.  So when your trigger fires, it kills both Overlords, but only gives you one drone, since the trigger only fired once.

With the 'Kill Unit at Location' you can specify a number of units you kill with it.  Set that to one, and you shouldn't have any problem.  Well... other then that second Overlord sticking around for two seconds or until the trigger fires again.

Conditions:
Player 1 Brings atleast '1' 'Zerg Overlord' to 'Entire''

Actions:
Kill '1' 'Zerg Overlord' owned by 'Player 1' at 'Anywhere'
Create '1' 'Zerg Drone' at 'Location 0'
Preserve Trigger

Re: Kill one unit = create a whole bunch How??

Posted: Wed Aug 20, 2008 9:18 pm
by lobski
I fixed it by myself, I used "Remove unit" instead of kill, and added a timer to wait before creating a drone. Now it works  :-*


Is there a list of commands like "remove unit" or "Move unit" in starcraft that I can take a look at?

Re: Kill one unit = create a whole bunch How??

Posted: Wed Aug 20, 2008 10:02 pm
by Taeradun
yeah in StarEdit in the trigger editor in the pull-down menu :P

[imgwh 462x287]http://i34.tinypic.com/2dskaiv.jpg[/imgwh]

alternately click the "help" button in that window