i am currently making a map and just starting to work on the triggers for it. my question is: is there a limit to how many triggers you can create? reason i ask is because on the map im creating the triggers will go in sequence. 1,2,3,4,5,6,7,8... EG: unit A dies spawn unit B... unit B dies Spawn unit C... and so on. just wondering if there is a limit to how many you can create. 1,000? 10,000? 1m? LOL.
i already got the map size and terrain worked out already, just wanted to know if there was a limit on how many triggers i could create. not that all of them would fire at 1 time, that would simply crash the game, lol. another question is: can you Que a Gateway threw tirggers? if so thats awesome. haha. makes it better than an IFFY computer AI to build whats needed, to make the game atleast challenging.
right now im looking at 90triggers as a START. each one firing at different times because they are based on a unit that dies. so at most you might get 2 to fire in close timming if they both die at the same time. this is why i asked if there is a limit, lol.
There is an overall script memory limit, this includes triggers. Also there might be a separate limit for triggers. However, if you create your triggers per hand, you will most likely not reach it anytime soon, stuff like units are limited at 16.384, triggers could possibly be limited to a similar amount.
Also, there are most likely better solutions to your problem than creating a new trigger for every single new unit. I don't know your map, but you could probably use a single trigger and a database of unit types with associated indexes and whenever a unit dies, look up the index and spawn a unit of index+1 or something similar.
i have different buildings around the map and when said building, say hatchery, dies i want to create a unit at a location.. if i have it so every time a hatchery dies it spawns at same location every time.. need another trigger for a different location~ guessing~.... location A,B,C,D. depending on what hachery just died... a hatchery that died on one side of the map as oppose to another on the other side..
Hatchery "a" dies----spawn unit at location 'a'
Hatchery "b" dies--- Spawn unit at location 'b'
Well, even better. In this case, I would assign an index to each hatchery (possibly store it in the hatchery's custom value), then set up an array of points using the index of the hatchery as array index, so you can access the point directly from the dying unit:
//set up the hatcheries and points at map initializationEventsMapInitializationActionsPointArray[1]=location'a'SetCustomValueofHatchery"a"=1PointArray[2]=location'b'SetCustomValueofHatchery"b"=2...//the unit spawn triggerEventsAnyunitdiesConditionsUnittypeof(triggeringunit)=HatcheryActionsCreate1(whateveryouneed)atPointArray[CustomValueof(TriggeringUnit)]
If you place them in order within the editor, you can even abuse UnitFromId and PointFromId and a loop to save yourself the trouble of setting up all points individually.
pointArray location
--Variable - Set Untitled Variable 001[1] = (Center of Region 001)
can not find--- Set Custom Value of Hatchery "a" = 1..
best i can come up with is : Variable - Set Hatchery[1] = (Position of Hatchery [124.50, 189.50])
or is it the same differance? lol.
here is a good question for ya.... can you add a created unit to an array? meaning its not added in already when you start the game..
Example: create 1 hatchery at location Z add hatchery at location Z to point array??? if so, this is going to get sick on this map... so far all i know is to add the units already placed on map to an array. but to add a created unit to the array, i dont know~
Unit - Create 1 Hatchery for player 1 at (Center of Region 001) using default facing (No Options)
Variable - Set Hatchery[##] = (Position of (Last created unit))
Unit - Create 1 Hatchery for player 1 at (Center of Region 001) using default facing (No Options)
Variable - Set Hatchery[##] = (Position of (Last created unit))
Yeah, that would work. You just use set variable and it overwrites that index. You would probably need to save both the location and unit itself in separate variables.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
well i got this worked out.. turns out i found an easier way, :D.
Events
Unit - Any Unit dies
Local Variables
Conditions
(Unit type of (Triggering unit)) == Nexus
Actions
Region - Move Nexus to (Position of (Triggering unit))
Unit - Create 1 Unit for player (Triggering player) at ((Center of Nexus) offset by (0.0, -2.0)) using default facing (Ignore Placement)
this way ANY nexus that dies it will run this trigger and spawn units with an offset to the location.
as to what the map is going to be. its a 10players VS 4AIComputers. the more you kill the more they spawn. :O. the good part is there is a limit to what spawns and how many times. this also keeps 90% of the map empty till you start attacking. to fill the map with units on load would more than likely take 10minutes to load or lag people out, lol. 1st comp is protoss, 2nd is terran, 3rd is zerg, 4th is all 3 with an AI. will be checking out the develope AI forum later when i get to the last comp, :P. IF you want you can put SOLVED on this post being i got it. :D thank you.
In this case, why even move a region? You could just use "Create 1 Unit at Position of (Triggering Unit)..."
If you had mentioned, that the point should be always the position of the dying unit with an offset, we could have suggested this earlier ;) My approach was for units spawned at a specific location, which is not necessarily related to the position of the Nexus.
lol its ok i didnt think of it till later as well... i was thinking... HOLY SHIT THIS IS GOING TO BE AN EPIC AMOUNT OF TRIGGERS!!!! anyways. haha. WAS thinking put a location for each building then when 0 units are found at said location to spawn at another location. OMFG 200+ triggers! naaa F that..
i moved a location to the dying unit so i can tell it where to spawn another in relation to that unit. dont want to spawn in exact same spot as dying unit. thats why the offset of location is used. oh and i completely understand where what you where saying. its ok! :D tanks for the help.
Its like dr.house he dont come to the conclusion till the end of the show~ LOL!!!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
i am currently making a map and just starting to work on the triggers for it. my question is: is there a limit to how many triggers you can create? reason i ask is because on the map im creating the triggers will go in sequence. 1,2,3,4,5,6,7,8... EG: unit A dies spawn unit B... unit B dies Spawn unit C... and so on. just wondering if there is a limit to how many you can create. 1,000? 10,000? 1m? LOL.
Probably not, I used my copy pasting skills to test so. But there IS a map size limit.
@Doubleclick123:
i already got the map size and terrain worked out already, just wanted to know if there was a limit on how many triggers i could create. not that all of them would fire at 1 time, that would simply crash the game, lol. another question is: can you Que a Gateway threw tirggers? if so thats awesome. haha. makes it better than an IFFY computer AI to build whats needed, to make the game atleast challenging.
right now im looking at 90triggers as a START. each one firing at different times because they are based on a unit that dies. so at most you might get 2 to fire in close timming if they both die at the same time. this is why i asked if there is a limit, lol.
There is an overall script memory limit, this includes triggers. Also there might be a separate limit for triggers. However, if you create your triggers per hand, you will most likely not reach it anytime soon, stuff like units are limited at 16.384, triggers could possibly be limited to a similar amount.
Also, there are most likely better solutions to your problem than creating a new trigger for every single new unit. I don't know your map, but you could probably use a single trigger and a database of unit types with associated indexes and whenever a unit dies, look up the index and spawn a unit of index+1 or something similar.
@Kueken531:
i have different buildings around the map and when said building, say hatchery, dies i want to create a unit at a location.. if i have it so every time a hatchery dies it spawns at same location every time.. need another trigger for a different location~ guessing~.... location A,B,C,D. depending on what hachery just died... a hatchery that died on one side of the map as oppose to another on the other side..
Hatchery "a" dies----spawn unit at location 'a'
Hatchery "b" dies--- Spawn unit at location 'b'
Well, even better. In this case, I would assign an index to each hatchery (possibly store it in the hatchery's custom value), then set up an array of points using the index of the hatchery as array index, so you can access the point directly from the dying unit:
If you place them in order within the editor, you can even abuse UnitFromId and PointFromId and a loop to save yourself the trouble of setting up all points individually.
Does this make sense to you?
@Kueken531:
pointArray location
--Variable - Set Untitled Variable 001[1] = (Center of Region 001)
can not find--- Set Custom Value of Hatchery "a" = 1..
best i can come up with is : Variable - Set Hatchery[1] = (Position of Hatchery [124.50, 189.50])
or is it the same differance? lol.
here is a good question for ya.... can you add a created unit to an array? meaning its not added in already when you start the game..
Example: create 1 hatchery at location Z add hatchery at location Z to point array??? if so, this is going to get sick on this map... so far all i know is to add the units already placed on map to an array. but to add a created unit to the array, i dont know~
Unit - Create 1 Hatchery for player 1 at (Center of Region 001) using default facing (No Options)
Variable - Set Hatchery[##] = (Position of (Last created unit))
would that work? :D
Yeah, that would work. You just use set variable and it overwrites that index. You would probably need to save both the location and unit itself in separate variables.
well i got this worked out.. turns out i found an easier way, :D.
Events
Unit - Any Unit dies
Local Variables
Conditions
(Unit type of (Triggering unit)) == Nexus
Actions
Region - Move Nexus to (Position of (Triggering unit))
Unit - Create 1 Unit for player (Triggering player) at ((Center of Nexus) offset by (0.0, -2.0)) using default facing (Ignore Placement)
this way ANY nexus that dies it will run this trigger and spawn units with an offset to the location.
as to what the map is going to be. its a 10players VS 4AIComputers. the more you kill the more they spawn. :O. the good part is there is a limit to what spawns and how many times. this also keeps 90% of the map empty till you start attacking. to fill the map with units on load would more than likely take 10minutes to load or lag people out, lol. 1st comp is protoss, 2nd is terran, 3rd is zerg, 4th is all 3 with an AI. will be checking out the develope AI forum later when i get to the last comp, :P. IF you want you can put SOLVED on this post being i got it. :D thank you.
In this case, why even move a region? You could just use "Create 1 Unit at Position of (Triggering Unit)..."
If you had mentioned, that the point should be always the position of the dying unit with an offset, we could have suggested this earlier ;) My approach was for units spawned at a specific location, which is not necessarily related to the position of the Nexus.
@Kueken531:
lol its ok i didnt think of it till later as well... i was thinking... HOLY SHIT THIS IS GOING TO BE AN EPIC AMOUNT OF TRIGGERS!!!! anyways. haha. WAS thinking put a location for each building then when 0 units are found at said location to spawn at another location. OMFG 200+ triggers! naaa F that..
i moved a location to the dying unit so i can tell it where to spawn another in relation to that unit. dont want to spawn in exact same spot as dying unit. thats why the offset of location is used. oh and i completely understand where what you where saying. its ok! :D tanks for the help.
Its like dr.house he dont come to the conclusion till the end of the show~ LOL!!!