• 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] Electric Problem

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2008
Messages
253
Hey there, I made a spell called Electric Overload that basicly shoots a chain lightning to everyone in a 500 radius.

The problem is that sometimes I cast the spell there is still a unit that doesn't get a chain lightning in his face.

Here's the trigger:

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Electric Overload
  • Actions
    • Set temp_unit = (Casting unit)
    • Set temp_point = (Position of temp_unit)
    • Unit Group - Pick every unit in (Units within 500.00 of temp_point matching (((Matching unit) belongs to an enemy of (Owner of temp_unit)) Equal to True)) and do (Actions)
      • Loop - Actions
        • Set temp_unit_target = (Picked unit)
        • Unit - Create 1 dummy for (Owner of temp_unit) at temp_point facing Default building facing degrees
        • Set temp_unit_spawned = (Last created unit)
        • Unit - Add a 1.00 second Generic expiration timer to temp_unit_spawned
        • Unit - Order temp_unit_spawned to Orc Far Seer - Chain Lightning temp_unit_target
    • Custom script: call RemoveLocation(udg_temp_point)
    • Custom script: set udg_temp_unit = null
    • Custom script: set udg_temp_unit_target = null
    • Custom script: set udg_temp_unit_spawned = null
Thanks in advance, Quetzalcotl
 
Level 10
Joined
Jun 16, 2007
Messages
415
Ok, there is a range of things you might have done wrong:

1. Check what units your chain lightning spell can target. Can it target air, ground, neutral, enemy, etc?

2. Instead of (Matching unit) belongs to an enemy of (Owner of temp_unit), try (Matching unit) belongs to an ally of (Owner of temp_unit) == false, this way it will pick neutral units too.

3. You do realize that chain lightning needs for the caster to be alive in order to keep casting. Since you applied a timed life of 1.00, the dummy caster will die after 1 second, hence the chain-lightning will stop after 1 second, even it didn't hit all units. This is most likely what you did wrong, just increase Generic expiration timer time to something like 5.
 
Status
Not open for further replies.
Top