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

[Trigger] Need help with a spell not working.

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2011
Messages
27
Does anyone know how to make this trigger work? I want it to damage a random enemy unit, within 500 range, every 5 second for 100 damage.

Please respond as soon as you possibly can. Thanks.
 

Attachments

  • Namnlös.jpg
    Namnlös.jpg
    104.6 KB · Views: 85
Level 3
Joined
Jul 27, 2011
Messages
27
Use a unit variable

Set unit = random 1 unit from units within x of position matching matching unit is alive and owner of matching unit is an enemy of owner of caster
cause caster to damage unit

Oh right, still kinda new to triggering and all that.

Thanks alot! :)
 
Level 3
Joined
Jul 27, 2011
Messages
27
Hmm, I still can't get it to work!

The first trigger is the same as before and this is what the second looks like now:
 

Attachments

  • Namnlös.png
    Namnlös.png
    29.9 KB · Views: 110
Level 7
Joined
Apr 30, 2011
Messages
359
'ln_' prefixes should be 'DP_'
and DON'T null DP_Caster . . . .

and use 'Unit - Add expiration time' instead of REMOVING it with no waits (and please don't use wait, that will cause bug)
 
Level 3
Joined
Jul 27, 2011
Messages
27
'ln_' prefixes should be 'DP_'
and DON'T null DP_Caster . . . .

Wow, I feel so dumb >.<

and use 'Unit - Add expiration time' instead of REMOVING it with no waits (and please don't use wait, that will cause bug)

Oh, didn't really know what that function did before so I just used Wait >.<

http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/

Replace the owner of matching unit == random player condition with the is an enemy condition I posted. It is a boolean comparison.

Ah I see, thanks alot to both of you! :)
 
Level 3
Joined
Jul 27, 2011
Messages
27
Still not working.. :S

  • Actions
    • -------- Set target --------
    • Set DP_Target = (Random unit from (Units within 500.00 of (Position of DP_Caster) matching ((((Matching unit) is alive) Equal to True) and (((Owner of DP_Target) is an enemy of (Owner of DP_Caster)) Equal to True))))
    • -------- Create Dummy --------
    • Unit - Create 1 DUMMY CASTER for (Owner of DP_Caster) at (Position of DP_Caster) facing Default building facing degrees
    • Unit - Add a 0.50 second Generic expiration timer to DP_Dummy
    • Set DP_Dummy = (Last created unit)
    • -------- Apply Stun --------
    • Unit - Add Ministun to DP_Dummy
    • Unit - Order DP_Dummy to Human Mountain King - Storm Bolt In_Target
    • -------- Damage target / create SFX --------
    • Unit - Cause DP_Caster to damage DP_Target, dealing 100.00 damage of attack type Spells and damage type Normal
    • Special Effect - Create a special effect attached to the overhead of DP_Target using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
    • -------- Clear Variables --------
    • Set DP_Target = No unit
 
Level 7
Joined
Apr 30, 2011
Messages
359
Still not working.. :S

  • Actions
    • -------- Set target --------
    • Set DP_Target = (Random unit from (Units within 500.00 of (Position of DP_Caster) matching ((((Matching unit) is alive) Equal to True) and (((Owner of DP_Target) is an enemy of (Owner of DP_Caster)) Equal to True))))
    • -------- Create Dummy --------
    • Unit - Create 1 DUMMY CASTER for (Owner of DP_Caster) at (Position of DP_Caster) facing Default building facing degrees
    • Unit - Add a 0.50 second Generic expiration timer to DP_Dummy
    • Set DP_Dummy = (Last created unit)
    • -------- Apply Stun --------
    • Unit - Add Ministun to DP_Dummy
    • Unit - Order DP_Dummy to Human Mountain King - Storm Bolt In_Target
    • -------- Damage target / create SFX --------
    • Unit - Cause DP_Caster to damage DP_Target, dealing 100.00 damage of attack type Spells and damage type Normal
    • Special Effect - Create a special effect attached to the overhead of DP_Target using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
    • -------- Clear Variables --------
    • Set DP_Target = No unit

here what's wrong:
  • Set DP_Target = (Random unit from (Units within 500.00 of (Position of DP_Caster) matching ((((Matching unit) is alive) Equal to True) and (((Owner of Matching unit) is an enemy of (Owner of DP_Caster)) Equal to True))))
DP_Target should be Matching unit in this case . . .

  • Unit - Order DP_Dummy to Human Mountain King - Storm Bolt DP_Target
In_Target ?_? . . . should be DP_Target, and here's a bit of damage types
All attack types other than spells follow the armor reduction rules
Spells attack type with Physical/Normal damage type will follow armor reduction rules, and the damaged unit's armor and Spell Damage Reduction item ability
Spells attack type with Magic damage type will follow Spell Damage Reduction item ability, and magic damage reduction rules, ignoring armor rules
Spells attack type with Universal damage type will only follow Spell Damage Reduction item ability, and no other else . . .

  • Set DP_Dummy = No unit
add that please ~.~
or just remove both of those, since it's unnecessary . . . .
you use it again and again, no need of nulling . .

and make sure your Dummy unit's Art - Spell cast animation is 0.000
 
Level 3
Joined
Jul 27, 2011
Messages
27
here what's wrong:
  • Set DP_Target = (Random unit from (Units within 500.00 of (Position of DP_Caster) matching ((((Matching unit) is alive) Equal to True) and (((Owner of Matching unit) is an enemy of (Owner of DP_Caster)) Equal to True))))
DP_Target should be Matching unit in this case . . .

  • Unit - Order DP_Dummy to Human Mountain King - Storm Bolt DP_Target
In_Target ?_? . . . should be DP_Target, and here's a bit of damage types
All attack types other than spells follow the armor reduction rules
Spells attack type with Physical/Normal damage type will follow armor reduction rules, and the damaged unit's armor and Spell Damage Reduction item ability
Spells attack type with Magic damage type will follow Spell Damage Reduction item ability, and magic damage reduction rules, ignoring armor rules
Spells attack type with Universal damage type will only follow Spell Damage Reduction item ability, and no other else . . .

  • Set DP_Dummy = No unit
add that please ~.~
or just remove both of those, since it's unnecessary . . . .
you use it again and again, no need of nulling . .

and make sure your Dummy unit's Art - Spell cast animation is 0.000


Don't understand the first part o_O
Thanks for the rest, I must have been really tired when I posted this.. So obvious mistakes >.<

Owner of DP_target
^You use that before the variable is set.

Setting the variable is the first thing I do? :s
 
Level 7
Joined
Apr 30, 2011
Messages
359
for the first part . . .
if you use that, you will check DP_Target's last value, not current DP_Target . .
since it's not yet assigned . . .
therefore, use Matching Unit instead . . . . .
 
Level 3
Joined
Jul 27, 2011
Messages
27
for the first part . . .
if you use that, you will check DP_Target's last value, not current DP_Target . .
since it's not yet assigned . . .
therefore, use Matching Unit instead . . . . .

So I should do like Set DP_Target = (Matching unit) matching *blabla conditions*?
 
Level 7
Joined
Apr 30, 2011
Messages
359
no ~.~

use Matching Unit inside Pick Units actions . . . . .
if you use Set DP_Target = (Matching unit), then it will has no value . . . . (or another value, that doesn't match with your prob at all)
 
Status
Not open for further replies.
Top