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

[General] [TRIGGER] Doom Attack

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,602
Hey,

I'm trying to create a passive ability which will kill at the fifth attack instantly the attacked unit. The only condition is that the attacks must go in row(if unit changes target the thing is reseted).

I made already variables and things like that but I can't think how to finish this thing. There are totally of 15 this type of units which has this ability, but in the test map I just created 3 for testing.

Can someone help me to finish this little thing? GUI please.
 

Attachments

  • MONSTER DOOM.w3x
    18 KB · Views: 56
To do this you need to use a Hashtable, a DDS, and a tigger that fires based on the DDS.

In the trigger check who the attacking unit is attacking. Store who that unit is attacking based on the key of the attacked unit. Use 0 for the other integer. You can use this to check before to see if the attacking unit started attacking someone else.

If the attacking unit is attacking the same unit increase an integer to keep count of how many times the attacking unit hit the attacked unit.

You should also check to see that the attacking unit did more than 0 damage to the attacked unit to keep any bugs / invulnerable units from getting killed this way.
 
It can also be done with arrays. Loop from 1 to maxIndex, check if the caster is the damager. Then check if the target is something other than the target[maxindex]. If yes, increase stacks by one and kill at 5. If not, reset stacks to 0 and set target[].

E: dimf, do invul units get damaged? :eek:
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I'm just asking here for a simple GUI made system. It can be made with arrays; there will be totally of 2 units attacking same time anyway... Totally there are 15 units.

bribe got gui damage detection system

http://www.hiveworkshop.com/forums/...e-v2-2-1-0-a-201016/?prev=d=list&r=20&u=bribe

and work with array i guess but if u make a bit more complicated then able to add timer too in this stuff :D

like in bribe damage detection part where u handle the damge modification etc there check if unit got that passive skill then u can make a UNIT array

in bribe dds have unit indexer what set the unit custom value automatically so each unit have unique custom value, so in dds settings part u put make something like

Code:
if unit got my passive ability then
     if unit[custom value of attacker] = target unit then
           set integer[custom value of attacker] =  integer[custom value of attacker]+ 1
           if  integer[custom value of attacker] = 4 then 
                   kill the target
           endif
    else
          set unit[custom value of attacker]=target
    endif
endif

this u can do with simple gui if's and a unit array and a integer array
 
Level 10
Joined
Jun 6, 2007
Messages
392
The problem with a simple way to do this (without dds) is that spamming stop will cause targets to die instantly. There are several ways to do this with dds, but none of them is perfect.

option 1: If damaging unit doesn't have any spells, you can just check when a unit damaged (with any dds).

option 2: Use physical damage detection. The good thing is that it is able to differentiate spell damage from physical damage. The problem is, that poison damage is not reduced by spell damage reduction, and therefore it is counted as attacks.

option 3 (my favourite): Add a buff placer ability (based on e.g. slow poison) to units with this ability. When a unit is damaged, check if it has the buff, remove buff and do the required actions. The problem with this is that this will conflict with other buff placers, so you will have to trigger them. If you don't have other buff placers in your map, this isn't a problem.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Actually what Kitabatake just gave is exactly what I want. The enemies are neutral hostiles so the rapid attack bug doesn't matter. Also this is GUI and it doesn't need complicated systems. I can perfectly well work with this as well.

Thanks everyone for your thoughts and especially Kitabatake for the trigger. Yes! Now this problem is too fixed and enemies to the game can be placed. I'm one step closer to finishing the game... I can see the light at the end of tunnel already.
 

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
Arrays would be incredibly slow if more than 8 units are attacking. That is why I didn't mention them.

DDS is Damage Detection System found here on the hive in spells section.

Utilize indexer then ^)^ That's why indexer exists... Anyhow, Hashtable is slower than variable array..
 
Status
Not open for further replies.
Top