Spell ChainHook

Dirac

22710180
Reaction score
147
Chain Hook
Made by Dirac

What? another hook type ability? Yes! but this one is somehow different.

Description:Shots a hook to a target location hooks the first unit on the way. Hooked unit cant move and the caster can drag it by moving, damage dealt is based on distance. Time hooked is increased by level.

Pros:
Leakless (i think:rolleyes:)
Nice animation
MUI

Cons:
Not very customizable

UPDATE:
1.1
Removed HUGE leak, new testing map
1.2
MUI is now increased to 50
Hooked units are not possible targets while remain hooked
1.3
Units that are near the caster are not suitable targets
Removed Minor Leak (Thanks to BlackRose)
Fixed Tooltip
Hooked units now are dragged "smoothly"
1.3.1
Removed Minor Leak
1.3.2
Removed Leaks
1.3.3
Reduced Lag
Added some customization functions
Minor bug fix
1.3.4
Added more customization functions, now this spell can be used as a traditional meat hook
Minor bug fixes
Screenshots
wc3scrnshot021309083549gc3.jpg
wc3scrnshot021309083602yn2.jpg
wc3scrnshot021309083611gc8.jpg

CODE:
Trigger:
  • ChainHook
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Hook
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI Less than or equal to 50
        • Then - Actions
          • Set MUI = (MUI + 1)
        • Else - Actions
          • Set MUI = 1
      • Set MUICaster[MUI] = (Casting unit)
      • Set MUIPoint[MUI] = (Target point of ability being cast)
      • Set TempPoint = (Position of MUICaster[MUI])
      • Unit - Create 1 ChainHook for (Owner of MUICaster[MUI]) at TempPoint facing (Angle from TempPoint to MUIPoint[MUI]) degrees
      • Unit Group - Add (Last created unit) to ChainHookDummyGroup
      • Set ChainHookDummys[((MUI x 100) - 99)] = (Last created unit)
      • Set ChainHookDummyCount[MUI] = 1
      • Unit - Set the custom value of (Last created unit) to MUI
      • Custom script: call RemoveLocation (udg_TempPoint)
Trigger:
  • ChainHookSlide
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (ChainHookDummyGroup is empty) Equal to False
    • Actions
      • Unit Group - Pick every unit in ChainHookDummyGroup and do (Actions)
        • Loop - Actions
          • Set TempInteger = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MUITarget[TempInteger] Equal to No unit
            • Then - Actions
              • Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
              • Set MUISlide[(Custom value of (Picked unit))] = (MUISlide[(Custom value of (Picked unit))] + 20.00)
              • Set TempPointArray[1] = (Position of MUICaster[TempInteger])
              • Set TempPoint = (TempPointArray[1] offset by MUISlide[TempInteger] towards (Angle from TempPointArray[1] to MUIPoint[(Custom value of (Picked unit))]) degrees)
              • Unit - Move (Picked unit) instantly to TempPoint, facing (Angle from TempPointArray[1] to MUIPoint[TempInteger]) degrees
              • Custom script: call RemoveLocation (udg_TempPoint)
              • Set TempPoint = (Position of MUICaster[TempInteger])
              • Custom script: call RemoveLocation (udg_TempPointArray[1])
              • Set TempPointArray[1] = (Position of ChainHookDummys[TempInteger2])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between TempPoint and TempPointArray[1]) Greater than or equal to 45.00
                • Then - Actions
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Set TempPoint = (Position of MUICaster[TempInteger])
                  • Set ChainHookDummyCount[TempInteger] = (ChainHookDummyCount[TempInteger] + 1)
                  • Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
                  • Unit - Create 1 ChainHook for (Owner of MUICaster[TempInteger]) at TempPoint facing (Facing of ChainHookDummys[(TempInteger2 - 1)]) degrees
                  • Set ChainHookDummys[TempInteger2] = (Last created unit)
                  • Custom script: call RemoveLocation (udg_TempPoint)
                • Else - Actions
                  • Custom script: call RemoveLocation (udg_TempPoint)
              • Custom script: call RemoveLocation (udg_TempPointArray[1])
              • For each (Integer A) from 2 to ChainHookDummyCount[TempInteger], do (Actions)
                • Loop - Actions
                  • Set TempInteger2 = (((TempInteger x 100) - 100) + (Integer A))
                  • Set TempPointArray[1] = (Position of ChainHookDummys[TempInteger2])
                  • Set TempPointArray[2] = (Position of ChainHookDummys[(TempInteger2 - 1)])
                  • Set TempPoint = (TempPointArray[2] offset by 40.00 towards (Angle from TempPointArray[2] to TempPointArray[1]) degrees)
                  • Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Custom script: call RemoveLocation (udg_TempPointArray[1])
                  • Custom script: call RemoveLocation (udg_TempPointArray[2])
              • Set TempGroup = (Units within 90.00 of (Position of (Picked unit)))
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • Set TempPointArray[1] = (Position of MUICaster[TempInteger])
                  • Set TempPointArray[2] = (Position of (Picked unit))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A structure) Equal to False
                      • ((Picked unit) is alive) Equal to True
                      • (Picked unit) Not equal to MUICaster[TempInteger]
                      • ((Picked unit) is in ChainHookTargetGroup) Equal to False
                      • (Distance between TempPointArray[1] and TempPointArray[2]) Greater than or equal to 150.00
                    • Then - Actions
                      • Set MUITarget[TempInteger] = (Picked unit)
                      • Unit Group - Add (Picked unit) to ChainHookTargetGroup
                      • Unit - Turn collision for MUITarget[TempInteger] Off
                    • Else - Actions
                  • Custom script: call RemoveLocation (udg_TempPointArray[1])
                  • Custom script: call RemoveLocation (udg_TempPointArray[2])
              • Custom script: call DestroyGroup (udg_TempGroup)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MUISlide[(Custom value of (Picked unit))] Greater than or equal to 3000.00
                • Then - Actions
                  • Set MUITarget[TempInteger] = MUICaster[TempInteger]
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MUITarget[TempInteger] Equal to MUICaster[TempInteger]
                • Then - Actions
                  • Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
                  • Set TempPointArray[1] = (Position of MUICaster[TempInteger])
                  • Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
                  • Set TempPointArray[3] = (Position of ChainHookDummys[(TempInteger2 + 1)])
                  • Set TempPoint = (TempPointArray[2] offset by 20.00 towards (Angle from TempPointArray[2] to TempPointArray[1]) degrees)
                  • Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[3] to TempPointArray[2]) degrees
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Custom script: call RemoveLocation (udg_TempPointArray[1])
                  • Custom script: call RemoveLocation (udg_TempPointArray[2])
                  • For each (Integer A) from 1 to (ChainHookDummyCount[TempInteger] - 1), do (Actions)
                    • Loop - Actions
                      • Set TempInteger2 = (((TempInteger x 100) - 100) + (Integer A))
                      • Set TempPointArray[1] = (Position of ChainHookDummys[(TempInteger2 + 1)])
                      • Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
                      • Set TempPoint = (TempPointArray[2] offset by 20.00 towards (Angle from TempPointArray[2] to TempPointArray[1]) degrees)
                      • Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
                      • Custom script: call RemoveLocation (udg_TempPointArray[1])
                      • Custom script: call RemoveLocation (udg_TempPointArray[2])
                      • Custom script: call RemoveLocation (udg_TempPoint)
                  • Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
                  • Set TempPoint = (Position of ChainHookDummys[TempInteger2])
                  • Set TempPointArray[1] = (Position of MUICaster[TempInteger])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between TempPoint and TempPointArray[1]) Less than or equal to 10.00
                    • Then - Actions
                      • Set ChainHookDummyCount[TempInteger] = (ChainHookDummyCount[TempInteger] - 1)
                      • Unit - Remove ChainHookDummys[TempInteger2] from the game
                    • Else - Actions
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Custom script: call RemoveLocation (udg_TempPointArray[1])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ChainHookDummyCount[TempInteger] Equal to 0
                    • Then - Actions
                      • Set MUISlide[TempInteger] = 0.00
                      • Unit - Turn collision for MUITarget[TempInteger] On
                      • Unit Group - Remove MUITarget[TempInteger] from ChainHookTargetGroup
                      • Set MUITarget[TempInteger] = No unit
                      • Set ChainHookDistance[TempInteger] = 0.00
                      • Custom script: call RemoveLocation (udg_MUIPoint[udg_TempInteger])
                    • Else - Actions
                • Else - Actions
                  • Set TempInteger2 = (((TempInteger x 100) - 100) + ChainHookDummyCount[TempInteger])
                  • Set TempPointArray[1] = (Position of MUICaster[TempInteger])
                  • Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
                  • Set TempPoint = (TempPointArray[1] offset by 40.00 towards (Angle from TempPointArray[1] to TempPointArray[2]) degrees)
                  • Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
                  • Custom script: call RemoveLocation (udg_TempPointArray[1])
                  • Custom script: call RemoveLocation (udg_TempPointArray[2])
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Set ChainHookDistance[TempInteger] = (ChainHookDistance[TempInteger] + 1.00)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (MUICaster[TempInteger] belongs to an enemy of (Owner of MUITarget[TempInteger])) Equal to True
                    • Then - Actions
                      • Set TempPoint = (Position of ChainHookDummys[((TempInteger x 100) - 99)])
                      • Set TempPointArray[1] = (Position of MUITarget[TempInteger])
                      • Unit - Cause MUICaster[TempInteger] to damage MUITarget[TempInteger], dealing ((Distance between TempPoint and TempPointArray[1]) / 2.00) damage of attack type Spells and damage type Normal
                      • Custom script: call RemoveLocation (udg_TempPoint)
                      • Custom script: call RemoveLocation (udg_TempPointArray[1])
                    • Else - Actions
                  • Set TempPoint = (Position of ChainHookDummys[((TempInteger x 100) - 99)])
                  • Set TempPointArray[1] = (Position of MUITarget[TempInteger])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between TempPoint and TempPointArray[1]) Greater than or equal to 1.00
                    • Then - Actions
                      • Custom script: call RemoveLocation (udg_TempPoint)
                      • Set TempInteger2 = ((TempInteger x 100) - 99)
                      • Set TempPoint = (Position of ChainHookDummys[TempInteger2])
                      • Unit - Move MUITarget[TempInteger] instantly to TempPoint
                      • Custom script: call RemoveLocation (udg_TempPoint)
                      • Set TempPoint = (Position of ChainHookDummys[TempInteger2])
                      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
                      • Custom script: call RemoveLocation (udg_TempPoint)
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                      • Custom script: call RemoveLocation (udg_TempPoint)
                  • Custom script: call RemoveLocation (udg_TempPointArray[1])
                  • For each (Integer A) from 1 to (ChainHookDummyCount[TempInteger] - 1), do (Actions)
                    • Loop - Actions
                      • Set TempInteger2 = (((TempInteger x 100) - 100) + (Integer A))
                      • Set TempPointArray[1] = (Position of ChainHookDummys[(TempInteger2 + 1)])
                      • Set TempPointArray[2] = (Position of ChainHookDummys[TempInteger2])
                      • Set TempPoint = (TempPointArray[1] offset by 40.00 towards (Angle from TempPointArray[1] to TempPointArray[2]) degrees)
                      • Unit - Move ChainHookDummys[TempInteger2] instantly to TempPoint, facing (Angle from TempPointArray[1] to TempPointArray[2]) degrees
                      • Custom script: call RemoveLocation (udg_TempPointArray[1])
                      • Custom script: call RemoveLocation (udg_TempPointArray[2])
                      • Custom script: call RemoveLocation (udg_TempPoint)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (MUICaster[TempInteger] is dead) Equal to True
                          • (MUITarget[TempInteger] is dead) Equal to True
                          • ChainHookDistance[TempInteger] Greater than or equal to (500.00 + (15.00 x (Real((Level of Chain Hook for MUICaster[TempInteger])))))
                    • Then - Actions
                      • Unit Group - Remove MUITarget[TempInteger] from ChainHookTargetGroup
                      • Set MUITarget[TempInteger] = MUICaster[TempInteger]
                    • Else - Actions
 

Attachments

  • ChainHook v1.3.2.w3x
    31.9 KB · Views: 471
  • ChainHook v1.3.3.w3x
    33 KB · Views: 487
  • ChainHook v1.3.4.w3x
    34.5 KB · Views: 731

Nerfpl

New Member
Reaction score
53
->O.M.G<-

How you can create such big trigger and dont be lost after 20 lines?
Btw if you already have abilites to create such thing i prefer switching to JASS. then you can skip like half of thing (including MUI pain). btw why you remove TempPoint twice in row?

nice skill tho
edit: actually sweet f*** nice spell
 

BRUTAL

I'm working
Reaction score
118
theres a small problemish
if you cast the spell to a really like melee range close, when you try moving its bad
i think you should turn off the targets collision in the second trigger if you havent
 

Dirac

22710180
Reaction score
147
I know my trigger is insane xD. I removed temppoint twice in row because i forgot to change the name the second temppoint removed to (udg_TempPoint2).
I think i remove it too much because im not very good at detecting leaks so, is better to remove them than not to.
Cant move to JASS :( my W3E crashes when using it lol

Updated: Removed minor leak

It really bothers me if it leaks. Plz check the code and tell me where is it leaking
 

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
Unit - Move (Picked unit) instantly to TempPoint, facing (Angle from (Position of MUICaster. . . .

Doesnt that leak at the part it says "Position of MUICaster"? (Line 17) That would be a point leak wouldn't it? I could be wrong but I though it did.

Same with places such as Lines 40, 68, 74, 106, and 138.
 

Dirac

22710180
Reaction score
147
Bump.

I would like to get more comments about my spell :p or maybe a moderator to tell me if its approved.

Doesnt that leak at the part it says "Position of MUICaster"? (Line 17) That would be a point leak wouldn't it? I could be wrong but I though it did.

Same with places such as Lines 40, 68, 74, 106, and 138.

Thnx for the help (+rep) Now the map is updated with LOTS of leaks fixed. Does no longer lags when pulling multiple units at the same time (so have fun testing it).
 

Nexor

...
Reaction score
74
Change the MUI variable to a larger value (about 50 will do it)
I tried it with 50 and the spell couldnt get bugged, atm 10 is too small, and there will be some parts of the chain floating in the map.
 

Bronxernijn

You can change this now in User CP.
Reaction score
43
Casting the hook twice on the same target kills it almost instantly. Is that how it's meant to be?
 

Viikuna

No Marlo no game.
Reaction score
265
Cant move to JASS my W3E crashes when using it lol
Get NewGen, it doesnt crash.


I never tought someone would do something like this with GUI. This is pretty insane actually. :D
 

Dirac

22710180
Reaction score
147
Update!
-MUI is now increased to 50! (Nexor: Change the MUI variable to a larger value (about 50 will do it))
-Hooked units are not possible targets while remain hooked (Bronxernijn: Casting the hook twice on the same target kills it almost instantly. Is that how it's meant to be?)
 
Reaction score
91
A few bugs I found while playing around with the spell:
- If you hook a unit and start moving left and right (as well as backwards) the enemy stands still but still gets damaged.
- If you hook from melee range the unit will move next to you forever or until it dies (and will get damaged).
 

BlackRose

Forum User
Reaction score
239
Maybe you should fix those things?

It looks weird if you cast it right next to an enemy unit.

It also lags so much if you try to increase the distance or have more than 1 Chain Hook active.

I changed the distance to like 2000 and guess what?

EDIT:
Code:
* ChainHook
          o Events
                + Unit - A unit Starts the effect of an ability
          o Conditions
                + (Ability being cast) Equal to Chain Hook
          o Actions
                + If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      # If - Conditions
                            * MUI Less than or equal to 10
                      # Then - Actions
                            * Set MUI = (MUI + 1)
                      # Else - Actions
                            * Set MUI = 1
                + Set MUICaster[MUI] = (Casting unit)
                + Set MUIPoint[MUI] = (Target point of ability being cast)
                + Set TempPoint = (Position of MUICaster[MUI])
[B]                + Unit - Create 1 ChainHook for (Owner of MUICaster[MUI]) at TempPoint facing (Angle from TempPoint to (Target point of ability being cast)) degrees[/B]
                + Unit Group - Add (Last created unit) to ChainHookDummyGroup
                + Set ChainHookDummys[((MUI x 100) - 99)] = (Last created unit)
                + Set ChainHookDummyCount[MUI] = 1
                + Unit - Set the custom value of (Last created unit) to MUI
                + Custom script: call RemoveLocation (udg_TempPoint)

Read this bolded part.
 

Dirac

22710180
Reaction score
147
Update! (1.3)
-Units that are near the caster are not suitable targets (Tyrande_ma3x: If you hook from melee range the unit will move next to you forever or until it dies (and will get damaged).
-Removed Minor Leak (Thanks to BlackRose)
-Fixed Tooltip
-Hooked units now are dragged "smoothly"
 

BlackRose

Forum User
Reaction score
239
The spell is impressive, considering it is done in GUI. One thing I don't know is how you manage to keep track of the trigger, when it is that long...

One thing is, why is it ChainHook for the thread and map name, it looks weird :).

[ REP + ]
 

RaiJin

New Member
Reaction score
40
this line leaks

Code:
Set TempPoint = ((Position of ChainHookDummys[(TempInteger2 - 1)]) offset by 40.00 towards (Angle from (Position of ChainHookDummys[(TempInteger2 - 1)]) to (Position of ChainHookDummys[TempInteger2])) degrees)
 

Dirac

22710180
Reaction score
147
Bump

I just want a moderator to tell me if my spell is approved/disapproved and why :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top