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

Causing damage to a unit with Triggers and variables.

Status
Not open for further replies.
Level 5
Joined
Jul 13, 2010
Messages
84
I'm making this trigger which when cast is supposed to pause both the target and the user and then 5 times a second for the 6 second duration the target is supposed to take damage based on the level of the ability. This is how I have it set up:

Abilityy
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Ability
Actions
Set chargetarget[TempInt] = (Target unit of ability being cast)
Unit - Pause (Triggering unit)
Unit - Pause chargetarget[TempInt]
Unit - Pause (Target unit of ability being cast)
Trigger - Turn on Attack Anim <gen>

Attack Anim
Events
Time - Every 0.20 seconds of game time
Conditions
Actions
Animation - Play Attacker 0030 <gen>'s Attack animation
Unit - Cause Attacker 0030 <gen> to damage chargetarget[TempInt], dealing (1.00 + damage[(Level of Ability for (Triggering unit))]) damage of attack type Chaos and damage type Death

chargetarget= Unit Array
TempInt= Integer

It doesn't do damage and the target doesn't freeze when the spell is cast.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Unit - A unit Finishes casting an ability
Change to A unit Starts the effect of an ability

I suggest that you save (Triggering unit) into a variable.


Unit - Pause chargetarget[TempInt]
Unit - Pause (Target unit of ability being cast)
Why do you pause the same unit ?

Unit - Cause Attacker 0030 <gen> to damage chargetarget[TempInt], dealing (1.00 + damage[(Level of Ability for (Triggering unit))]) damage of attack type Chaos and damage type Death
As I said, save the (Triggering unit) into a variable and use it here "Cause YourTriggeringUnitVariable to damage bla bla bla..."
Also, it should be "damage[(Level of Ability for YourTriggeringUnitVariable)]"

You used (Triggering unit) there, the event and the reference does not meet up (Trigger "Attack Anim")
 
Level 5
Joined
Jul 13, 2010
Messages
84
Thanks, I changed the casting part.
Well I tried Target unit of ability being cast but it didnt work
so I did a thing where i set the target unit into a variable and just repeated it, but neither work and I don't know why.
How do I trigger the damage part, or is that right?
 
Status
Not open for further replies.
Top