• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Add Unit Group isn't working

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockblast (|cffFFcc00S|r) T1 ELEM
    • Actions
      • Custom script: local unit u = GetSpellTargetUnit()
      • Custom script: local unit u2 = GetTriggerUnit()
      • Unit Group - Remove all units of Temp_UnitGroup from Temp_UnitGroup
      • Set TempLoc2 = (Position of (Target unit of ability being cast))
      • Set TempLoc = (TempLoc2 offset by 1000.00 towards 0.00 degrees)
      • Unit - Create 1 Ice Sting Dummy for (Triggering player) at TempLoc facing TempLoc2
      • Unit Group - Add (Last created unit) to Temp_UnitGroup
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (TempLoc2 offset by 1000.00 towards 90.00 degrees)
      • Unit - Create 1 Ice Sting Dummy for (Triggering player) at TempLoc facing TempLoc2
      • Unit Group - Add (Last created unit) to Temp_UnitGroup
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (TempLoc2 offset by 1000.00 towards 180.00 degrees)
      • Unit - Create 1 Ice Sting Dummy for (Triggering player) at TempLoc facing TempLoc2
      • Unit Group - Add (Last created unit) to Temp_UnitGroup
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (TempLoc2 offset by 1000.00 towards 270.00 degrees)
      • Unit - Create 1 Ice Sting Dummy for (Triggering player) at TempLoc facing TempLoc2
      • Unit Group - Add (Last created unit) to Temp_UnitGroup
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) for 30.00 seconds the text: hsfdghf
          • Unit - Order (Picked unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
          • Unit - Add a 2.00 second Generic expiration timer to (Picked unit)
      • Wait 1.25 seconds
      • Custom script: set udg_TempUnit = u
      • Custom script: set udg_TempUnit2 = u2
      • Unit - Cause TempUnit2 to damage TempUnit, dealing ((30.00 x (Real((Level of Shockblast (|cffFFcc00S|r) T1 ELEM for TempUnit2)))) x (Real((Intelligence of TempUnit2 (Include bonuses))))) damage of attack type Spells and damage type Normal
Everything works except the unit groups. It doesn't display any hsfdghfs, even though the dummy units are created (changed to an actual model for debug purposes) . I dont think the units rae being correctly added, but i dont know..

The damage works btw
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
u dont destroyed the Temp_UnitGroup somewhere with custom script?

u dont need group for everything

  • blabla
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Custom script: local unit u
      • Custom script: local unit ut
      • Set caster = (Triggering unit)
      • Set target = (Target unit of ability being cast)
      • Set p = (Position of target)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set p1 = (p offset by 1000.00 towards ((Real((Integer A))) x 90.00) degrees)
          • Unit - Create 1 Knight for (Triggering player) at p1 facing Default building facing degrees
          • Set unit_array[(Integer A)] = (Last created unit)
          • Custom script: call RemoveLocation(udg_p1)
          • Unit - Order unit_array[(Integer A)] to Human Mountain King - Storm Bolt target
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_p)
      • Custom script: set u = udg_caster
      • Custom script: set ut = udg_target
      • Wait 2.00 seconds
      • Custom script: set udg_caster=u
      • Custom script: set udg_target=ut
      • Unit - Cause caster to damage target, dealing 500.00 damage of attack type Spells and damage type Normal
      • Custom script: set u = null
      • Custom script: set ut = null
 
Status
Not open for further replies.
Top