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

[Solved] Cord Skill Help

Status
Not open for further replies.
Level 7
Joined
Oct 6, 2022
Messages
146
Hello guys, Sorry for bothering again can i ask how to make a cord skill where it creates a dummy in the center then picks every units that has been in the targeted area only once; if one the units moved outside more than 500 of the position of the dummy all of the units would be gathered at the center of the position of the dummy then it end the trigger? It was Gui
it was like this, i hope you guys understand it.
 

Attachments

  • Cord Skill.png
    Cord Skill.png
    53.6 KB · Views: 7
Last edited:

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,725
You know you spend too much time on these forums when people begin their threads with "Hello Uncle", lol!

Anyway, I think I understand what you want, but should there be some kind of pull mechanic like Dark Seer's Vacuum from DotA? Or should it be as simple as:

Pick Every Unit -> Move Picked Unit Instantly To Center.

I'll show you the simple method for now as I would rather not have to deal with a pull mechanic.
 
Level 7
Joined
Oct 6, 2022
Messages
146
My bad with the first greeting, Lately i was thinking to pm you and make a script of how would interact but i don't know how so i just copied and pasted it in here without knowing i didn't edit it hahaha.(i fixed it now)
Anyway Yeah it was like that but with a twist.
 

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,725
It's fine, it'd probably be better to make the thread like normal but @Uncle me so I get a notification.

Here are the triggers:
  • Magic Leash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Leash
    • Actions
      • Set VariableSet ML_Index = (ML_Index + 1)
      • -------- --------
      • Set VariableSet ML_Caster[ML_Index] = (Triggering unit)
      • Set VariableSet ML_Point[ML_Index] = (Target point of ability being cast)
      • Custom script: set udg_ML_Targets[udg_ML_Index] = CreateGroup()
      • -------- --------
      • -------- Define leash range and spell area of effect: --------
      • Set VariableSet ML_Leash_Range[ML_Index] = 500.00
      • Set VariableSet ML_Targets[ML_Index] = (Units within 200.00 of ML_Point[ML_Index].)
      • -------- --------
      • -------- I'm removing unwanted units (An odd way of doing it, but it works): --------
      • Unit Group - Pick every unit in ML_Targets[ML_Index] and do (Actions)
        • Loop - Actions
          • Set VariableSet ML_Target = (Picked unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ML_Target belongs to an enemy of (Owner of ML_Caster[ML_Index]).) Equal to True
              • (ML_Target is alive) Equal to True
              • (ML_Target is A structure) Equal to False
              • (ML_Target is Magic Immune) Equal to False
              • (ML_Target is invulnerable) Equal to False
            • Then - Actions
            • Else - Actions
              • Unit Group - Remove ML_Target from ML_Targets[ML_Index].
      • -------- --------
      • -------- It's possible that the unit cast the spell on absolutely nothing: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ML_Targets[ML_Index]) Equal to 0
        • Then - Actions
          • Set VariableSet ML_Index = (ML_Index - 1)
          • Custom script: call DestroyGroup(udg_ML_Targets[udg_ML_Index])
          • Custom script: call RemoveLocation(udg_ML_Point[udg_ML_Index])
        • Else - Actions
          • Trigger - Turn on Magic Leash Loop <gen>
  • Magic Leash Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ML_Loop) from 1 to ML_Index, do (Actions)
        • Loop - Actions
          • Set VariableSet ML_Is_Broken = False
          • -------- --------
          • Unit Group - Pick every unit in ML_Targets[ML_Loop] and do (Actions)
            • Loop - Actions
              • Set VariableSet ML_Target = (Picked unit)
              • -------- --------
              • Set VariableSet ML_Point[0] = (Position of ML_Target)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between ML_Point[0] and ML_Point[ML_Loop]) Greater than ML_Leash_Range[ML_Loop]
                • Then - Actions
                  • Set VariableSet ML_Is_Broken = True
                • Else - Actions
              • -------- --------
              • Custom script: call RemoveLocation(udg_ML_Point[0])
          • -------- --------
          • -------- If the leash has been broken then let's end this instance of the spell: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ML_Is_Broken Equal to True
            • Then - Actions
              • -------- Some optional special effects to make it look nice: --------
              • Special Effect - Create a special effect at ML_Point[ML_Loop] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- --------
              • -------- Pull them to the center: --------
              • Unit Group - Pick every unit in ML_Targets[ML_Loop] and do (Actions)
                • Loop - Actions
                  • Set VariableSet ML_Target = (Picked unit)
                  • Unit - Move ML_Target instantly to ML_Point[ML_Loop]
              • -------- --------
              • -------- Here is where we remove this instance of the spell from the loop: --------
              • Custom script: call DestroyGroup(udg_ML_Targets[udg_ML_Loop])
              • Custom script: call RemoveLocation(udg_ML_Point[udg_ML_Loop])
              • -------- --------
              • Set VariableSet ML_Caster[ML_Loop] = ML_Caster[ML_Index]
              • Set VariableSet ML_Leash_Range[ML_Loop] = ML_Leash_Range[ML_Index]
              • Set VariableSet ML_Targets[ML_Loop] = ML_Targets[ML_Index]
              • Set VariableSet ML_Point[ML_Loop] = ML_Point[ML_Index]
              • -------- --------
              • Set VariableSet ML_Index = (ML_Index - 1)
              • Set VariableSet ML_Loop = (ML_Loop - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ML_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
vars.png
 

Attachments

  • Magic Leash 1.w3m
    21.4 KB · Views: 2
Last edited:
Level 7
Joined
Oct 6, 2022
Messages
146
It's fine, it'd probably be better to make the thread like normal but @Uncle me so I get a notification.

Here are the triggers:
  • Magic Leash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Leash
    • Actions
      • Set VariableSet ML_Index = (ML_Index + 1)
      • -------- --------
      • Set VariableSet ML_Caster[ML_Index] = (Triggering unit)
      • Set VariableSet ML_Point[ML_Index] = (Target point of ability being cast)
      • Custom script: set udg_ML_Targets[udg_ML_Index] = CreateGroup()
      • -------- --------
      • -------- Define leash range and spell area of effect: --------
      • Set VariableSet ML_Leash_Range[ML_Index] = 500.00
      • Set VariableSet ML_Targets[ML_Index] = (Units within 200.00 of ML_Point[ML_Index].)
      • -------- --------
      • -------- I'm removing unwanted units (An odd way of doing it, but it works): --------
      • Unit Group - Pick every unit in ML_Targets[ML_Index] and do (Actions)
        • Loop - Actions
          • Set VariableSet ML_Target = (Picked unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ML_Target belongs to an enemy of (Owner of ML_Caster[ML_Index]).) Equal to True
              • (ML_Target is alive) Equal to True
              • (ML_Target is A structure) Equal to False
              • (ML_Target is Magic Immune) Equal to False
              • (ML_Target is invulnerable) Equal to False
            • Then - Actions
            • Else - Actions
              • Unit Group - Remove ML_Target from ML_Targets[ML_Index].
      • -------- --------
      • -------- It's possible that the unit cast the spell on absolutely nothing: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ML_Targets[ML_Index]) Equal to 0
        • Then - Actions
          • Set VariableSet ML_Index = (ML_Index - 1)
          • Custom script: call DestroyGroup(udg_ML_Targets[udg_ML_Index])
          • Custom script: call RemoveLocation(udg_ML_Point[udg_ML_Index])
        • Else - Actions
          • Trigger - Turn on Magic Leash Loop <gen>
  • Magic Leash Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ML_Loop) from 1 to ML_Index, do (Actions)
        • Loop - Actions
          • Set VariableSet ML_Is_Broken = False
          • -------- --------
          • Unit Group - Pick every unit in ML_Targets[ML_Loop] and do (Actions)
            • Loop - Actions
              • Set VariableSet ML_Target = (Picked unit)
              • -------- --------
              • Set VariableSet ML_Point[0] = (Position of ML_Target)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between ML_Point[0] and ML_Point[ML_Loop]) Greater than ML_Leash_Range[ML_Loop]
                • Then - Actions
                  • Set VariableSet ML_Is_Broken = True
                • Else - Actions
              • -------- --------
              • Custom script: call RemoveLocation(udg_ML_Point[0])
          • -------- --------
          • -------- If the leash has been broken then let's end this instance of the spell: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ML_Is_Broken Equal to True
            • Then - Actions
              • -------- Some optional special effects to make it look nice: --------
              • Special Effect - Create a special effect at ML_Point[ML_Loop] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- --------
              • -------- Pull them to the center: --------
              • Unit Group - Pick every unit in ML_Targets[ML_Loop] and do (Actions)
                • Loop - Actions
                  • Set VariableSet ML_Target = (Picked unit)
                  • Unit - Move ML_Target instantly to ML_Point[ML_Loop]
              • -------- --------
              • -------- Here is where we remove this instance of the spell from the loop: --------
              • Custom script: call DestroyGroup(udg_ML_Targets[udg_ML_Loop])
              • Custom script: call RemoveLocation(udg_ML_Point[udg_ML_Loop])
              • -------- --------
              • Set VariableSet ML_Caster[ML_Loop] = ML_Caster[ML_Index]
              • Set VariableSet ML_Leash_Range[ML_Loop] = ML_Leash_Range[ML_Index]
              • Set VariableSet ML_Targets[ML_Loop] = ML_Targets[ML_Index]
              • Set VariableSet ML_Point[ML_Loop] = ML_Point[ML_Index]
              • -------- --------
              • Set VariableSet ML_Index = (ML_Index - 1)
              • Set VariableSet ML_Loop = (ML_Loop - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ML_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
View attachment 436627
Thanks
 
Last edited:

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,725
There is no Dummy unit, but I suppose I could add one. Note that a Dummy unit implies a Unit that has the Locust ability which implies that it can't be attacked/killed. I was under the impression that when you said Dummy unit you really just wanted a Special Effect.

  • Magic Leash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Leash
    • Actions
      • Set VariableSet ML_Index = (ML_Index + 1)
      • -------- --------
      • Set VariableSet ML_Caster[ML_Index] = (Triggering unit)
      • Set VariableSet ML_Point[ML_Index] = (Target point of ability being cast)
      • Custom script: set udg_ML_Targets[udg_ML_Index] = CreateGroup()
      • -------- --------
      • -------- Define leash range and spell area of effect: --------
      • Set VariableSet ML_Leash_Range[ML_Index] = 500.00
      • Set VariableSet ML_Targets[ML_Index] = (Units within 200.00 of ML_Point[ML_Index].)
      • -------- --------
      • -------- I'm removing unwanted units (An odd way of doing it, but it works): --------
      • Unit Group - Pick every unit in ML_Targets[ML_Index] and do (Actions)
        • Loop - Actions
          • Set VariableSet ML_Target = (Picked unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ML_Target belongs to an enemy of (Owner of ML_Caster[ML_Index]).) Equal to True
              • (ML_Target is alive) Equal to True
              • (ML_Target is A structure) Equal to False
              • (ML_Target is Magic Immune) Equal to False
              • (ML_Target is invulnerable) Equal to False
            • Then - Actions
            • Else - Actions
              • Unit Group - Remove ML_Target from ML_Targets[ML_Index].
      • -------- --------
      • -------- It's possible that the unit cast the spell on absolutely nothing: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ML_Targets[ML_Index]) Equal to 0
        • Then - Actions
          • Set VariableSet ML_Index = (ML_Index - 1)
          • Custom script: call DestroyGroup(udg_ML_Targets[udg_ML_Index])
          • Custom script: call RemoveLocation(udg_ML_Point[udg_ML_Index])
        • Else - Actions
          • -------- DUMMY UNIT - THE SPELL ENDS EARLY IF IT DIES --------
          • Unit - Create 1 Footman for (Owner of ML_Caster[ML_Index]) at ML_Point[ML_Index] facing Default building facing degrees
          • Set VariableSet ML_Dummy[ML_Index] = (Last created unit)
          • Unit - Pause ML_Dummy[ML_Index]
          • Trigger - Turn on Magic Leash Loop <gen>
  • Magic Leash Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ML_Loop) from 1 to ML_Index, do (Actions)
        • Loop - Actions
          • Set VariableSet ML_Is_Broken = False
          • -------- --------
          • Unit Group - Pick every unit in ML_Targets[ML_Loop] and do (Actions)
            • Loop - Actions
              • Set VariableSet ML_Target = (Picked unit)
              • -------- --------
              • Set VariableSet ML_Point[0] = (Position of ML_Target)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between ML_Point[0] and ML_Point[ML_Loop]) Greater than ML_Leash_Range[ML_Loop]
                • Then - Actions
                  • Set VariableSet ML_Is_Broken = True
                • Else - Actions
              • -------- --------
              • Custom script: call RemoveLocation(udg_ML_Point[0])
          • -------- --------
          • -------- If the leash has been broken or the dummy died then let's end this instance of the spell: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ML_Is_Broken Equal to True
                  • (ML_Dummy[ML_Loop] is alive) Equal to False
            • Then - Actions
              • -------- Some optional special effects to make it look nice: --------
              • Special Effect - Create a special effect at ML_Point[ML_Loop] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- --------
              • -------- Pull them to the center: --------
              • Unit Group - Pick every unit in ML_Targets[ML_Loop] and do (Actions)
                • Loop - Actions
                  • Set VariableSet ML_Target = (Picked unit)
                  • Unit - Move ML_Target instantly to ML_Point[ML_Loop]
              • -------- --------
              • -------- Here is where we remove this instance of the spell from the loop: --------
              • Custom script: call DestroyGroup(udg_ML_Targets[udg_ML_Loop])
              • Custom script: call RemoveLocation(udg_ML_Point[udg_ML_Loop])
              • -------- --------
              • Set VariableSet ML_Caster[ML_Loop] = ML_Caster[ML_Index]
              • Set VariableSet ML_Leash_Range[ML_Loop] = ML_Leash_Range[ML_Index]
              • Set VariableSet ML_Targets[ML_Loop] = ML_Targets[ML_Index]
              • Set VariableSet ML_Point[ML_Loop] = ML_Point[ML_Index]
              • Set VariableSet ML_Dummy[ML_Loop] = ML_Dummy[ML_Index]
              • -------- --------
              • Set VariableSet ML_Index = (ML_Index - 1)
              • Set VariableSet ML_Loop = (ML_Loop - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ML_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 

Attachments

  • Magic Leash 2.w3m
    22.6 KB · Views: 0
Level 7
Joined
Oct 6, 2022
Messages
146
I recently did something lately and added some lighting effects, was this good?
  • Magical Cord
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (Elaina) Magical Cord
    • Actions
      • Set Elaina2nd_Index = (Elaina2nd_Index + 1)
      • Set Elaina2nd_Caster[Elaina2nd_Index] = (Triggering unit)
      • Set Elaina2nd_Point[Elaina2nd_Index] = (Target point of ability being cast)
      • Custom script: set udg_Elaina2nd_Targets[udg_Elaina2nd_Index] = CreateGroup()
      • Set Elaina2nd_Leash_Range[Elaina2nd_Index] = 500.00
      • Set Elaina2nd_Targets[Elaina2nd_Index] = (Units within 200.00 of Elaina2nd_Point[Elaina2nd_Index])
      • Unit Group - Pick every unit in Elaina2nd_Targets[Elaina2nd_Index] and do (Actions)
        • Loop - Actions
          • Set Elaina2nd_Target = (Picked unit)
          • Lightning - Create a Magic Leash lightning effect from source Elaina2nd_Point[Elaina2nd_Index] to target (Position of Elaina2nd_Target)
          • Set Elaina2nd_LighFX = (Last created lightning effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Elaina2nd_Target belongs to an enemy of (Owner of Elaina2nd_Caster[Elaina2nd_Index])) Equal to True
              • (Elaina2nd_Target is alive) Equal to True
              • (Elaina2nd_Target is A structure) Equal to False
              • (Elaina2nd_Target is Magic Immune) Equal to False
              • (Elaina2nd_Target is invulnerable) Equal to False
            • Then - Actions
            • Else - Actions
              • Unit Group - Remove Elaina2nd_Target from Elaina2nd_Targets[Elaina2nd_Index]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Elaina2nd_Targets[Elaina2nd_Index]) Equal to 0
        • Then - Actions
          • Set Elaina2nd_Index = (Elaina2nd_Index - 1)
          • Custom script: call DestroyGroup(udg_Elaina2nd_Targets[udg_Elaina2nd_Index])
          • Custom script: call RemoveLocation(udg_Elaina2nd_Point[udg_Elaina2nd_Index])
        • Else - Actions
          • Unit - Create 1 Elaina Cord Dummy for (Owner of Elaina2nd_Caster[Elaina2nd_Index]) at Elaina2nd_Point[Elaina2nd_Index] facing Default building facing degrees
          • Set Elaina2nd_DummyFx = (Last created unit)
          • Unit - Add a 5.00 second Generic expiration timer to Elaina2nd_DummyFx
          • Trigger - Turn on Magical Cord Loop <gen>
  • Magical Cord Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Elaina2nd_Loop) from 1 to Elaina2nd_Index, do (Actions)
        • Loop - Actions
          • Set Elaina2nd_Is_Broken = False
          • Unit Group - Pick every unit in Elaina2nd_Targets[Elaina2nd_Index] and do (Actions)
            • Loop - Actions
              • Set Elaina2nd_Target = (Picked unit)
              • Set Elaina2nd_Point[0] = (Position of Elaina2nd_Target)
              • Lightning - Move Elaina2nd_LighFX to source Elaina2nd_Point[Elaina2nd_Loop] and target (Position of Elaina2nd_Target)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Elaina2nd_Point[0] and Elaina2nd_Point[Elaina2nd_Loop]) Greater than or equal to Elaina2nd_Leash_Range[Elaina2nd_Loop]
                • Then - Actions
                  • Set Elaina2nd_Is_Broken = True
                • Else - Actions
              • Custom script: call RemoveLocation(udg_Elaina2nd_Point[0])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Elaina2nd_DummyFx is alive) Equal to False) or (Elaina2nd_Is_Broken Equal to True)
            • Then - Actions
              • Special Effect - Create a special effect at Elaina2nd_Point[Elaina2nd_Loop] using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
              • Special Effect - Set Scale of (Last created special effect) to 5.00
              • Special Effect - Destroy (Last created special effect)
              • Unit Group - Pick every unit in Elaina2nd_Targets[Elaina2nd_Loop] and do (Actions)
                • Loop - Actions
                  • Set Elaina2nd_Target = (Picked unit)
                  • Unit - Move Elaina2nd_Target instantly to Elaina2nd_Point[Elaina2nd_Loop]
              • Lightning - Destroy Elaina2nd_LighFX
              • Custom script: call DestroyGroup(udg_Elaina2nd_Targets[udg_Elaina2nd_Index])
              • Custom script: call RemoveLocation(udg_Elaina2nd_Point[udg_Elaina2nd_Index])
              • Set Elaina2nd_Caster[Elaina2nd_Loop] = Elaina2nd_Caster[Elaina2nd_Index]
              • Set Elaina2nd_Leash_Range[Elaina2nd_Loop] = Elaina2nd_Leash_Range[Elaina2nd_Index]
              • Set Elaina2nd_Targets[Elaina2nd_Loop] = Elaina2nd_Targets[Elaina2nd_Index]
              • Set Elaina2nd_Point[Elaina2nd_Loop] = Elaina2nd_Point[Elaina2nd_Index]
              • Set Elaina2nd_Index = (Elaina2nd_Index - 1)
              • Set Elaina2nd_Loop = (Elaina2nd_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Elaina2nd_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top