| 07-06-2003, 03:39 PM | #1 |
I am trying to make a creep zone that will respawn said creeps at their location. I set aside player 11 to be the creeps and created a new region called "Gnollcamp1", which will serve as our point where they will respawn. Attempt I... Events: A Unit owned by Player 11 (dark green) dies Conditions: (dying unit) is in region (Gnollcamp1) Actions: Wait Random Real Number between 120 and 240 Seconds. Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Taskmaster at region (Gnollcamp1) Now this was not working for several reasons. Killing just one of the creeps made 4 of them spawn, effectively meaning eventually the region would be littered with them (bad). Also, players could lure the creeps away from the region and the trigger would not fire of course because the creeps would not be at said location Gnollcamp1 anymore. This was also bad because I wanted the player to clear all the creeps and only then should they come back. Attempt II... To try and fix the many problems with Attempt I, I decided to use unit groups. By using a unit group I could ensure that all the creeps had to die, and the trigger would work regardless of where the creep was, even if a player lured it away from the region. Events: A Unit owned by Player 11 (dark green) dies Conditions: All units in Unit Group (Gnolls1) are (dead) equal to true Actions: Wait Random Real Number between 120 and 240 Seconds. Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Taskmaster at region (Gnollcamp1) Pick every unit in region (Gnollcamp1) owned by (Player 11) and do Unit Group - Add picked unit to unit group (Gnolls1). This method required me to create a second trigger that would set up the unit group for the first time. Events: Elapsed game time is 5.0 seconds Conditions: Actions: Remove all units from unit group Gnolls1 Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Gnoll at region (Gnollcamp1) Unit - Create 1 Taskmaster at region (Gnollcamp1) Pick every unit in region (Gnollcamp1) owned by (Player 11) and do Unit Group - Add picked unit to unit group (Gnolls1). However, this too failed. For a reason I can not see, after a unit group is killed off the first time, they just keep spawning until there is tons of them. If anyone has had this problem before or has a suggestion on how I could make it work plz post. Here's a screenshot of my RPG :D ![]() |
| 07-06-2003, 03:50 PM | #2 |
Okay, you'll have to either just use regular gnolls or base a new custom one for this on another unit. Now, Spawn these (It's not 3 seperate spawn triggers, it's 1...) So... "If (Dying unit) = Unit-Type (SpecialGnoll) spawn 1 Gnoll at XX for player X else do nothing" You'll have to do this for all units you may want in the region. If you only use gnolls for this, you can of course use the original Gnoll for this. But I am almost certain you are not... This is the easiest, if I understood what you meant... It was a little blurry... Regards |
| 07-06-2003, 05:08 PM | #3 |
i dunno, based on what u said this is what i would do: Event: Map Init Actions: For each integer A - 0 to 2 +Loop ++Create 1 Gnoll for P11 at random point in region (regX) ++Add last created unit to unit group (ugY) Create 1 Gnoll Taskmaster at random point in region (regX) Add last created unit to unit group (ugY) Event: A unit owned by P11 dies Conditions: All units in unit group (ugY) are dead Dying unit is in unit group (ugY) //optional (just as a safety in case the trigger gets ran some other time before the trigger is done) boolean (bSpawning) is false Actions: //optional set bSpawning = true //end optional Wait 120 to 240 seconds (I'm not a big fan of waits personally) //optional set bSpawning = false //end optional For each integer A - 0 to 2 +Loop ++Create 1 Gnoll for P11 at random point in region (regX) ++Add last created unit to unit group (ugY) Create 1 Gnoll Taskmaster at random point in region (regX) Add last created unit to unit group (ugY) since what i just wrote up looks an awful lot like ur original, i'd assume that its because other units are dying within the time that the unit-group is completely dead meaning the trigger will be ran multiple times |
