[Trigger] Fragmenting Skill

Level 18
Joined
Jan 22, 2010
Messages
2,583
Hello, indomitable1319 here.
I'm making a tower that when it damages a unit, the attack will create a dummy above the unit and make the dummy cast Forked Lightning, damaging units around it.

Its actual description is "Attacks fragment into 4, damaging the same unit and damaging 4 others around it."

My concept was stated on the first sentence: When the unit gets hit, a dummy will cast Forked Lightning.

There was one problem, though. When I made the custom spell abilities, and the trigger and tried it out, it caused extreme lag and caused my computer to restart.
I thought it was just creating an endless damage loop (Despite knowing that it didn't) that cause the trigger to just keep on looping so I turned it off and on, but that didn't solve the problem.

Also, the only thing that changed with the Forked Lightning is the damage, number of units hit, mana cost and cooldown; nothing else.

Here's the trigger:
  • Fragment
    • Events
    • Conditions
      • (Unit-type of (Damage source)) Equal to Fragmenting Tower [Level 4]
    • Actions
      • Trigger - Turn off (This trigger)
      • Set Fragment_Unit = (Triggering unit)
      • Set Fragment_Point = (Position of Fragment_Unit)
      • Unit - Create 1 Dummy Unit for (Owner of (Damage source)) at Fragment_Point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Fragment_Point)
      • Set Fragment_Dummy = (Last created unit)
      • Unit - Add a 5.00 second Generic expiration timer to Fragment_Dummy
      • Unit - Add Fragment (Neutral Hostile) to Fragment_Dummy
      • Unit - Order Fragment_Dummy to Neutral Naga Sea Witch - Forked Lightning Fragment_Unit
      • Trigger - Turn on (This trigger)
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
You don't need to set the variables Fragment_Unit and Fragment_Dummy. When setting Fragment_Point, say: (Position of (Triggering unit)). Also, refer to Last Created Unit for the dummy things, like: Add Fragment (Neutral Hostile) to (Last created unit). You can also reduce the expiration timer from 5 seconds to 1 second.
 
Level 18
Joined
Jan 22, 2010
Messages
2,583
You don't need to set the variables Fragment_Unit and Fragment_Dummy. When setting Fragment_Point, say: (Position of (Triggering unit)). Also, refer to Last Created Unit for the dummy things, like: Add Fragment (Neutral Hostile) to (Last created unit). You can also reduce the expiration timer from 5 seconds to 1 second.

Making it one second sometimes kills the unit too early before it can cast the spell.

The turn off(on doesn't do much, since the actual damage is delayed a bit. It is not instant. Is the cast point of your dummy 0?

The unit type condition should prevent an infinite loop.

I recommend you post the map. You can PM me if you don't feel comfortable posting it in public.

I'll send you the map.
 
Top