- Joined
- Dec 16, 2017
- Messages
- 437
Hi guys, i took a spawn system that is older on here and adjusted it to my needs ([System] Spawn System)
I use this system to spawn creeps from the main enemy player that attack every city after a certain time, and they drop rewards if players succesfully kill the creeps, if creeps however kill the "Captain" which is in the location they are sent to "Attack-Move", the game will end after about 30 seconds.
Now i am not sure about the second location in i make in CA_Start, shall i delete it or not?
In the template there are only 5 waves, but in my map there will be 18 levels(9 towns-each with 2 wave, one easy, one strong), also, what about the unit group, does it cause leak at some point? Or shall i delete it only after the last wave finished and not after each wave?
I want also to ask, how should i manage the items spawn when there are 0 units left in the wave, i somehow want to add the items in the init, and spawn them in the CA_Die when units are 0, but there will be more items droppable, let's say between 5-20 per wave (including tomes/gold/lumber/items).
I also want to add a custom text to appear when there are about 20 seconds for the city to be attacked, i tried to do the countdown left time = 20 > show text, but it didn't work that way.
I would like to make each city randomly get attacked, let's say they are divided from 1-9 (easy wave) and 10-18 (hard wave), how can i store them so first 9 waves are randomly waves but only easy creeps, and last 9 waves are randomly waves but only hard creeps? So the spawn take's randomly a number from 1 to 9, but then removes it from the next wave calculation.
I posted triggers and i also uploaded the system in case someone will need it(for first ver,credits to: Hashjie).
Later edit: Now i've seen it's posted in "World Editor Help Zone", can someone move it please into the "Triggers & Scripts" ? Thanks!
I use this system to spawn creeps from the main enemy player that attack every city after a certain time, and they drop rewards if players succesfully kill the creeps, if creeps however kill the "Captain" which is in the location they are sent to "Attack-Move", the game will end after about 30 seconds.
Now i am not sure about the second location in i make in CA_Start, shall i delete it or not?
In the template there are only 5 waves, but in my map there will be 18 levels(9 towns-each with 2 wave, one easy, one strong), also, what about the unit group, does it cause leak at some point? Or shall i delete it only after the last wave finished and not after each wave?
I want also to ask, how should i manage the items spawn when there are 0 units left in the wave, i somehow want to add the items in the init, and spawn them in the CA_Die when units are 0, but there will be more items droppable, let's say between 5-20 per wave (including tomes/gold/lumber/items).
I also want to add a custom text to appear when there are about 20 seconds for the city to be attacked, i tried to do the countdown left time = 20 > show text, but it didn't work that way.
I would like to make each city randomly get attacked, let's say they are divided from 1-9 (easy wave) and 10-18 (hard wave), how can i store them so first 9 waves are randomly waves but only easy creeps, and last 9 waves are randomly waves but only hard creeps? So the spawn take's randomly a number from 1 to 9, but then removes it from the next wave calculation.
I posted triggers and i also uploaded the system in case someone will need it(for first ver,credits to: Hashjie).
Later edit: Now i've seen it's posted in "World Editor Help Zone", can someone move it please into the "Triggers & Scripts" ? Thanks!
-
CA Init
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


-------- Testing purpose... --------
-


Visibility - Disable fog of war
-


Visibility - Disable black mask
-


-------- Define the wave level --------
-


Set VariableSet CA_LevelIndex = 1
-


-------- Define the last level of all spawns --------
-


Set VariableSet CA_MaxWavesLevel = 5
-


-------- Define the area's --------
-


Set VariableSet CA_SpawnArea[1] = Rect 000 <gen>
-


Set VariableSet CA_SpawnArea[2] = Rect 001 <gen>
-


Set VariableSet CA_SpawnArea[3] = Rect 002 <gen>
-


Set VariableSet CA_SpawnArea[4] = Rect 003 <gen>
-


-------- Define the attack area --------
-


Set VariableSet CA_AttackArea[1] = Region 004 <gen>
-


Set VariableSet CA_AttackArea[2] = Region 005 <gen>
-


Set VariableSet CA_AttackArea[3] = Region 006 <gen>
-


Set VariableSet CA_AttackArea[4] = Region 007 <gen>
-


-------- Define the type of the units --------
-


Set VariableSet CA_UnitType[1] = Dark Ranger
-


Set VariableSet CA_UnitType[2] = Firelord
-


Set VariableSet CA_UnitType[3] = Mountain King
-


Set VariableSet CA_UnitType[4] = Paladin
-


Set VariableSet CA_UnitType[5] = Blademaster
-


-------- Define the level of the units --------
-


Set VariableSet CA_UnitLevel[1] = 4
-


Set VariableSet CA_UnitLevel[2] = 3
-


Set VariableSet CA_UnitLevel[3] = 6
-


Set VariableSet CA_UnitLevel[4] = 5
-


Set VariableSet CA_UnitLevel[5] = 7
-


-------- Define which area the units should spawn --------
-


Set VariableSet CA_UnitSpawnLoc[1] = 1
-


Set VariableSet CA_UnitSpawnLoc[2] = 1
-


Set VariableSet CA_UnitSpawnLoc[3] = 2
-


Set VariableSet CA_UnitSpawnLoc[4] = 4
-


Set VariableSet CA_UnitSpawnLoc[5] = 3
-


-------- Define how many units should spawn --------
-


Set VariableSet CA_UnitLimit[1] = 5
-


Set VariableSet CA_UnitLimit[2] = 6
-


Set VariableSet CA_UnitLimit[3] = 7
-


Set VariableSet CA_UnitLimit[4] = 8
-


Set VariableSet CA_UnitLimit[5] = 9
-


-------- Define how long it takes untill the next spawn starts --------
-


Set VariableSet CA_UnitSpawnDelay[1] = 20.00
-


Set VariableSet CA_UnitSpawnDelay[2] = 23.00
-


Set VariableSet CA_UnitSpawnDelay[3] = 18.00
-


Set VariableSet CA_UnitSpawnDelay[4] = 16.00
-


Set VariableSet CA_UnitSpawnDelay[5] = 25.00
-


-------- Define the cooldown between units spawning --------
-


Set VariableSet CA_UnitSpawnCooldown[1] = 0.01
-


Set VariableSet CA_UnitSpawnCooldown[2] = 0.15
-


Set VariableSet CA_UnitSpawnCooldown[3] = 0.20
-


Set VariableSet CA_UnitSpawnCooldown[4] = 0.25
-


Set VariableSet CA_UnitSpawnCooldown[5] = 0.30
-


-------- Texts before wave --------
-


Set VariableSet CA_TextBefore[1] = Your city is about to be attacked in |cffff00ff20|r seconds!
-


Set VariableSet CA_TextBefore[2] = Your city is about to be attacked in |cffff00ff15|r seconds!
-


Set VariableSet CA_TextBefore[3] = Your city is about to be attacked in |cffff00ff11|r seconds!
-


Set VariableSet CA_TextBefore[4] = Your city is about to be attacked in |cffff00ff12|r seconds!
-


Set VariableSet CA_TextBefore[5] = Your city is about to be attacked in |cffff00ff21|r seconds!
-


-------- Run the start spawn trigger --------
-


Trigger - Run CA Start <gen> (checking conditions)
-
-
-
CA Start
-

Events
-

Conditions
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CA_UnitLimit[CA_LevelIndex] Greater than 0
-
-



Then - Actions
-




Set VariableSet CA_TempLoc = (Center of CA_SpawnArea[CA_UnitSpawnLoc[CA_LevelIndex]])
-




Special Effect - Create a special effect at CA_TempLoc using doodads\cinematic\ShimmeringPortal\ShimmeringPortal.mdl
-




Set VariableSet CA_PortalSFX = (Last created special effect)
-




Set VariableSet CA_TempLoc2 = (Center of CA_AttackArea[CA_UnitSpawnLoc[CA_LevelIndex]])
-




Unit - Create 1 CA_UnitType[CA_LevelIndex] for Player 12 (Brown) at CA_TempLoc facing Default building facing degrees
-




Set VariableSet CA_Unit = (Last created unit)
-




Special Effect - Create a special effect attached to the origin of CA_Unit using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
-




Special Effect - Destroy (Last created special effect)
-




Unit Group - Add CA_Unit to CA_UnitGroup
-




Set VariableSet CA_UnitGroupSize = (CA_UnitGroupSize + 1)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(CA_Unit is A Hero) Equal to True
-
-





Then - Actions
-






Hero - Set CA_Unit Hero-level to CA_UnitLevel[CA_LevelIndex], Hide level-up graphics
-
-





Else - Actions
-
-




Custom script: call RemoveLocation(udg_CA_TempLoc)
-




Unit Group - Order CA_UnitGroup to Attack-Move To CA_TempLoc2
-




Set VariableSet CA_UnitLimit[CA_LevelIndex] = (CA_UnitLimit[CA_LevelIndex] - 1)
-




Countdown Timer - Start CA_CooldownTimer as a One-shot timer that will expire in CA_UnitSpawnCooldown[CA_LevelIndex] seconds
-
-



Else - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






CA_LevelIndex Less than CA_MaxWavesLevel
-
-





Then - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Number of units in CA_UnitGroup) Equal to 0
-
-







Then - Actions
-








Countdown Timer - Start CA_SpawnTimer as a One-shot timer that will expire in CA_UnitSpawnDelay[CA_LevelIndex] seconds
-








Countdown Timer - Create a timer window for CA_SpawnTimer with title Next spawn in:
-








Set VariableSet CA_SpawnTimerWindow = (Last created timer window)
-








Countdown Timer - Show CA_SpawnTimerWindow
-








Set VariableSet CA_LevelIndex = (CA_LevelIndex + 1)
-
-







Else - Actions
-
-
-





Else - Actions
-






Game - Display to (All players) the text: Congratulations, yo...
-
-
-
-
-
-
-
CA Cooldown
-

Events
-


Time - CA_CooldownTimer expires
-
-

Conditions
-

Actions
-


Special Effect - Destroy CA_PortalSFX
-


Countdown Timer - Pause CA_CooldownTimer
-


Trigger - Run CA Start <gen> (checking conditions)
-
-
-
CA Delay
-

Events
-


Time - CA_SpawnTimer expires
-
-

Conditions
-

Actions
-


Game - Display to (All players) the text: Next wave starts!
-


Countdown Timer - Pause CA_SpawnTimer
-


Countdown Timer - Destroy CA_SpawnTimerWindow
-


Trigger - Run CA Start <gen> (checking conditions)
-
-
-
CA Die
-

Events
-


Unit - A unit Dies
-
-

Conditions
-


((Triggering unit) is in CA_UnitGroup.) Equal to True
-
-

Actions
-


Unit Group - Remove (Triggering unit) from CA_UnitGroup.
-


Set VariableSet CA_UnitGroupSize = (CA_UnitGroupSize - 1)
-


Game - Display to (All players) the text: (CA_UnitGroupSize = + (String(CA_UnitGroupSize)))
-


Game - Display to (All players) the text: (CA_UnitGroup = + (String((Number of units in CA_UnitGroup))))
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Number of units in CA_UnitGroup) Equal to 0
-




CA_UnitGroupSize Equal to 0
-
-



Then - Actions
-




Trigger - Run CA Start <gen> (checking conditions)
-




Game - Display to (All players) the text: Waves done!
-




Set VariableSet CA_SpawnItemArea = (Position of (Triggering unit))
-




Item - Create Tome of Experience at CA_SpawnItemArea
-




Custom script: call RemoveLocation(udg_CA_SpawnItemArea)
-
-



Else - Actions
-
-
-
Attachments
Last edited:
