• 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] Multiple Targets Chain Lightning

Status
Not open for further replies.
Level 17
Joined
Jan 21, 2007
Messages
2,014
Ok, i tried to make a non-target chain lightning which fires chain lightning at all nearby enemy units. The problem is it only shoots one.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Overload
  • Actions
    • Set Overload_Temp_point = (Position of (Triggering unit))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 800.00 of Overload_Temp_point matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Create 1 Dummy Unit 1 for (Owner of (Triggering unit)) at Overload_Temp_point facing Default building facing degrees
        • Unit - Add Focused Lightning to (Last created unit)
        • Unit - Set level of Focused Lightning for (Last created unit) to (Level of Focused Lightning () for (Triggering unit))
        • Unit Group - Order (Last created unit group) to Orc Far Seer - Chain Lightning (Picked unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Custom script: call RemoveLocation(udg_Overload_Temp_point)
 
1) Shouldn't
  • Unit - Set level of Focused Lightning for (Last created unit) to (Level of Focused Lightning () for (Triggering unit))
be
  • Unit - Set level of Focused Lightning for (Last created unit) to (Level of Overload for (Triggering unit))
?
2) You remove the location in the loop, so the unit will be spawned at the middle of the map (coords 0|0) and should be out of range... just put it at the end instead of in the loop ;)

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Overload
  • Actions
    • Set Overload_Temp_point = (Position of (Triggering unit))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 800.00 of Overload_Temp_point matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Create 1 Dummy Unit 1 for (Owner of (Triggering unit)) at Overload_Temp_point facing Default building facing degrees
        • Unit - Add Focused Lightning to (Last created unit)
        • Unit - Set level of Focused Lightning for (Last created unit) to (Level of Focused Lightning () for (Triggering unit))
        • Unit Group - Order (Last created unit group) to Orc Far Seer - Chain Lightning (Picked unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation(udg_Overload_Temp_point)
 
Level 9
Joined
Apr 3, 2008
Messages
700
I think that it casts several times but with one starting and ending locations.
Try this.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Overload
  • Actions
    • Custom script: local location p=(Position of (Triggering unit))
    • Custom script: local location p2
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 800.00 of p matching (((Matching unit) belongs to an enemy of (Triggering Player)) Equal to True)) and do (Actions)
      • Loop - Actions
        • Custom script: set p2=(Position of (GetEnumUnit())
        • Unit - Create 1 Dummy Unit 1 for (Owner of (Triggering unit)) at p2 facing Default building facing degrees
        • Unit - Add Focused Lightning to (Last created unit)
        • Unit - Set level of Focused Lightning for (Last created unit) to (Level of Focused Lightning () for (Triggering unit))
        • Unit Group - Order (Last created unit group) to Orc Far Seer - Chain Lightning (Picked unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation(p)
    • Custom script: set p=null
    • Custom script: set p2=null
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
I think that it casts several times but with one starting and ending locations.
Try this.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Overload
  • Actions
    • Custom script: local location p=(Position of (Triggering unit))
    • Custom script: local location p2
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 800.00 of p matching (((Matching unit) belongs to an enemy of (Triggering Player)) Equal to True)) and do (Actions)
      • Loop - Actions
        • Custom script: set p2=(Position of (GetEnumUnit())
        • Unit - Create 1 Dummy Unit 1 for (Owner of (Triggering unit)) at p2 facing Default building facing degrees
        • Unit - Add Focused Lightning to (Last created unit)
        • Unit - Set level of Focused Lightning for (Last created unit) to (Level of Focused Lightning () for (Triggering unit))
        • Unit Group - Order (Last created unit group) to Orc Far Seer - Chain Lightning (Picked unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation(p)
    • Custom script: set p=null
    • Custom script: set p2=null

Way past wrong.
 
Status
Not open for further replies.
Top