• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Impale spell

Status
Not open for further replies.
Level 5
Joined
Feb 18, 2009
Messages
123
can anyone help me to make an impale ability with full gui (not using the base impale ability)
thanks before
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
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 :D but it works)
 
Level 5
Joined
Feb 18, 2009
Messages
123
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 :D but it works)

so the damage will be occurred after 5 second?
and did it will damage all target?
 
Level 8
Joined
Oct 26, 2008
Messages
387
can anyone help me to make an impale ability with full gui (not using the base impale ability)
thanks before

it's hard to make it have a custom trigger damage
because of it's air time makes the targets invulnerable

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<<
                  • >>Effects as well, Of course<<
                • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint3)
          • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)


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)
 
Last edited:
Level 5
Joined
Feb 18, 2009
Messages
123
  • 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<<
              • >>Effects as well, Of course<<
            • Else - Actions

sorry but i quiet dont understand this part

and did DotA using a custom Impale too for their skills(because in DotA unit that impaled by lion can be attacked while they are still flying)
 
I'll explain the individual parts:


  • 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)
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<<
          • >>Effects as well, Of course<<
        • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint3)
  • Custom script: call DestroyGroup(udg_TempGroup)
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call RemoveLocation(udg_TempPoint2)
All of this is to just add eligble units into the spell for the impale to effect by running tests on the unit, and the rest is removing leaks
 
Level 8
Joined
Oct 26, 2008
Messages
387
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. :)
 
Level 5
Joined
Feb 18, 2009
Messages
123
I'll explain the individual parts:


  • 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)
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<<
          • >>Effects as well, Of course<<
        • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint3)
  • Custom script: call DestroyGroup(udg_TempGroup)
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call RemoveLocation(udg_TempPoint2)
All of this is to just add eligble units into the spell for the impale to effect by running tests on the unit, and the rest is removing leaks

just to make sure,
the range variable is the maximum range for my spell right?
 
Level 5
Joined
Feb 18, 2009
Messages
123
i have done what you said earlier, but there is something wrong in this part

  • Set loopMax = (Integer(Range/Aoe))

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)
 
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.
 
Status
Not open for further replies.
Top