• 🏆 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!

[Trigger] Local Group not detected

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2018
Messages
110
My ability works this way:
  • Meat Cannon Copy
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Meat Cannon
    • Actions
      • Custom script: local location udg_LocalPoint
      • Custom script: local location udg_LocalPoint2
      • Custom script: local group udg_LocalGroup
      • Set Caster = (Triggering unit)
      • Set LocalPoint = (Target point of ability being cast)
      • Set LocalPoint2 = (Position of Caster)
      • Set LocalGroup = (Units within 300.00 of LocalPoint matching ((((Matching unit) belongs to an ally of (Owner of Caster)) Equal to False) and (((Matching unit) is alive) Equal to True)))
      • Unit - Create 1 Dummy Meat Wagon for (Owner of Caster) at LocalPoint2 facing Default building facing degrees
      • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Attack Ground LocalPoint
      • Unit - Cause Caster to damage Caster, dealing ((Real((Max HP of Caster))) / 6.00) damage of attack type Chaos and damage type Normal
      • Unit Group - Pick every unit in LocalGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause Caster to damage (Picked unit), dealing ((40.00 x (Real((Level of Meat Cannon for Caster)))) + (4.00 x (Real((Strength of Caster (Include bonuses)))))) damage of attack type Spells and damage type Normal
      • Custom script: set udg_Caster = null
      • Custom script: call DestroyGroup(udg_LocalGroup)
      • Custom script: call RemoveLocation(udg_LocalPoint)
      • Custom script: call RemoveLocation(udg_LocalPoint2)
But I want it to be MUI, so caster to be local and to add wait:
  • Meat Cannon Copy
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Meat Cannon
    • Actions
      • Custom script: local unit udg_Caster
      • Custom script: local location udg_LocalPoint
      • Custom script: local location udg_LocalPoint2
      • Custom script: local group udg_LocalGroup
      • Set Caster = (Triggering unit)
      • Set LocalPoint = (Target point of ability being cast)
      • Set LocalPoint2 = (Position of Caster)
      • Set LocalGroup = (Units within 300.00 of LocalPoint matching ((((Matching unit) belongs to an ally of (Owner of Caster)) Equal to False) and (((Matching unit) is alive) Equal to True)))
      • Unit - Create 1 Dummy Meat Wagon for (Owner of Caster) at LocalPoint2 facing Default building facing degrees
      • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Attack Ground LocalPoint
      • Unit - Cause Caster to damage Caster, dealing ((Real((Max HP of Caster))) / 6.00) damage of attack type Chaos and damage type Normal
      • Wait 1.30 seconds
      • Unit Group - Pick every unit in LocalGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause Caster to damage (Picked unit), dealing ((40.00 x (Real((Level of Meat Cannon for Caster)))) + (4.00 x (Real((Strength of Caster (Include bonuses)))))) damage of attack type Spells and damage type Normal
      • Custom script: set udg_Caster = null
      • Custom script: call DestroyGroup(udg_LocalGroup)
      • Custom script: call RemoveLocation(udg_LocalPoint)
      • Custom script: call RemoveLocation(udg_LocalPoint2)
But above code won't work properly(units in group are not damaged) after adding those 2 lines.
 
Level 13
Joined
May 10, 2009
Messages
868
You'll need an auxiliary local variable in order to reference the caster, and let go of shadowing the caster global variable. Combine both of them, and retrieve the value after the wait action.

  • Custom script: local unit caster = GetTriggerUnit()
  • Custom script: local location udg_LocalPoint
  • Custom script: local location udg_LocalPoint2
  • Custom script: local group udg_LocalGroup
  • Custom script: set udg_Caster = caster
  • Set LocalPoint = (Target point of ability being cast)
  • Set LocalPoint2 = (Position of Caster)
  • Set LocalGroup = (Units within 300.00 of LocalPoint matching ((((Matching unit) belongs to an ally of (Owner of Caster)) Equal to False) and (((Matching unit) is alive) Equal to True)))
  • Unit - Create 1 Dummy Meat Wagon for (Owner of Caster) at LocalPoint2 facing Default building facing degrees
  • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
  • Unit - Order (Last created unit) to Attack Ground LocalPoint
  • Unit - Cause Caster to damage Caster, dealing ((Real((Max HP of Caster))) / 6.00) damage of attack type Chaos and damage type Normal
  • Wait 1.30 seconds
  • Custom script: set udg_Caster = caster
  • Unit Group - Pick every unit in LocalGroup and do (Actions)
    • Loop - Actions
      • Unit - Cause Caster to damage (Picked unit), dealing ((40.00 x (Real((Level of Meat Cannon for Caster)))) + (4.00 x (Real((Strength of Caster (Include bonuses)))))) damage of attack type Spells and damage type Normal
  • Custom script: call RemoveLocation(udg_LocalPoint)
  • Custom script: call RemoveLocation(udg_LocalPoint2)
  • Custom script: call DestroyGroup(udg_LocalGroup)
  • Custom script: set caster = null

EDIT: Never mind this post. Tasyen said something below where you'll put way less effort into it, and will still have the same result.
 
Last edited:
Level 5
Joined
Dec 25, 2018
Messages
110
  • Meat Cannon Copy Copy
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Meat Cannon
    • Actions
      • Custom script: local unit udg_Caster
      • Custom script: local group udg_LocalGroup
      • Set Caster = (Triggering unit)
      • Set LocalPoint = (Target point of ability being cast)
      • Set LocalPoint2 = (Position of Caster)
      • Set LocalGroup = (Units within 300.00 of LocalPoint matching ((((Matching unit) belongs to an ally of (Owner of Caster)) Equal to False) and (((Matching unit) is alive) Equal to True)))
      • Unit - Create 1 Dummy Meat Wagon for (Owner of Caster) at LocalPoint2 facing Default building facing degrees
      • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Attack Ground LocalPoint
      • Unit - Cause Caster to damage Caster, dealing ((Real((Max HP of Caster))) / 6.00) damage of attack type Chaos and damage type Normal
      • Custom script: call RemoveLocation(udg_LocalPoint)
      • Custom script: call RemoveLocation(udg_LocalPoint2)
      • Wait 1.30 seconds
      • Unit Group - Pick every unit in LocalGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause Caster to damage (Picked unit), dealing ((40.00 x (Real((Level of Meat Cannon for Caster)))) + (4.00 x (Real((Strength of Caster (Include bonuses)))))) damage of attack type Spells and damage type Normal
      • Custom script: set udg_Caster = null
      • Custom script: call DestroyGroup(udg_LocalGroup)
Still doesn't work
 
Status
Not open for further replies.
Top