- Joined
- Jan 27, 2016
- Messages
- 89
Since I can't post this in the GUI tutorial section due to access denied, I'll post it here as I think these are very useful and not covered anywhere. But basically, I've searched around, and saw that no one has tried out these 2 "tricks" before. They're very simple but help avoid having to use projectile and damage detection systems for their nieches, which can be helpful in a map where a ton of stuff is running.
Here's the first one:
Pocket factory as an AoE point projectile.
Basically, in most cases, if you want to send out a projectile that does something at an AoE, you have to use a projectile system that runs every few times in a second to detect if a projectile reached its destination. With the pocket factory example, all you need to do is replace the ability with pocket factory, projectile with a projectile you want, and make the unit summoned a specific dummy for the spell (eg if the ability is Storm Bolt, use Dummy Storm Bolt, as detection for summoning units for pocket factory is a bit screwed up). Set the units life duration to 0.01, health to 1 and HP regen to 0, make the dummy have nothing going for it (no model or anything). The Spawned units fields are irrelevant. Then, just have a trigger like this to detect its death:
Second example is the batrider example:
Generally, if you want to do something when a projectile hits a unit, you need to have either a damage detection system or a projectile system. An example of this would be Chain Frost from DotA as I think its famous enough, and it is considered impossible to do with GUI. But with GUI it is in fact possible to do with 2 triggers and a hashtable. This is done with the Unstable Concoction of the batrider, which basically turns the unit into a projectile and, when it hits, it is then considered its death, instead of when it is cast, meaning it is I think the only workaround to detecting a projectile hit in GUI easily. Here's what it looks like (I changed the example around because I was too lazy to follow through with a proper example of chain Frost but its similar enough).
Now, if you want varied projectile speeds you need to use multiple Unstable Concoction, but each UC can be used multiple times for each bit of projectile speed. Actually, I think that UC just manipulates the speed of the unit, so you could get away with using only one, though I'm not 100% certain on this.
Don't know about disjointability, though you can also use an expiration timer or other triggers detecting if the unit is alive for such things if you so desire, though in most cases its, performance wise, more efficient not to bother.
But it works with amazing reliability and is incredibly useful as I found. Pic related, stunned ghouls were already hit, Death Coil is the Chain Frost particle, and after the proper amount of bounces it bounced no more, pretty cool considering its simple GUI.
There's also a 2.5 version, where you use suicide squad attack if you want to at least somewhat manipulate the movement, if it is say disjointed with a really long distance you could order the dummy to suicide at the units last known point or something, plus you can manipulate the unit in other ways, though I don't find this too reliable or useful.
This stuff is intended for those using GUI and mostly interested in simpler things, and those who don't want to deal with the potential performance hogging of using a damage detection system with a lot of units. Also, it can be used for allied units as well as other kinds of targets.
Hope this is useful to someone at least.
Here's the first one:
Pocket factory as an AoE point projectile.
Basically, in most cases, if you want to send out a projectile that does something at an AoE, you have to use a projectile system that runs every few times in a second to detect if a projectile reached its destination. With the pocket factory example, all you need to do is replace the ability with pocket factory, projectile with a projectile you want, and make the unit summoned a specific dummy for the spell (eg if the ability is Storm Bolt, use Dummy Storm Bolt, as detection for summoning units for pocket factory is a bit screwed up). Set the units life duration to 0.01, health to 1 and HP regen to 0, make the dummy have nothing going for it (no model or anything). The Spawned units fields are irrelevant. Then, just have a trigger like this to detect its death:
-
Hell Coil
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Hell Coil Dummy
-
-
Actions
-
Set Temp_Point = (Position of (Triggering unit))
-
Unit - Create 1 Dummy Dummy for (Owner of (Triggering unit)) at Temp_Point facing (Facing of (Triggering unit)) degrees
-
Unit - Add DummyHell Coil to (Last created unit)
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
Unit - Order (Last created unit) to Undead Dreadlord - Inferno Temp_Point
-
Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation (udg_Temp_Point)
-
-
Second example is the batrider example:
Generally, if you want to do something when a projectile hits a unit, you need to have either a damage detection system or a projectile system. An example of this would be Chain Frost from DotA as I think its famous enough, and it is considered impossible to do with GUI. But with GUI it is in fact possible to do with 2 triggers and a hashtable. This is done with the Unstable Concoction of the batrider, which basically turns the unit into a projectile and, when it hits, it is then considered its death, instead of when it is cast, meaning it is I think the only workaround to detecting a projectile hit in GUI easily. Here's what it looks like (I changed the example around because I was too lazy to follow through with a proper example of chain Frost but its similar enough).
-
Chain Frost
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Projectile Killer
-
-
Actions
-
Set Temp_Point = (Position of (Triggering unit))
-
Set Temp_Unit2 = (Target unit of ability being cast)
-
Unit - Create 1 Projectile Killer Dummy for (Owner of (Triggering unit)) at Temp_Point facing (Facing of (Triggering unit)) degrees
-
Set Temp_Unit = (Last created unit)
-
Custom script: set udg_Temp_Integer = GetHandleId(udg_Temp_Unit)
-
Hashtable - Save Handle OfTemp_Unit2 as 0 of Temp_Integer in DummyHash
-
Hashtable - Save 8 as 1 of Temp_Integer in DummyHash
-
Unit - Add DummyProjectile Killer to Temp_Unit
-
Unit - Order Temp_Unit to Orc Batrider - Unstable Concoction Temp_Unit2
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Temp_Unit2 is alive) Not equal to True
-
-
Then - Actions
-
Unit - Add a 0.01 second Generic expiration timer to Temp_Unit
-
-
Else - Actions
-
-
Custom script: call RemoveLocation (udg_Temp_Point)
-
-
-
Chain Frost 2
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Projectile Killer Dummy
-
-
Actions
-
Set Temp_Unit = (Triggering unit)
-
Set Temp_Point = (Position of Temp_Unit)
-
Custom script: set udg_Temp_Integer = GetHandleId(udg_Temp_Unit)
-
Unit - Create 1 Dummy Dummy for (Owner of (Triggering unit)) at Temp_Point facing (Facing of (Triggering unit)) degrees
-
Unit - Add DummyProjectileKiller Stun to (Last created unit)
-
Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Load 0 of Temp_Integer in DummyHash)
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load 1 of Temp_Integer from DummyHash) Greater than 0
-
-
Then - Actions
-
Set Temp_Group = (Units within 512.00 of Temp_Point)
-
Set Temp_Group2 = (Random 1 units from Temp_Group)
-
Unit Group - Pick every unit in Temp_Group2 and do (Actions)
-
Loop - Actions
-
Unit - Create 1 Projectile Killer Dummy for (Owner of (Triggering unit)) at Temp_Point facing (Facing of (Triggering unit)) degrees
-
Unit - Add DummyProjectile Killer to (Last created unit)
-
Unit - Order (Last created unit) to Orc Batrider - Unstable Concoction (Picked unit)
-
Set Temp_Integer2 = ((Load 1 of Temp_Integer from DummyHash) - 1)
-
Set Temp_Unit = (Last created unit)
-
Hashtable - Clear all child hashtables of child Temp_Integer in DummyHash
-
Custom script: set udg_Temp_Integer = GetHandleId(udg_Temp_Unit)
-
Hashtable - Save Handle Of(Picked unit) as 0 of Temp_Integer in DummyHash
-
Hashtable - Save Temp_Integer2 as 1 of Temp_Integer in DummyHash
-
-
-
Custom script: call DestroyGroup(udg_Temp_Group)
-
Custom script: call DestroyGroup(udg_Temp_Group2)
-
-
Else - Actions
-
Hashtable - Clear all child hashtables of child Temp_Integer in DummyHash
-
-
-
Custom script: call RemoveLocation (udg_Temp_Point)
-
-
Now, if you want varied projectile speeds you need to use multiple Unstable Concoction, but each UC can be used multiple times for each bit of projectile speed. Actually, I think that UC just manipulates the speed of the unit, so you could get away with using only one, though I'm not 100% certain on this.
Don't know about disjointability, though you can also use an expiration timer or other triggers detecting if the unit is alive for such things if you so desire, though in most cases its, performance wise, more efficient not to bother.
But it works with amazing reliability and is incredibly useful as I found. Pic related, stunned ghouls were already hit, Death Coil is the Chain Frost particle, and after the proper amount of bounces it bounced no more, pretty cool considering its simple GUI.
There's also a 2.5 version, where you use suicide squad attack if you want to at least somewhat manipulate the movement, if it is say disjointed with a really long distance you could order the dummy to suicide at the units last known point or something, plus you can manipulate the unit in other ways, though I don't find this too reliable or useful.
This stuff is intended for those using GUI and mostly interested in simpler things, and those who don't want to deal with the potential performance hogging of using a damage detection system with a lot of units. Also, it can be used for allied units as well as other kinds of targets.
Hope this is useful to someone at least.