| 08-17-2003, 01:09 PM | #1 |
Respawning Children Events Game - The in-game time of day becomes Equal to 6.00 Conditions Actions If ((Number of units in (Units in Region 047 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 047 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 114 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 114 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 050 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 050 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 051 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 051 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 147 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 147 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 146 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 146 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 148 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 148 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 137 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 137 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 138 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 138 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 065 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 065 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 068 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 068 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 066 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 066 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 071 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 071 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 044 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 044 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 119 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 119 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 121 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 121 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 120 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 120 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 117 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 117 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 098 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 098 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 089 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 089 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 086 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 086 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 081 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 081 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 063 <gen>)) Equal to 0) then do (Unit - Create 4 Child for Neutral Hostile at (Center of Region 063 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 215 <gen>)) Equal to 0) then do (Unit - Create 1 Peon for Neutral Hostile at (Center of Region 215 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 243 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 243 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 240 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 240 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 241 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 241 <gen>) facing (Position of (Last created unit))) else do (Do nothing) If ((Number of units in (Units in Region 242 <gen>)) Equal to 0) then do (Unit - Create 1 Child for Neutral Hostile at (Center of Region 242 <gen>) facing (Position of (Last created unit))) else do (Do nothing) This trigger is an old trigger of my map that im revamping, what it basically does is this each action trigger checks a separate region that I want children to spawn at, each trigger will see if there are 0 units in the region, then if there is 0 then an amount of children will be created there (1 child 2 at most) anyone know of a way to simplify this? thanks for any help |
| 08-17-2003, 04:11 PM | #2 |
Guest | Yea all you have to do i sput all the regions in an array then using an Integer A statement call them all and your code will be shortened by like 100 lines. |
| 08-17-2003, 04:42 PM | #3 |
That is true. However, as for actual gameplay efficiency, that'd wouldn't do anything really- same result. Though it'd be nice and pretty compared to that in triggers. |
| 08-17-2003, 05:03 PM | #4 |
Guest | I didn't realize you wanted it to be smaller in game play i just though you meant the trigger size. |
| 08-17-2003, 05:19 PM | #5 |
lol no all I need is a simpler way of doing these triggers, it sux editing 100 or so triggers for this when there could be an easier possible 1 line way coolaboy don't I have to make an action trigger for everyone of the regions to be added into the array? so I still have alot of clicking to do damn lol. ok I will try the array way should be somewhat less work |
| 08-17-2003, 06:33 PM | #6 |
Guest | The array is the only solution to shorting your triggers yes you do have to do the clicking to set them up but then if you every need to change your triggers you only have to change one instead of 28 |
| 08-17-2003, 06:41 PM | #7 |
This is what coolaboy was trying to tell you about. Code:
Spawn Creeps
Events
Time - Every 50.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to CreepRegionsAmount, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units in CreepRegionsArray[(Integer A)] owned by Neutral Hostile)) Equal to 0
Then - Actions
Unit - Create CreepAmountArray[(Integer A)] (Random level CreepLevelArray[(Integer A)] creep unit-type) for Neutral Hostile at (Center of CreepRegionsArray[(Integer A)]) facing CreepRotation[(Integer A)] degrees
Else - Actions
Do nothingCreepRegionsAmount is simply the amount of places the creeps spawn. CreepRegionsArray is an array of all the different regions that they spawn CreepAmountArray is how many creeps to spawn CreepLevelArray is the level of the creep you want to spawn(unnecessay for you maybe, but mine spawns creeps randomly based on level). CreepRotation is which direction you want them to face. Just put a unit-type array variable in your array definition that tells which unit-type you want for your creep. |
| 08-17-2003, 06:50 PM | #8 |
Guest | Thank you for writing that down i would have done it myself but i'm very busy with the maps i'm working on. |
| 08-17-2003, 08:25 PM | #9 |
Simple copy and paste, with explainations, from my map =) |
| 08-18-2003, 02:37 AM | #10 |
zoizite so if I need to have an array looping trigger to spawn 1 child and 2 children then I have to have a looping trigger for regions that will spawn 1 child and another looping trigger for regions that spawn 2 children? cool I think I got it will get to work on this right away ty much for the help |
| 08-18-2003, 04:04 AM | #11 |
CreepAmountArray - this is how many to spawn in that particular region. I think this is what you are looking for. Sorry if I didn't explain it well enough. |
| 08-18-2003, 04:06 AM | #12 |
Code:
Creep Array
Events
Map initialization
Conditions
Actions
Set x = 1
Set CreepRegionsAmount = 1
Set CreepRegionsArray[x] = Creep Goblin Merchant Human <gen>
Set CreepLevelArray[x] = 3
Set CreepAmountArray[x] = 3
Set CreepRotation[x] = 270.00
Set x = (x + 1)
Set CreepRegionsAmount = (CreepRegionsAmount + 1)
Set CreepRegionsArray[x] = Creep Goblin Merchant UD <gen>
Set CreepLevelArray[x] = 3
Set CreepAmountArray[x] = 3
Set CreepRotation[x] = 90.00
Set x = (x + 1) |
| 08-18-2003, 09:52 AM | #13 |
yea i got it zoi thank you much you never confused me no worries thanks for all the help you guys |
| 08-24-2003, 09:12 AM | #14 |
Hi Zoizite I need to ask you something... I have tried what you said but I have a few problems.... so I was wondering if you could check to see what is wrong with my triggers if you wouldn't mind... Problem 1) The creeps don't re-spawn after death Problem 2) 6 creeps spawn instead of only 3... Question/problem - how do u cap the creep level e.g. I don't want any creep above level 6 to spawn at all anywhere.... Here are my triggers Event Map initialization Time- every 50.00 seconds of game time For each (Integer A) from 1 to 4, do (Actions) Loop – Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Number of units in (Units in Creeps Camp 1 <gen>)) Equal to 0 (Number of units in (Units in Creeps Camp 2 <gen>)) Equal to 0 (Number of units in (Units in Creeps Camp 3 <gen>)) Equal to 0 (Number of units in (Units in Creeps Camp 4 <gen>)) Equal to 0 Then - Actions Unit - Create (3 + (Integer A)) (Random level (6 + (Integer A)) creep unit-type) for Neutral Hostile at (Center of Creeps Camp 1 <gen>) facing 270.00 degrees Unit - Create (3 + (Integer A)) (Random level (6 + (Integer A)) creep unit-type) for Neutral Hostile at (Center of Creeps Camp 2 <gen>) facing 90.00 degrees Unit - Create (3 + (Integer A)) (Random level (6 + (Integer A)) creep unit-type) for Neutral Hostile at (Center of Creeps Camp 3 <gen>) facing 0.00 degrees Unit - Create (3 + (Integer A)) (Random level (6 + (Integer A)) creep unit-type) for Neutral Hostile at (Center of Creeps Camp 4 <gen>) facing 90.00 degrees Else - Actions Do nothing i hope you can help thanks. |
| 08-24-2003, 02:39 PM | #15 |
I made a region array of 260 odd regions, that scans 10, then waits for 0.5 seconds.... It runs permenantly in the background, once the loop has executed, it calls the trigger again. Works fine, I don't even know it's there.... Although, I am still testing latency online with 3-4 people... i think the lag may be comming from the 800 creeps that spawn if there are lots of people in the game, rather than the "thread" :) Stevil ALL The conditions need to be true so all the camps need to be dead before the trigger refires.. i'm assuming that you want it to respawn each camp if they die... 2nd: after the first loop, the conditions will not pass, as there will be units created in the regions that you are testing. 3rd: You are adding integer A to the number of spawners... it SHOULD be 3+1 minimum, and up to 3+4 maximum. ALthought I cannot see why you would be getting six. Cata |
