• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Need Help: Pull units to caster spell

Status
Not open for further replies.
Level 7
Joined
May 15, 2009
Messages
191
So hi again, I thought this would be a simple ability, but somehow all but of the units I try to hit with the spell, are moved to the center of the map, instead of where they are actually suppose to go. So heres my trigger - not sure what the problem is
Oh and btw, if anyone could redo the ability into pulling the units(fast) instead of just teleporting them to the caster, it would be great - actually, more like PERFECT.

  • Noxious Winds
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Noxious Winds
    • Actions
      • Set NoxiousWinds_Tempp1 = (Position of (Triggering unit))
      • Set NoxiousWinds_Tempg = (Units within 600.00 of NoxiousWinds_Tempp1 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is dead) Not equal to True))))
      • Unit Group - Pick every unit in NoxiousWinds_Tempg and do (Actions)
        • Loop - Actions
          • Set NoxiousWinds_Picked = (Picked unit)
          • Set NoxiousWinds_Tempp2 = (Position of NoxiousWinds_Picked)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp2 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp1 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Turn collision for NoxiousWinds_Picked Off
          • Custom script: call SetUnitX(udg_NoxiousWinds_Picked,GetLocationX(udg_NoxiousWinds_Tempp1))
          • Custom script: call SetUnitY(udg_NoxiousWinds_Picked,GetLocationY(udg_NoxiousWinds_Tempp1))
          • Unit - Turn collision for NoxiousWinds_Picked On
          • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp1)
          • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp2)
      • Custom script: call DestroyGroup(udg_NoxiousWinds_Tempg)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
So hi again, I thought this would be a simple ability, but somehow all but of the units I try to hit with the spell, are moved to the center of the map, instead of where they are actually suppose to go. So heres my trigger - not sure what the problem is
Oh and btw, if anyone could redo the ability into pulling the units(fast) instead of just teleporting them to the caster, it would be great - actually, more like PERFECT.

  • Noxious Winds
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Noxious Winds
    • Actions
      • Set NoxiousWinds_Tempp1 = (Position of (Triggering unit))
      • Set NoxiousWinds_Tempg = (Units within 600.00 of NoxiousWinds_Tempp1 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is dead) Not equal to True))))
      • Unit Group - Pick every unit in NoxiousWinds_Tempg and do (Actions)
        • Loop - Actions
          • Set NoxiousWinds_Picked = (Picked unit)
          • Set NoxiousWinds_Tempp2 = (Position of NoxiousWinds_Picked)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp2 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp1 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Turn collision for NoxiousWinds_Picked Off
          • Unit - Order NoxiousWinds_Picked to Right-Click NoxiousWinds_Tempp1
      • Custom script: call DestroyGroup(udg_NoxiousWinds_Tempg)

try order? :p


Unit - Order NoxiousWinds_Picked to Right-Click NoxiousWinds_Tempp1
 
Level 7
Joined
May 15, 2009
Messages
191
Sorry everyone, I posted a mistake in the trigger, the Right Click was just an attempt to fix a problem (which turned out not to be a real problem) the actual trigger is this:

  • Noxious Winds
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Noxious Winds
    • Actions
      • Set NoxiousWinds_Tempp1 = (Position of (Triggering unit))
      • Set NoxiousWinds_Tempg = (Units within 600.00 of NoxiousWinds_Tempp1 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is dead) Not equal to True))))
      • Unit Group - Pick every unit in NoxiousWinds_Tempg and do (Actions)
        • Loop - Actions
          • Set NoxiousWinds_Picked = (Picked unit)
          • Set NoxiousWinds_Tempp2 = (Position of NoxiousWinds_Picked)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp2 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp1 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Turn collision for NoxiousWinds_Picked Off
          • Custom script: call SetUnitX(udg_NoxiousWinds_Picked,GetLocationX(udg_NoxiousWinds_Tempp1))
          • Custom script: call SetUnitY(udg_NoxiousWinds_Picked,GetLocationY(udg_NoxiousWinds_Tempp1))
          • Unit - Turn collision for NoxiousWinds_Picked On
          • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp1)
          • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp2)
      • Custom script: call DestroyGroup(udg_NoxiousWinds_Tempg)
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
Sorry everyone, I posted a mistake in the trigger, it the Right Click was just an attempt to fix a problem (which turned out not to be a real problem) the actual trigger is this:

  • Noxious Winds
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Noxious Winds
    • Actions
      • Set NoxiousWinds_Tempp1 = (Position of (Triggering unit))
      • Set NoxiousWinds_Tempg = (Units within 600.00 of NoxiousWinds_Tempp1 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is dead) Not equal to True))))
      • Unit Group - Pick every unit in NoxiousWinds_Tempg and do (Actions)
        • Loop - Actions
          • Set NoxiousWinds_Picked = (Picked unit)
          • Set NoxiousWinds_Tempp2 = (Position of NoxiousWinds_Picked)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp2 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp1 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Turn collision for NoxiousWinds_Picked Off
          • Custom script: call SetUnitX(udg_NoxiousWinds_Picked,GetLocationX(udg_NoxiousWinds_Tempp1))
          • Custom script: call SetUnitY(udg_NoxiousWinds_Picked,GetLocationY(udg_NoxiousWinds_Tempp1))
          • Unit - Turn collision for NoxiousWinds_Picked On
          • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp1)
          • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp2)
      • Custom script: call DestroyGroup(udg_NoxiousWinds_Tempg)

ok but why u do this?
u destroy the udg_NoxiousWinds_Tempp1 after u used it 1st time, its mean everything will be srewed when ur loop get the 2nd picked unit

  • Noxious Winds
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Noxious Winds
    • Actions
      • Set NoxiousWinds_Tempp1 = (Position of (Triggering unit))
      • Set NoxiousWinds_Tempg = (Units within 600.00 of NoxiousWinds_Tempp1 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is dead) Not equal to True))))
      • Unit Group - Pick every unit in NoxiousWinds_Tempg and do (Actions)
        • Loop - Actions
          • Set NoxiousWinds_Picked = (Picked unit)
          • Set NoxiousWinds_Tempp2 = (Position of NoxiousWinds_Picked)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp2 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at NoxiousWinds_Tempp1 using Abilities\Spells\Other\Tornado\TornadoElemental.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Turn collision for NoxiousWinds_Picked Off
          • Custom script: call SetUnitX(udg_NoxiousWinds_Picked,GetLocationX(udg_NoxiousWinds_Tempp1))
          • Custom script: call SetUnitY(udg_NoxiousWinds_Picked,GetLocationY(udg_NoxiousWinds_Tempp1))
          • Unit - Turn collision for NoxiousWinds_Picked On
          • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp2)
    • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp1)
    • Custom script: call DestroyGroup(udg_NoxiousWinds_Tempg)
why u use set unit x,y if u use already location for special effect?
better if u do this


  • Noxious Winds
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Noxious Winds
    • Actions
      • Set NoxiousWinds_Tempp1 = (Position of (Triggering unit))
      • Set NoxiousWinds_Tempg = (Units within 600.00 of NoxiousWinds_Tempp1 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is dead) Not equal to True))))
      • Set x = (X of (NoxiousWinds_Tempp1))
      • Set y = (Y of (NoxiousWinds_Tempp1))
      • Custom script: call RemoveLocation(udg_NoxiousWinds_Tempp1)
      • Unit Group - Pick every unit in NoxiousWinds_Tempg and do (Actions)
        • Loop - Actions
          • Set NoxiousWinds_Picked = (Picked unit)
          • Custom script: call DestroyEffect(AddSpecialEffect ("Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl", GetUnitX(udg_NoxiousWinds_Picked) , GetUnitY(udg_NoxiousWinds_Picked)))
          • Custom script: call DestroyEffect(AddSpecialEffect ("Abilities\\Spells\\Other\\Tornado\\TornadoElemental.mdl", udg_x , udg_y))
          • Unit - Turn collision for NoxiousWinds_Picked Off
          • Custom script: call SetUnit(udg_NoxiousWinds_Picked,udg_x,udg_y )
          • Unit - Turn collision for NoxiousWinds_Picked On
    • Custom script: call DestroyGroup(udg_NoxiousWinds_Tempg)
 
Level 7
Joined
May 15, 2009
Messages
191
Ok thx for the replies and the help guys, u were right. All i had to do was move the Destroy NoxiousWinds_tempp1. Thx for the assistance. Much appreciated +rep

And also, to shadowvzs, the reason that I diden't use your custom script is that I diden't know it.
 
Status
Not open for further replies.
Top