''Chain Areal Shackles''

Leazy

You can change this now in User CP.
Reaction score
50
Hello, I'm making an Chain Areal Shackles, which is supose to shackle up to 5 units (at max lvl, 2 units at lowest lvl). Here are my triggers:

Code:
Aerial Shackles Main Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        And - All (Conditions) are true
            Conditions
                (Ability being cast) Equal to Paralysing Shackles 
                (Ability being cast) Equal to Paralysing Shackles [Dummy Cast] 
    Actions
        Set Integer = 1
        For each (Integer A) from 0 to (Level of Paralysing Shackles  for (Triggering unit)), do (Actions)
            Loop - Actions
                Set UnitGroupArray[(Integer A)] = (Random 1 units from (Units within 550.00 of Point matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) has buff Paralysing Shackles ) Equal to False)
                Unit Group - Pick every unit in UnitGroupArray[(Integer A)] and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Integer Equal to 1
                            Then - Actions
                                Set Point2 = (Position of (Target unit of issued order))
                                Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Point2 facing 0.00 degrees
                                Unit Group - Add (Last created unit) to ParalysingShackles_UnitGroup[(Player number of (Owner of (Triggering unit)))]
                                Unit - Add Paralysing Shackles [Dummy Cast]  to (Last created unit)
                                Unit - Set level of Paralysing Shackles [Dummy Cast]  for (Last created unit) to (Level of Paralysing Shackles  for (Triggering unit))
                                Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
                                Set Integer = 2
                            Else - Actions
                                Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at ParalysingShackles_Pos[ParalysingShackles_Count[(Player number of (Owner of (Triggering unit)))]] facing 0.00 degrees
                                Unit Group - Add (Last created unit) to ParalysingShackles_UnitGroup[(Player number of (Owner of (Triggering unit)))]
                                Unit - Add Paralysing Shackles [Dummy Cast]  to (Last created unit)
                                Unit - Set level of Paralysing Shackles [Dummy Cast]  for (Last created unit) to (Level of Paralysing Shackles  for (Triggering unit))
                                Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
                        Custom script:   call DestroyGroup(udg_UnitGroupArray[bj_forLoopAIndex])



Code:
Aerial Shackles Target Pos
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Paralysing Shackles [Dummy Cast] 
    Actions
        Set ParalysingShackles_Count[(Player number of (Owner of (Triggering unit)))] = (ParalysingShackles_Count[(Player number of (Owner of (Triggering unit)))] + 1)
        Set ParalysingShackles_Pos[ParalysingShackles_Count[(Player number of (Owner of (Triggering unit)))]] = (Position of (Target unit of ability being cast))



Code:
Aerial Shackles Finnish or Cancel
    Events
        Unit - A unit Finishes casting an ability
        Unit - A unit Stops casting an ability
    Conditions
        (Ability being cast) Equal to Paralysing Shackles 
    Actions
        Unit Group - Pick every unit in ParalysingShackles_UnitGroup[(Player number of (Owner of (Triggering unit)))] and do (Unit - Remove (Picked unit) from the game)
        Custom script:   call DestroyGroup(udg_ParalysingShackles_UnitGroup[GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))])

But the problem is that it doesen't work, after looking into it I still can't find what might be wrong, anyone got a clue?

Some things that could be wrong, but that are not wrong:
The Dummy Spell costs no mana and has unlimited range, so thats not wrong.
The spells are the right spells.
The buffs are right.
 

Leazy

You can change this now in User CP.
Reaction score
50
Thanks, sucks that I missed that =/ +rep!

Still does not work though, heres the new trigger (After the change)

Code:
Aerial Shackles Main Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        And - All (Conditions) are true
            Conditions
                (Ability being cast) Equal to Paralysing Shackles 
                (Ability being cast) Equal to Paralysing Shackles [Dummy Cast] 
    Actions
        Set Integer = 1
        For each (Integer A) from 0 to (Level of Paralysing Shackles  for (Triggering unit)), do (Actions)
            Loop - Actions
                Set UnitGroupArray[(Integer A)] = (Random 1 units from (Units within 550.00 of Point matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((M
                Unit Group - Pick every unit in UnitGroupArray[(Integer A)] and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Integer Equal to 1
                            Then - Actions
                                Set Point2 = (Position of (Target unit of ability being cast))
                                Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Point2 facing 0.00 degrees
                                Unit Group - Add (Last created unit) to ParalysingShackles_UnitGroup[(Player number of (Owner of (Triggering unit)))]
                                Unit - Add Paralysing Shackles [Dummy Cast]  to (Last created unit)
                                Unit - Set level of Paralysing Shackles [Dummy Cast]  for (Last created unit) to (Level of Paralysing Shackles  for (Triggering unit))
                                Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
                                Set Integer = 2
                            Else - Actions
                                Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at ParalysingShackles_Pos[ParalysingShackles_Count[(Player number of (Owner of (Triggering unit)))]] facing 0.00 degrees
                                Unit Group - Add (Last created unit) to ParalysingShackles_UnitGroup[(Player number of (Owner of (Triggering unit)))]
                                Unit - Add Paralysing Shackles [Dummy Cast]  to (Last created unit)
                                Unit - Set level of Paralysing Shackles [Dummy Cast]  for (Last created unit) to (Level of Paralysing Shackles  for (Triggering unit))
                                Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
                        Custom script:   call DestroyGroup(udg_UnitGroupArray[bj_forLoopAIndex])
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
Code:
        And - All (Conditions) are true
            Conditions
                (Ability being cast) Equal to Paralysing Shackles 
                (Ability being cast) Equal to Paralysing Shackles [Dummy Cast]

Use Or - Multiple. And
Code:
units within 550.00 of Point
. Where have you set point?
 

Leazy

You can change this now in User CP.
Reaction score
50
Thanks, missed that to =/

+rep :)

Still does not work though =/

The trigger after the change:


Code:
Aerial Shackles Main Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to Paralysing Shackles 
                (Ability being cast) Equal to Paralysing Shackles [Dummy Cast] 
    Actions
        Set Integer = 1
        Set Point = (Position of (Target unit of ability being cast))
        For each (Integer A) from 0 to (Level of Paralysing Shackles  for (Triggering unit)), do (Actions)
            Loop - Actions
                Set UnitGroupArray[(Integer A)] = (Random 1 units from (Units within 550.00 of Point matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((M
                Unit Group - Pick every unit in UnitGroupArray[(Integer A)] and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Integer Equal to 1
                            Then - Actions
                                Set Point2 = (Position of (Target unit of ability being cast))
                                Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Point2 facing 0.00 degrees
                                Unit Group - Add (Last created unit) to ParalysingShackles_UnitGroup[(Player number of (Owner of (Triggering unit)))]
                                Unit - Add Paralysing Shackles [Dummy Cast]  to (Last created unit)
                                Unit - Set level of Paralysing Shackles [Dummy Cast]  for (Last created unit) to (Level of Paralysing Shackles  for (Triggering unit))
                                Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
                                Set Integer = 2
                            Else - Actions
                                Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at ParalysingShackles_Pos[ParalysingShackles_Count[(Player number of (Owner of (Triggering unit)))]] facing 0.00 degrees
                                Unit Group - Add (Last created unit) to ParalysingShackles_UnitGroup[(Player number of (Owner of (Triggering unit)))]
                                Unit - Add Paralysing Shackles [Dummy Cast]  to (Last created unit)
                                Unit - Set level of Paralysing Shackles [Dummy Cast]  for (Last created unit) to (Level of Paralysing Shackles  for (Triggering unit))
                                Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
                        Custom script:   call DestroyGroup(udg_UnitGroupArray[bj_forLoopAIndex])

Edit: It actually works now, thank you a lot for the help :)
Edit2: After testing it, I see that it some times does not work correctly, it can some times chain 2 units which is the right and some times it chains 7 units, anyone see what might be wrong with that?
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
Code:
Aerial Shackles Main Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to Paralysing Shackles 
                (Ability being cast) Equal to Paralysing Shackles [Dummy Cast]

From the codes:
If you hero cast "Paralysing Shackles", all seems fine
If your dummy cast "Paralysing Shackles [Dummy Cast]", it is as if another hero cast "Paralysing Shackles".


Problem
That means if your hero is suppose to Shackle 2 enemy units (by creating a dummy),
the dummy would also Shackle 2 enemies (by creating another dummy),
Which the 2nd created dummy will also shackle 2 more units.... etc etc

You are lucky it stopped at 7, if there are enough targets present, it will shackle all of them.


Solution
Simply just do a check if the unit casting is a Hero or Dummy, and make each dummy only shackle one enemy.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top