Direct Damage System
Contents
Overview
The Direct Damage System (DDS) is a system that allows to deal any desired amount of damage to a unit within 1 trigger cycle. It is very useful for things like damaging spells, poison/radiation/cold effects on a hero, etc. It is simpler than vHP (virtual Hit Points), but it does not offer a simple and elegant method of restoring HP.
DDS is based on the fact that any scarab owned by an active computer player with constant "Send All Units on Random Suicide Missions" AI running deal the normal amount of damage per trigger cycle without exploding.
DDS takes Scarabs from Reavers, stacks them, stores the stacked scarabs and uses them to deal damage. Let us consider all these aspects one by one.
The system requires two computer players with at least one of them being active. One player will be trying to attack the 'target' player. Let P3 be the owner of the Reavers and Scarabs, and P2 be its target. It also requires at least 3 locations, though the example given uses 5. Hyper Triggers are essential for the DDS.
Step One: Taking Scarabs from Reavers and Stacking
The simplest, fastest and overall applicable method of getting and stacking Scarabs is described here. First, a little remote arena is arranged as shown:
With the two locations and pre-placed Reavers. The burrowed units seen below the Reavers are Zerglings owned by P2. Note: it is very important that all the units and locations are placed with the fine grid. Also, a 1x1 tile location in an isolated area called "SYSTEM_Stack" should be created.
The general idea is the following: when a Reaver Shoots a Scarab, the Scarab moves through the "SYSTEM_Targets" location. The "SYSTEM_Scan" location is then centered on this Scarab. Since the "SYSTEM_Scan" location also covers the Reaver that shot the Scarab, one can center the "SYSTEM_Scan" location on the Reaver that is in "SYSTEM_Scan" itself. Then simply replace the Reaver witha new one and don't forget to move the Scarab into the stacking location. This must be repeated for each Reaver. Hence, there must be a trigger per reaver that does the described above.
The following trigger block is copied per each Reaver:
Trigger("Player 3"){ Conditions: Bring("Current Player", "Protoss Scarab", "SYSTEM_Targets", At least, 1); Actions: Comment(""); Preserve Trigger(); Move Location("Current Player", "Protoss Scarab", "SYSTEM_Targets", "SYSTEM_Scan"); Move Unit("Current Player", "Protoss Scarab", All, "SYSTEM_Scan", "SYSTEM_Stack"); Move Location("Current Player", "Protoss Reaver", "SYSTEM_Scan", "SYSTEM_Scan"); Remove Unit At Location("Current Player", "Protoss Reaver", All, "SYSTEM_Scan"); Create Unit("Current Player", "Protoss Reaver", 1, "SYSTEM_Scan"); Modify Unit Hanger Count("Current Player", "Protoss Reaver", 10, 0, "Anywhere");
In the example given we have 8 Reavers, hence it requires 8 triggers. This group of triggers will move all the Scarabs that have been shot to the stacking location each trigger cycle. Make sure that the "SYSTEM_Scan" location's center is actually on the center of the Reaver. This may not be the case if this little arena is placed too close to the map edge; if "Unit Unplaceable" errors appear, then it is a firm sign that the arena is too close to the map edge.
The Reavers are removed because if a unit is damaged by a Scarab whose 'mothership' Reaver no longer exists, the unit will not attempt to move. Also, a Reaver cannot shoot a Scarab until the previous Scarab is dead; since the goal is to store scarabs, it is much more effective to remove the old Reaver and create a new one rather than wait for one Reaver to shoot a new scarab.
Scarab stacking is crucial for any decent-sized DDS (stacking is not needed only for 1-Reaver DDS) - it allows multiple Scarabs to exist and move normally in the same coordinates, which is vital to the storage system. Stacking is achieved by holding the Scarabs in one location for at least one trigger cycle and then moving them all to another location at once. Stacking is only possible for Scarabs affected by the "Send All Units on Random Suicide Missions" AI.
Step Two: Storing Scarabs
The storage location is a long, tile-tall path that starts at point A (point A will be described later on) and goes in the direction towards the little arena where the scarabs are made. The terrain and location arrangement is the following:
The location that stretches to the left ends like this:
The "SYSTEM_Storage_Main" location should be 39 tiles long (or 1248 pixels).
The storage system's idea is the following: already stacked scarabs from the "SYSTEM_Stack" location are moved to the start of the path and they try to return to their targets, moving along the "SYSTEM_Storage_Main" location. This is the location from which the Scarabs are taken to deal damage. Any scarab that is not within that location may die very soon, and it thus not used to deal damage (which is why there is a tile and a half on the left that is not covered by the "SYSTEM_Storage_Main" location - Scarabs die during those last 48 pixels of the path, hence they must not be used for damage purposes).
The triggers for this system are the following:
Trigger("Player 3"){ Conditions: Bring("Current Player", "Protoss Scarab", "SYSTEM_Stack", At least, 8); Actions: Comment(""); Preserve Trigger(); Move Unit("Current Player", "Protoss Scarab", 8, "SYSTEM_Stack", "SYSTEM_Storage_Start");
Trigger("Player 3"){ Conditions: Bring("Current Player", "Protoss Scarab", "SYSTEM_Stack", At least, 4); Actions: Comment(""); Preserve Trigger(); Move Unit("Current Player", "Protoss Scarab", 4, "SYSTEM_Stack", "SYSTEM_Storage_Start");
Trigger("Player 3"){ Conditions: Bring("Current Player", "Protoss Scarab", "SYSTEM_Stack", At least, 2); Actions: Comment(""); Preserve Trigger(); Move Unit("Current Player", "Protoss Scarab", 2, "SYSTEM_Stack", "SYSTEM_Storage_Start");
Trigger("Player 3"){ Conditions: Bring("Current Player", "Protoss Scarab", "SYSTEM_Stack", At least, 1); Actions: Comment(""); Preserve Trigger(); Move Unit("Current Player", "Protoss Scarab", 1, "SYSTEM_Stack", "SYSTEM_Storage_Start");
It is crucial that these triggers are placed before the triggers described in Step One. Make sure they run first by double-checking in the text trigger editor. If the triggers are not ordered correctly the stack will simply not work, hence the entire DDS will not work properly. If the scarabs die too early, nowhere near the end of the path, it is a clear signal that the stacking is done incorrectly. Make sure the "Send All Units on Random Suicide Missions" AI script is run constantly, and make sure the trigger order is correct.
Step Three: Dealing Damage
Remember that Scarabs deal splash damage, even if they are a part of DDS. When dealing damage to a unit directly in the battlefield, nearby units will get damaged as well. If splash damage is not desired, the unit that is supposed to take damage must be moved to a remote location for 1 trigger loop of damage and then moved back.
As it is, about 50% of the Scarabs moved under the 'victim' unit will not deal damage because they found some other, randomly chosen target. To counter this and make them deal damage in all cases, a burrowed unit owned by the player the Scarabs were originally shot at must be moved to the location of the 'victim' unit. In this case, the victim unit is a P1 (human) Marine (hence the trigger is owned by P1), the 'luring' unit that makes the scarabs deal damage in all cases is a P2 Zergling. This trigger will move one scarab each trigger cycle under the Marine until the "Alan Turret" death counter hits zero. Note that any number of Scarabs can be moved under the victim unit every trigger loop, as they are stacked.
Trigger("Player 1"){ Conditions: Deaths("Current Player", "Alan Turret", At least, 1); Actions: Comment(""); Preserve Trigger(); Move Location("Current Player", "Terran Marine", "Anywhere", "1x1"); Move Unit("Player 2", "Zerg Zergling", 1, "Anywhere", "1x1"); Move Unit("Player 3", "Protoss Scarab", 1, "SYSTEM_Storage_Main", "1x1"); Set Deaths("Current Player", "Alan Turret", Subtract, 1); Modify Unit Hit Points("Player 2", "Zerg Zergling", 100, 0, "Anywhere");
Note that this particular trigger is slightly different in the example map (that will be uploaded as soon as the DB becomes functional).
The Zergling HP is set to 100% to make sure it doesn't die from the damage. Make sure his HP is greater than the damage dealt. Also see that no other units attack the Zergling and that it does not get killed/removed by other triggers. Alternatively, a new Zergling can be created every trigger cycle to avoid having to worry for its HP.
System Placement on the Map
Every time a Scarab is moved in the DDS, it has a 50% chance of changing his current target to another enemy unit. (The reasons and selection process are still to be researched.) This is the reason why the 'luring' burrowed unit is needed under the victim unit. To be on the safe side, assume that the scarabs choose their new targets randomly, which is the worst case, and work from that. The best and safest placement is as shown on the following diagram:
Where the red box is the map borders. The green square is the are where all possible enemy units are (enemy to P3). The black box is the arena with the Reavers where the Scarabs are made, and the black line is the storage path. The light-blue point is point A - the start of the path.
The map layout must be designed in such a way that the angle G (say), equal to the maximum angle between the black line and any of the green lines, is as small as possible.
If some scarabs in the storage stop before reaching the end of the path, the angle G must be decreased. If it is not possible, the storage path must be widened in the place where Scarabs stop and explode - that should allow them to move further and not bug the system; note that this measure will most probably result in the need to decrease the size of the location "SYSTEM_Storage_Main", which will decrease the storage system efficiency.