Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
the other side effect of impale is that if you move it will stop going, it is channeling, thats why dota's impale is Channel-based spell
he means
Untitled Trigger 001
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Impale
Actions
Custom script: local unit u = GetTriggerUnit()
Custom script: local unit u2 = GetSpellTargetUnit()
Wait 5.00 seconds
Unit - Cause u to damage u2, dealing 500.00 damage of attack type Spells and damage type Normal
Custom script: set u = null
Custom script: set u2 = null
the u and u2 are globals but if you have global with name u and you do local unit u and you want to do like i did cause u to damage u2 it will first check if there are locals with name u and u2 then globals(I think thats how it works, if not then sorry but it works)
the other side effect of impale is that if you move it will stop going, it is channeling, thats why dota's impale is Channel-based spell
he means
Untitled Trigger 001
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Impale
Actions
Custom script: local unit u = GetTriggerUnit()
Custom script: local unit u2 = GetSpellTargetUnit()
Wait 5.00 seconds
Unit - Cause u to damage u2, dealing 500.00 damage of attack type Spells and damage type Normal
Custom script: set u = null
Custom script: set u2 = null
the u and u2 are globals but if you have global with name u and you do local unit u and you want to do like i did cause u to damage u2 it will first check if there are locals with name u and u2 then globals(I think thats how it works, if not then sorry but it works)
You want just the targeted units in a line in front of the caster to be damaged (no air lifting)
or you want it to be just like impale, (air lifting) but without the Invulnerable thing?
Don't see why you'd need or use either of those, much simpler to use a short mathematical loop to select all units within a line of a given thickness and control what makes them selectable targets with triggers, example:
Example
Events
Unit - a unit start the effect of an ability
Conditions
Ability being cast equal to (Ability)
Actions
Set Distance = 0.00
Set TempPoint = Position of (Triggering unit)
Set TempPoint2 = Target point of ability being cast
Set Angle = Angle Between points (TempPoint) and (TempPoint2)
Set Range = Distance between points (TempPoint) and (TempPoint2)
Set loopMax = (Integer(Range/Aoe))
For each (loopIndex) from 1 to loopMax do (actions)
Loop - Actions
Set Distance = Distance + Aoe
Set TempPoint3 = offset from TempPoint by (Distance) towards (Angle) degrees
Set TempGroup = (units within (Aoe) of (TempPoint3))
Unit - Pick all units within (TempGroup) and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
If (Multiple conditions) then (Multiple actions) else (Actions)
Conditions
(TempUnit) is in (TargetGroup) = False
>>Other conditions (flyers, enemy etc.)<<
>>Alternatively, scan an index above this if block for the existance of the unit in the index and don't run this if it turns out it is, although this can still be done in the way mentioned above if you then flush the (TargetGroup) unit group at the bottom<<
Then - Actions
Unit - Add unit to (TargetGroup)
>>Alternatively, Indexing occurs<< depends on if using a hashtable or dynamic indexing method<<
Note: may not be 100% accurate because I typed it out, rather than making it in the WE, but I think the idea is pretty clear, also note that some of the things are constants which should be controlled in a configuration elsewhere.
Additionally, I would've used locals when appropriate, but there's no point confusing a guy
Edit:
Now onto the subject of creating the rest of the spell, after you've either set up with dynamic indexing or hashtables you need to run a periodic trigger which runs every 0.03 seconds (turned on by the first trigger which runs when the spell is cast like my example) and then checking if either the array is empty or there are no units in the unit group, again depending on method. Then you proceed to add lots of tasty other variables which account for everything you'd need to add height, special effects on the like as well as probably needing to pause the unit so it doesn't go running off while flying up into the air, if you don't want flying and just want damage, then none of this is needed, you just deal damage and empty the unit group at the end of the spell and don't bother with indexing, since it'd be pointless and use the unit group method, really explaining exactly how to go about making the loop work, would be making the whole spell with text, and then sending you off to recreate it, which would kind of be redundant, so I'll stick to this short explaination:
You increase the unit's height until it reaches (height) then you decrease it, and when it hits 0 you damage it (or on the way up if you'd like) this will require an increment speed variable, decrement speed variable, boolean (up or down) and an accelleration variable for speeding up/slowing down (prehaps two if you want greater control)
For each (loopIndex) from 1 to loopMax do (actions)
Loop - Actions
Set Distance = Distance + Aoe
Set TempPoint3 = offset from TempPoint by (Distance) towards (Angle) degrees
Set TempGroup = (units within (Aoe) of (TempPoint3))
Unit - Pick all units within (TempGroup) and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
If (Multiple conditions) then (Multiple actions) else (Actions)
Conditions
(TempUnit) is in (TargetGroup) = False
>>Other conditions (flyers, enemy etc.)<<
>>Alternatively, scan an index above this if block for the existance of the unit in the index and don't run this if it turns out it is, although this can still be done in the way mentioned above if you then flush the (TargetGroup) unit group at the bottom<<
Then - Actions
Unit - Add unit to (TargetGroup)
>>Alternatively, Indexing occurs<< depends on if using a hashtable or dynamic indexing method<<
Set TempPoint2 = Target point of ability being cast
Set Angle = Angle Between points (TempPoint) and (TempPoint2)
Set Range = Distance between points (TempPoint) and (TempPoint2)
This bit you make sense of, so not much point talking about that
Set loopMax = (Integer(Range/Aoe))
For each (loopIndex) from 1 to loopMax do (actions)
Loop - Actions
This part is to work out how many times we need to run the index to grab all the units within a line of the given range (Range) being how far to go, (Aoe) being how much distance we cover part index
Set Distance = Distance + Aoe
Set TempPoint3 = offset from TempPoint by (Distance) towards (Angle) degrees
Set TempGroup = (units within (Aoe) of (TempPoint3))
Distance is increased to move along the "line" by the Aoe range, TempPoint3 is to get the new location of the distance we need so we can then use it to grab nearby units with the unit group
Unit - Pick all units within (TempGroup) and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
If (Multiple conditions) then (Multiple actions) else (Actions)
Conditions
(TempUnit) is in (TargetGroup) = False
>>Other conditions (flyers, enemy etc.)<<
>>Alternatively, scan an index above this if block for the existance of the unit in the index and don't run this if it turns out it is, although this can still be done in the way mentioned above if you then flush the (TargetGroup) unit group at the bottom<<
Then - Actions
Unit - Add unit to (TargetGroup)
>>Alternatively, Indexing occurs<< depends on if using a hashtable or dynamic indexing method<<
If i get it right, he wants an impale that will not make units Invul. while they are airborne.
I have tried, picking up the targets of impale, and
Unit - Make (Picked unit) Vulnerable
But it doesnt work, removing the buff won't do either because it will "cut" the animation of the spike coming out of the ground in half.
IMO this will require what Commander has posted, plus making the targets fly manually, adjusting their height, AND creating the Impale special effects and stuff in a loop.
Taking the above as consideration what you want is too resourcefull, requires a lot of time doing it, and is not worth the trouble.
Its half a second anyway, the invul. part...
PS: Commander +rep for your example, it may come in handy some day, and it would definitely take me some time to think it.
Set TempPoint2 = Target point of ability being cast
Set Angle = Angle Between points (TempPoint) and (TempPoint2)
Set Range = Distance between points (TempPoint) and (TempPoint2)
This bit you make sense of, so not much point talking about that
Set loopMax = (Integer(Range/Aoe))
For each (loopIndex) from 1 to loopMax do (actions)
Loop - Actions
This part is to work out how many times we need to run the index to grab all the units within a line of the given range (Range) being how far to go, (Aoe) being how much distance we cover part index
Set Distance = Distance + Aoe
Set TempPoint3 = offset from TempPoint by (Distance) towards (Angle) degrees
Set TempGroup = (units within (Aoe) of (TempPoint3))
Distance is increased to move along the "line" by the Aoe range, TempPoint3 is to get the new location of the distance we need so we can then use it to grab nearby units with the unit group
Unit - Pick all units within (TempGroup) and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
If (Multiple conditions) then (Multiple actions) else (Actions)
Conditions
(TempUnit) is in (TargetGroup) = False
>>Other conditions (flyers, enemy etc.)<<
>>Alternatively, scan an index above this if block for the existance of the unit in the index and don't run this if it turns out it is, although this can still be done in the way mentioned above if you then flush the (TargetGroup) unit group at the bottom<<
Then - Actions
Unit - Add unit to (TargetGroup)
>>Alternatively, Indexing occurs<< depends on if using a hashtable or dynamic indexing method<<
some units at the max distance are not damaged
maybe because my max range=380
and the Aoe=250
so 380/250 only cause 1 loop and any unit beyond 250 will not be damaged because they are not involved in the loop
any idea to fix this?(except by changing the max distance and Aoe)
do Integer((Range/AoE) + 0.5)
this will ensure that anything over 0.5 is not round down but up
example-
1.4 is still 1 however 1.6 is 2
if it still fails just do Integer(Range/AoE) + 1,this will loop ever at least once
You needed 250 thickness? That's one thick impale, well all I can suggest while keeping the triggers the same would be to either follow what Eubz said, or to change the values I'm afraid. And Eubz's method will change the max range, whatever your Aoe is "needs" to be a factor of the range, or the looping will be inaccurate one way or another.
However: There's another way to do it, which woud be to introduce another variable which would be like "search distance", so you keep to AOE the same but do this instead:
Set LoopMax = (Integer(Range/SearchDistance))
This way you can set search distance to something lower (a factor of the Range) and still keep the same Aoe. but it will generate a lost of wasted search space since instead of searching like this:
{}OOOOOOO
{} being the caster
O being the target selection areas
it'd select with a lot of overlap (each circle will have half of another circle in it) which hence why I put in the "is it already in the target group" condition in my example. so that it wouldn't re-add other units or units directly on the line between the circles in the first method. I'll work, but it's less efficient use of space.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.