• 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.

Split Shot ability doesn't do the damage it is supposed to do..

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
824
I can't see what's wrong with this triggered ability.. Anyone please can help??

Split Shot Ability
The Hero shoots a flurry of powerful cold arrows that damages the target enemy unit and all enemy units around the target enemy based on his agility and slowing their movement speed and attack rate for 5 seconds.|n|n|cffffcc00Level 1|r - 4x agility damage. Slows movement speed by 30% and attack rate by 25%. |n|n|cffffcc00Level 2|r - 5x agility damage. Slows movement speed by 40% and attack rate by 35%. |n|n|cffffcc00Level 3|r - 6x agility damage. Slows movement speed by 50% and attack rate by 45%.|n|n|cffFFFF00Cast Range: |r 1000|n|cff0000FFMana Cost: |r 140/160/180|n|cff99ccffCooldown: |r 50/40/30 seconds.

The triggers for the ability.
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set SpellHash = (Last created hashtable)
      • Custom script: call SaveTriggerHandle(udg_SpellHash, StringHash("triggers"), 'A05P', gg_trg_Split_Cold_Arrows)
  • Call Spells
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Custom script: call TriggerExecute(LoadTriggerHandle(udg_SpellHash, StringHash("triggers"), GetSpellAbilityId()))
  • Split Cold Arrows
    • Events
    • Conditions
    • Actions
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set TempLoc = (Position of Caster)
      • Set TempLoc2 = (Position of Target)
      • Set TempGroup = (Units within 250.00 of TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering playe
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Greater than 1
        • Then - Actions
          • Set TempReal = ((Real((Agility of Caster (Include bonuses)))) x ((Real((Level of Split Cold Arrows for Caster))) + 3.00))
        • Else - Actions
          • Set TempReal = ((Real((Agility of Caster (Include bonuses)))) x ((Real((Level of Split Cold Arrows for Caster))) + 3.00))
      • Set TempInt2 = (Level of Split Cold Arrows for Caster)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Attack for (Triggering player) at TempLoc facing Default building facing degrees
          • Set TempUnit = (Last created unit)
          • Unit - Add Dummy Damage to TempUnit
          • Unit - Set level of Dummy Damage for TempUnit to (Integer(TempReal))
          • Unit - Add Split Cold Arrows Dummy to TempUnit
          • Unit - Set level of Split Cold Arrows Dummy for TempUnit to TempInt2
          • Unit - Add a 1.00 second Generic expiration timer to TempUnit
          • Unit - Order TempUnit to Neutral Naga Sea Witch - Activate Frost Arrows
          • Unit - Order TempUnit to Attack Once (Picked unit)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation (udg_TempLoc2)
      • Custom script: call DestroyGroup (udg_TempGroup)
 
Level 12
Joined
Nov 3, 2013
Messages
989
Don't you have to set the variables in the "Call Spell" trigger?

And imo that hashtable probably isn't worth it, you save yourself the time to set the event and one condition in each trigger at the cost of performance ingame. (although I got to admit that the idea is a bit appealing to my lazy self)
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
We can't find what is wrong with it since we can't test with map.You should test every possible thing.

Maybe you are not picking correct units, put a message to display names of picked unit, though that is probably not the case here.

If your target units don't get effected by frost arrow debuff, this means maybe 1 second is not enough for your dummy unit to attack?Maybe your dummy unit doesn't have neccesary object settings to be able to attack?

If they get effected, that is probably easy, your damage adding not working.
 
Level 15
Joined
Jul 19, 2007
Messages
824
We can't find what is wrong with it since we can't test with map.You should test every possible thing.

Maybe you are not picking correct units, put a message to display names of picked unit, though that is probably not the case here.

If your target units don't get effected by frost arrow debuff, this means maybe 1 second is not enough for your dummy unit to attack?Maybe your dummy unit doesn't have neccesary object settings to be able to attack?

If they get effected, that is probably easy, your damage adding not working.
They are getting effected by the arrows and the first time I used it with the Hero, it actually made correct damage to the enemies but then when the Hero got higher level and gained more agility and when the ability got to level 2, it didn't cause the damage it should.. I'm wonder if there is something with the "set damage" variable that is wrong :-/ Maybe it just sets the damage 1 time when the first time I use the ability and keeps that damage for the ability in the rest of the game time and doesn't resets the damage every time I use the ability, hmm...
 
Level 12
Joined
Nov 3, 2013
Messages
989
things i noticed:

There's no reason to make have tempreal when there are no decimals.

if the caster have 25 agi and the ability is level 1 then the level of dummy damage is already 100, so how many levels does it actually have?
 
Level 15
Joined
Jul 19, 2007
Messages
824
things i noticed:

There's no reason to make have tempreal when there are no decimals.

if the caster have 25 agi and the ability is level 1 then the level of dummy damage is already 100, so how many levels does it actually have?
Ehm it actually only have 100 levels, so it means it will not be able to cause more than 100 damage? I didn't create this ability by myself, i copied it from a spellpack map.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
If its only 100 level and its damage goes like 1, 2, 3... yeah it won't be able to.If your dummy unit is attacking correctly and the only problem is the amount of damage, create another trigger which detects damage, when damage event occurs, deal damage which depends on agility yourself.
 
Level 15
Joined
Jul 19, 2007
Messages
824
If its only 100 level and its damage goes like 1, 2, 3... yeah it won't be able to.If your dummy unit is attacking correctly and the only problem is the amount of damage, create another trigger which detects damage, when damage event occurs, deal damage which depends on agility yourself.
Yes it goes like 1, 2, 3 but as I writed before, I'm not the creator of this ability... I'm very bad at triggering so I would be thankful if someone would fix the problem to make the ability work correct.
 
Level 12
Joined
Nov 3, 2013
Messages
989
well it's really weird that you set the level of an ability based on how much agility that unit has, what does the ability actually do? I'm guessing it's like a damage bonus ability (to give the attacking unit bonus damage) and if that's correct then the recommended approach would be to replace it with use of looking for help's DDS to change the damage dealt instead of directly changing the damage of the unit, it would be a bit more complicated though so you if you want something more similar to how it's being done now you could give damage tomes or use the add change level and remove ability trick.
 
Level 15
Joined
Jul 19, 2007
Messages
824
well it's really weird that you set the level of an ability based on how much agility that unit has, what does the ability actually do? I'm guessing it's like a damage bonus ability (to give the attacking unit bonus damage) and if that's correct then the easiest way would be to remove it and use looking for help's DDS to change the damage dealt instead, it would be a bit more complicated though so you could also give damage tomes or use the add change level and remove ability trick. (they both would work more similar to how it's done now)
Ehm it should not cause damage based on the agility of the dummy unit, cause the dummy has no agility at all...It should be based on the agility of the casting Hero. I typed a describtion in my first message of this thread that explains what the ability does. I have no idea what DDS is and I'm kinda noobish at triggering.. :-/
 
Level 12
Joined
Nov 3, 2013
Messages
989
Ehm it should not cause damage based on the agility of the dummy unit, cause the dummy has no agility at all...It should be based on the agility of the casting Hero. I typed a describtion in my first message of this thread that explains what the ability does. I have no idea what DDS is and I'm kinda noobish at triggering.. :-/

Yeah I know, that's why there's the ability and it gets levels based of the agility of the caster.

That said your miss understanding actually gave me an idea for a potential solution which also would be very simple, if you'd make the dummy unit a hero then instead of giving it the ability you could just give it agility which would automatically increase it's damage as much as you want.

I don't think that it will show any hero icon on the screen if it has locust but I'm not sure though.
 
Level 15
Joined
Jul 19, 2007
Messages
824
Yeah I know, that's why there's the ability and it gets levels based of the agility of the caster.

That said your miss understanding actually gave me an idea for a potential solution which also would be very simple, if you'd make the dummy unit a hero then instead of giving it the ability you could just give it agility which would automatically increase it's damage as much as you want.

I don't think that it will show any hero icon on the screen if it has locust but I'm not sure though.
Hmm well that maybe could work but there should be an easy way to just edit the triggers to make the ability cause correct damage... It actually cause the correct damage the first time the ability is cast and countine doing corrects damage as long as the Hero hasn't got more agility or level up the ability..
 
Level 12
Joined
Nov 3, 2013
Messages
989
Hmm well that maybe could work but there should be an easy way to just edit the triggers to make the ability cause correct damage... It actually cause the correct damage the first time the ability is cast and countine doing corrects damage as long as the Hero hasn't got more agility or level up the ability..

Yeah but there's no limit to how much agility you can have so that means you need an ability with infinite levels, it's obviously not going to work.
 
Level 15
Joined
Jul 19, 2007
Messages
824
Yeah but there's no limit to how much agility you can have so that means you need an ability with infinite levels, it's obviously not going to work.
Yes that's true but in my map it's kinda impossible to get a Hero with over 1000 agility the maximum amount of agility, strength or intelligence of a hero I've seen a player get is about 200-300.. Should I keep increase the damage of the "Damage Dummy" ability up to 1000 or maybe try with creating a Dummy-Hero??
 
Level 12
Joined
Nov 3, 2013
Messages
989
Considering that with 300 agility you'd already be at 1200 and then there's another 300 for each level of the split arrow skill doing it the way it's being done now is pretty much out of the question.

Assuming that a dummy hero work you barley have to make any changes at all, instead of giving that ability with so many levels you'd just give it as many points in a primary skill.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
You don't need a dummy hero...

If you set ability levels to something higher than their max, they are removed, or maybe disabled. It is best to use the Dummy Hero technique since abilities with many levels increase map loading time by a bunch, even if it is just ~100 levels.
This is the best way to have the ability you want.
 
Last edited:
Level 15
Joined
Jul 19, 2007
Messages
824
  • Unit - Set level of Dummy Damage for TempUnit to (Integer(TempReal))
replace that with adding attribute instead
Well, now it seems to do the damage it's supposed to do and the dummy-Hero is not shown in the minimap but I got other problems now. Sometimes it creates 2 dummy-heroes so the target unit is getting damaged 2 times and the dummy-hero is NOT getting removed from the game, it's just getting killed but the Hero icon of the dummy-Hero is still shown and can be revived, so everytime I use the ability, it always creates more and more dummy-Heroes and they are not getting removed from the game :-/
 
Heroes are not removed from game when killed. You have to make a trigger to remove them upon death to work with the expiration timer.

Additionally, hide the hero icon somewhere in the 'Stats' in the Object Editor.

Also you don't need a dummy for every unit, just have a dummy for everything and make sure you the Animation for Cast (Backswing/Point) is set to 0.
 
Level 12
Joined
Nov 3, 2013
Messages
989
oh yeah, it has to do with that it's not getting removed but instead it's getting killed by the generic expiration timer and since it's a hero it's not sufficient.

The easiest way to fix it would be to use local unit variable for the dummy and a wait.

add this in the beginning of the trigger (with the other global variables)
  • custom script: local unit udg_TempUnit
then at the end (after the leak removing custom scripts) add a wait and then unit - remove TempUnit


edit: cuz fail.
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
Ah yeah sorry didn't notice that there's a unit group, so it's not going to be as easy. I guess you'd use dynamic indexing for this then (which mind you is a bit more complex and bothersome than just having a wait and local variable)

Edit: Actually since the unit group is going to be destroyed you could maybe have a local unit group instead and loop through it and remove all the units that way instead.

So try changing "local unit udg_TempUnit" into "local unitgroup (might not be correct) udg_TempGroup" and then before "Custom script: call DestroyGroup (udg_TempGroup)" place the wait and then do
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
    • Unit - remove (picked unit) from the game
and then remove this unit group too
 
Level 15
Joined
Jul 19, 2007
Messages
824
Heroes are not removed from game when killed. You have to make a trigger to remove them upon death to work with the expiration timer.

Additionally, hide the hero icon somewhere in the 'Stats' in the Object Editor.

Also you don't need a dummy for every unit, just have a dummy for everything and make sure you the Animation for Cast (Backswing/Point) is set to 0.
Well it's mean't to create just 1 dummy-Hero and it most of the times does it but sometimes it creates 2 dummy-Heroes so the target enemy gets damaged 2 times and I don't know why.. Yes the Backswing/Point is set to 0.. How should I set the triggers to remove the dummy-Heroes upon death??
 
Level 15
Joined
Jul 19, 2007
Messages
824
Well I've find out this ability still leaks and I've no idea how to fix it.. Almost everytime the Hero uses the ability, the Dummy-Hero is attacking the targets until it is removed from the game. I have to make it a 2 sec Expiration Timer because if the Dummy-Hero is removed before the target unit is killed by the arrow, the kill will not go to the triggering player because the Dummy-Hero does not exist anymore so 1 sec Expiration Timer is to short.. with 2 sec Expiration Timer the Dummy-Hero is not removed before the target unit is killed by the arrow but instead the Dummy-Hero keeps attacking the target with more arrows until it is removed from the game.. How can I fix so the Dummy-Hero only attack 1 times to a target? The trigger currently looks like this
  • Split Cold Arrows
    • Events
    • Conditions
    • Actions
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set TempLoc = (Position of Caster)
      • Set TempLoc2 = (Position of Target)
      • Set TempGroup = (Units within 250.00 of TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering playe
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Greater than 1
        • Then - Actions
          • Set TempReal = ((Real((Agility of Caster (Include bonuses)))) x ((Real((Level of Split Cold Arrows for Caster))) + 3.00))
        • Else - Actions
          • Set TempReal = ((Real((Agility of Caster (Include bonuses)))) x ((Real((Level of Split Cold Arrows for Caster))) + 3.00))
      • Set TempInt2 = (Level of Split Cold Arrows for Caster)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Attack (Split Cold Arrows) for (Triggering player) at TempLoc facing Default building facing degrees
          • Set TempUnit = (Last created unit)
          • Hero - Modify Agility of TempUnit: Add (Integer(TempReal))
          • Unit - Add Split Cold Arrows Dummy to TempUnit
          • Unit - Set level of Split Cold Arrows Dummy for TempUnit to TempInt2
          • Unit - Add a 2.00 second Generic expiration timer to TempUnit
          • Unit - Order TempUnit to Neutral Naga Sea Witch - Activate Frost Arrows
          • Unit - Order TempUnit to Attack Once (Picked unit)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation (udg_TempLoc2)
      • Custom script: call DestroyGroup (udg_TempGroup)
 
Level 12
Joined
Nov 3, 2013
Messages
989
that's weird considering that it's ordered to only attack once. Im guessing it starts auto attacking on it's own afterwards, so you probably haven't reduced the acquisition range.

If it still doesn't work then give the unit worker classification, because then it won't acquire targets on it's own.
 
Level 15
Joined
Jul 19, 2007
Messages
824
Well it's strange it keeps attacking the target but I've also notice it creates more than just 1 Dummy-Hero sometimes.. Now I have maked the Dummy-Hero do not appear on the minimap or as icon so I can't see if it still creates more than just 1 Dummy-Hero, but maybe that could be the problem?
 
Level 15
Joined
Jul 19, 2007
Messages
824
If you create the dummy in the loop, it will create a dummy per enemy in range.

It still attacks with Worker clarification and Acquisition Range to 0?
Oh man! Why didn't I think about this earlier!? It works like it should now. As Worker-Classification the Dummy-Hero only attacks the target 1 time and does not countine attacking it until it is killed/removed because Worker-units does not automatically attack enemies. Thank u so much for the help, it really works as it should now. Btw if I set the Acquisition Range to 0 the Dummy-Hero will not attack the target at all!
 
Level 15
Joined
Jul 19, 2007
Messages
824
Wtf! It's still something buggy with this ability! -.- It actually works like it should if there is only 1 target but if there is more than 1 target to attack for the Dummy-Hero, it seems to be bugging. Sometimes it creates more than 1 Dummy-Hero and it also sometimes seems to ignore attacking the primary target and instead attacking the picked units around it and sometimes more than 1 time. I also noticed when attacking an unit with 4 Ward-Classification units around it and the Ward units cannot be attacked by Cold Arrows, so instead it attacked the primary unit for the amount of times of the Ward units that where around it.. How can u set the triggers to NOT pick unit that is classificated as Wards? And why the hell does it sometimes ignore attacking the primary target unit if there is more units around it and also creates more than 1 Dummy-Hero sometimes?? Is there something wrong with the loop and is it even needed at all?
 
Level 12
Joined
Nov 3, 2013
Messages
989
You mean that it creates more units than targets of the split shot? (as it is it's supposed to create 1 dummy for each unit that will get hit by the skill)

Maybe you have not changed the target options for the dummy unit (it might not be able to attack certain targerts) and cold/frost arrows only work against organic units if you don't change it.
 
Level 15
Joined
Jul 19, 2007
Messages
824
You mean that it creates more units than targets of the split shot? (as it is it's supposed to create 1 dummy for each unit that will get hit by the skill)

Maybe you have not changed the target options for the dummy unit (it might not be able to attack certain targerts) and cold/frost arrows only work against organic units if you don't change it.
Oh I realised it is meant to create 1 Dummy-Hero for each unit is should be attacking.. Well then the problem is if the target is not able to be attacked by Cold Arrows then instead the created Dummy-Hero of that target will attack another target with cold arrows instead so it becames attack 2 times or more..
 
Level 12
Joined
Nov 3, 2013
Messages
989
You could use custom boolean variables together with dynamic indexing or save and load booleans through hashtable (this would probably be a bit more annoying to remember what goes where though).

This is probably more plausible for boss type kind of maps (you make special conditions so that you don't just perma CC bosses and such).
 
Status
Not open for further replies.
Top