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

Psycho Hook v.0.2

Noticed there was not any hook-like spell I like so I made my own one with a little extra stuff
Give Credits for usage
Feel free to ask for anything
Or criticise it (+reason)

67884d1256049726-psycho-hook-v-0-1-tooltip.jpg


JASS:
___________________________________________________

____________________Psycho Hook____________________

________________________by_________________________

____________________XAOS_WIZARD____________________

___________________________________________________

Credits to Blizzard and IceFrog

This spell uses 2D-Arrays and Dynamic Data Storage
Look it up in Hive's Tutorial/Spell Section for further information

Implementation:
1. Copy the ability, the dummy unit and the trigger data to your map
2. There is no "2."...that's it
3. (You may change all values of cause but be carefull with the ammount of dummys)

How does it work:
- The first unit of the array is moved twords the direction the caster is facing
- Everytime the first unit has moved a specific ammount a new one is created
- Every new unit follows the one which was created before
- If the max distance or the map bounds are reached all dummys are killed
- If a tree is hit by the first one it will be destroyed
- If a unit is hit the direction will be reversed:
- The 100. dummy is moved to the 99. which is moved to the 98. and so on...
- If a dummy comes next to the caster it will be hidden
- If the target moves next to the caster everything will be stopped and the dummys killed

further stuff:
scroll down

Keywords:
hook, meat hook, dota, pudge, pudge wars, grapple, psycho hook, d4rk_g4nd4lf, xaos_wizard, pull, snake, drag, 1337, complex, doom, death, destiny, ove
Contents

Psycho Hook (Map)

Reviews
18:16, 21st Oct 2009 The_Reborn_Devil: The triggering looks really nice and I couldn't find any leaks. The spell is quite nice and it seems to be working properly. It's quite efficient (it could be slightly better) as I reached 2000 units...

Moderator

M

Moderator

18:16, 21st Oct 2009
The_Reborn_Devil:

The triggering looks really nice and I couldn't find any leaks.
The spell is quite nice and it seems to be working properly.
It's quite efficient (it could be slightly better) as I reached 2000 units before it started to lag.
Status: Approved.
Rating: Recommended.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Psycho Hook
  • Actions
    • -------- Array slots are limited to 8192 --------
    • -------- We use a maximum of 100 dummys per cast --------
    • -------- So this spell shouldn't be casted more often then 80 times (lag would stop people from doing this anyway...) --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • PHMax Less than 80
      • Then - Actions
        • Set loc = (Position of (Triggering unit))
        • -------- Increases the total ammount of hooks by one --------
        • Set PHMax = (PHMax + 1)
        • -------- Sets the variables which are necessary --------
        • Set PHCaster[PHMax] = (Triggering unit)
        • -------- Shall the hook return yet? No --------
        • Set PHReturn[PHMax] = False
        • -------- How far did the hook travel yet? 0 --------
        • Set PHDistance[(PHMax x 2)] = 0.00
        • -------- How far shall it go? 1000 + 1000 per level --------
        • Set PHDistance[((PHMax x 2) + 1)] = (((Real((Level of Psycho Hook for (Triggering unit)))) x 1000.00) + 1000.00)
        • -------- How fast will the hook travel forward? --------
        • Set PHSpeed[(PHMax x 2)] = 20.00
        • -------- And how fast back to the caster? --------
        • Set PHSpeed[((PHMax x 2) + 1)] = 25.00
        • -------- Straight or with an angle? --------
        • -------- Setting the angle to less then 0 will make the hook go straight like the normal dota hook --------
        • Set PHAngle[PHMax] = 0.00
        • -------- This is the head of the hook --------
        • Unit - Create 1 PsychoHookDummy for (Owner of (Triggering unit)) at loc facing (Facing of (Triggering unit)) degrees
        • -------- It shall look a little different --------
        • Animation - Change (Last created unit)'s size to (250.00%, 250.00%, 250.00%) of its original size
        • Set PHSegment[(PHMax x 100)] = (Last created unit)
        • -------- We created one segment already (the first one) --------
        • Set PHSegmentMax[PHMax] = 1
        • -------- Creates a dummy to check if a destrutible is a tree --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • harvester Not equal to No unit
            • (harvester is alive) Equal to True
          • Then - Actions
          • Else - Actions
            • -------- You need a unit which is able to harvest --------
            • -------- Anything else does not matter --------
            • Unit - Create 1 Peasant for Neutral Passive at loc facing Default building facing degrees
            • Set harvester = (Last created unit)
            • Unit - Make harvester Invulnerable
            • Unit - Hide (Last created unit)
        • -------- Runs the main trigger to deal with the movement and so on --------
        • Trigger - Turn on PsychoHookLoop <gen>
        • -------- Removes leaks --------
        • Custom script: call RemoveLocation( udg_loc )
      • Else - Actions
        • Game - Display to (Player group((Triggering player))) the text: This Spell may not ...
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Straight Psycho Hook
  • Actions
    • -------- Array slots are limited to 8192 --------
    • -------- We use a maximum of 100 dummys per cast --------
    • -------- So this spell shouldn't be casted more often then 80 times (lag would stop people from doing this anyway...) --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • PHMax Less than 80
      • Then - Actions
        • Set loc = (Position of (Triggering unit))
        • Set loc2 = (Target point of ability being cast)
        • -------- Increases the total ammount of hooks by one --------
        • Set PHMax = (PHMax + 1)
        • -------- Sets the variables which are necessary --------
        • Set PHCaster[PHMax] = (Triggering unit)
        • -------- Shall the hook return yet? No --------
        • Set PHReturn[PHMax] = False
        • -------- How far did the hook travel yet? 0 --------
        • Set PHDistance[(PHMax x 2)] = 0.00
        • -------- How far shall it go? 1000 + 1000 per level --------
        • Set PHDistance[((PHMax x 2) + 1)] = (((Real((Level of Psycho Hook for (Triggering unit)))) x 1000.00) + 1000.00)
        • -------- How fast will the hook travel forward? --------
        • Set PHSpeed[(PHMax x 2)] = 20.00
        • -------- And how fast back to the caster? --------
        • Set PHSpeed[((PHMax x 2) + 1)] = 25.00
        • -------- Straight or with an angle? --------
        • -------- Setting the angle to less then 0 will make the hook go straight like the normal dota hook --------
        • Set PHAngle[PHMax] = -1.00
        • -------- This is the head of the hook --------
        • Unit - Create 1 PsychoHookDummy for (Owner of (Triggering unit)) at loc facing loc2
        • -------- It shall look a little different --------
        • Animation - Change (Last created unit)'s size to (250.00%, 250.00%, 250.00%) of its original size
        • Set PHSegment[(PHMax x 100)] = (Last created unit)
        • -------- We created one segment already (the first one) --------
        • Set PHSegmentMax[PHMax] = 1
        • -------- Creates a dummy to check if a destrutible is a tree --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • harvester Not equal to No unit
            • (harvester is alive) Equal to True
          • Then - Actions
          • Else - Actions
            • -------- You need a unit which is able to harvest --------
            • -------- Anything else does not matter --------
            • Unit - Create 1 Peasant for Neutral Passive at loc facing Default building facing degrees
            • Set harvester = (Last created unit)
            • Unit - Make harvester Invulnerable
            • Unit - Hide (Last created unit)
        • -------- Runs the main trigger to deal with the movement and so on --------
        • Trigger - Turn on PsychoHookLoop <gen>
        • -------- Removes leaks --------
        • Custom script: call RemoveLocation( udg_loc )
        • Custom script: call RemoveLocation( udg_loc2 )
      • Else - Actions
        • Game - Display to (Player group((Triggering player))) the text: This Spell may not ...
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Mass Psycho Hook
  • Actions
    • -------- Array slots are limited to 8192 --------
    • -------- We use a maximum of 100 dummys per cast --------
    • -------- So this spell shouldn't be casted more often then 80 times (lag would stop people from doing this anyway...) --------
    • For each (Integer i) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • PHMax Less than 80
          • Then - Actions
            • Set loc = (Position of (Triggering unit))
            • -------- Increases the total ammount of hooks by one --------
            • Set PHMax = (PHMax + 1)
            • -------- Sets the variables which are necessary --------
            • Set PHCaster[PHMax] = (Triggering unit)
            • -------- Shall the hook return yet? No --------
            • Set PHReturn[PHMax] = False
            • -------- How far did the hook travel yet? 0 --------
            • Set PHDistance[(PHMax x 2)] = 0.00
            • -------- How far shall it go? 1000 + 1000 per level --------
            • Set PHDistance[((PHMax x 2) + 1)] = (((Real((Level of Psycho Hook for (Triggering unit)))) x 500.00) + 500.00)
            • -------- How fast will the hook travel forward? --------
            • Set PHSpeed[(PHMax x 2)] = 20.00
            • -------- And how fast back to the caster? --------
            • Set PHSpeed[((PHMax x 2) + 1)] = 25.00
            • -------- Straight or with an angle? --------
            • -------- Setting the angle to less then 0 will make the hook go straight like the normal dota hook --------
            • Set PHAngle[PHMax] = ((Real(i)) x 60.00)
            • -------- This is the head of the hook --------
            • Unit - Create 1 PsychoHookDummy for (Owner of (Triggering unit)) at loc facing (Facing of (Triggering unit)) degrees
            • -------- It shall look a little different --------
            • Animation - Change (Last created unit)'s size to (250.00%, 250.00%, 250.00%) of its original size
            • Set PHSegment[(PHMax x 100)] = (Last created unit)
            • -------- We created one segment already (the first one) --------
            • Set PHSegmentMax[PHMax] = 1
            • -------- Creates a dummy to check if a destrutible is a tree --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • harvester Not equal to No unit
                • (harvester is alive) Equal to True
              • Then - Actions
              • Else - Actions
                • -------- You need a unit which is able to harvest --------
                • -------- Anything else does not matter --------
                • Unit - Create 1 Peasant for Neutral Passive at loc facing Default building facing degrees
                • Set harvester = (Last created unit)
                • Unit - Make harvester Invulnerable
                • Unit - Hide (Last created unit)
            • -------- Runs the main trigger to deal with the movement and so on --------
            • Trigger - Turn on PsychoHookLoop <gen>
            • -------- Removes leaks --------
            • Custom script: call RemoveLocation( udg_loc )
          • Else - Actions
            • Game - Display to (Player group((Triggering player))) the text: This Spell may not ...
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
    • -------- Declaration of some local variables so there is no need to waste space for global ones --------
    • Custom script: local real a = 0
    • Custom script: local unit u = null
    • Custom script: local unit u2 = null
    • -------- This trigger will be turned of if there is nothing to do --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • PHMax Less than 1
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
        • For each (Integer i) from 1 to PHMax, do (Actions)
          • Loop - Actions
            • Custom script: set udg_PHDistance[udg_i*2] = udg_PHDistance[udg_i*2] + udg_PHSpeed[udg_i*2]
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • PHCaster[i] Not equal to No unit
                • (PHCaster[i] is alive) Equal to True
                • Or - Any (Conditions) are true
                  • Conditions
                    • PHDistance[(i x 2)] Less than PHDistance[((i x 2) + 1)]
                    • PHReturn[i] Equal to True
                • ((Playable map area) contains PHSegment[(i x 100)]) Equal to True
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • PHReturn[i] Equal to False
                  • Then - Actions
                    • -------- Moves the first one --------
                    • Custom script: set u = udg_PHSegment[udg_i*100]
                    • -------- "a" is the direction the first hook will travel along --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • PHAngle[i] Greater than or equal to 0.00
                      • Then - Actions
                        • Custom script: set a = GetUnitFacing( udg_PHCaster[udg_i] ) + udg_PHAngle[udg_i]
                      • Else - Actions
                        • Custom script: set a = GetUnitFacing( udg_PHSegment[udg_i*100] )
                    • -------- This makes the first unit face where it's going --------
                    • Custom script: call SetUnitFacing( u, a )
                    • -------- This is called polar projection (it's the same as "point with polar offset" but with coordinates) --------
                    • -------- The position of the first unit will be set to its position + (Cos for x and Sin for y of its facing angle) * speed --------
                    • Custom script: call SetUnitX( u, GetUnitX( u ) + Cos( a * bj_DEGTORAD ) * udg_PHSpeed[udg_i*2] )
                    • Custom script: call SetUnitY( u, GetUnitY( u ) + Sin( a * bj_DEGTORAD ) * udg_PHSpeed[udg_i*2] )
                    • Set loc = (Position of PHSegment[(i x 100)])
                    • -------- Tree Killer Function --------
                    • Destructible - Pick every destructible within 180.00 of loc and do (Actions)
                      • Loop - Actions
                        • -------- If the tree is not dead already --------
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • ((Picked destructible) is alive) Equal to True
                          • Then - Actions
                            • -------- Moves the harvest dummy to the position of the picked destructable --------
                            • Custom script: call SetUnitX(udg_harvester, GetWidgetX(GetEnumDestructable() ))
                            • Custom script: call SetUnitY(udg_harvester, GetWidgetY(GetEnumDestructable() ))
                            • -------- Orders the dummy to try to harvest the picked destructable --------
                            • Unit - Order harvester to Harvest (Picked destructible)
                            • -------- If the dummy is able to harvest the picked destructable it must be a tree --------
                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • (Current order of harvester) Equal to (Order(harvest))
                              • Then - Actions
                                • -------- Create some special effect --------
                                • Set loc2 = (Position of (Picked destructible))
                                • Special Effect - Create a special effect at loc2 using Abilities\Weapons\DemolisherFireMissile\DemolisherFireMissile.mdl
                                • Special Effect - Destroy (Last created special effect)
                                • Custom script: call RemoveLocation( udg_loc2 )
                                • -------- Kill the Tree --------
                                • Destructible - Kill (Picked destructible)
                              • Else - Actions
                            • -------- Stops the dummy from going to the next tree after the previous one was killed --------
                            • Unit - Order harvester to Stop
                          • Else - Actions
                    • -------- Checks if a unit is within range --------
                    • -------- The unit has to be: --------
                    • -------- -non flying --------
                    • -------- -not be a target yet --------
                    • -------- -not be a target yet --------
                    • -------- -not to be a structure --------
                    • -------- -alive --------
                    • -------- -hostile --------
                    • Set TempArrayGroup[i] = (Units within 180.00 of loc matching ((((Matching unit) is A flying unit) Equal to False) and ((((((Matching unit) is in PHTargetGroup) Equal to False) and (((Matching unit) is A structure) Equal to False)) and (((Matching unit) is alive) Equal to True)) and
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (TempArrayGroup[i] is empty) Equal to False
                      • Then - Actions
                        • Set PHTarget[i] = (Random unit from TempArrayGroup[i])
                        • Unit Group - Add PHTarget[i] to PHTargetGroup
                        • Set PHDistance[((i x 2) + 1)] = 0.00
                        • Set PHReturn[i] = True
                        • -------- Set Damage here (Preset: 100 + 100 per level) --------
                        • Unit - Cause PHCaster[i] to damage PHTarget[i], dealing (((Real((Level of Psycho Hook for PHCaster[i]))) x 100.00) + 100.00) damage of attack type Spells and damage type Normal
                        • -------- Impact Effect --------
                        • Special Effect - Create a special effect attached to the chest of PHTarget[i] using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                        • Special Effect - Destroy (Last created special effect)
                      • Else - Actions
                    • Custom script: call DestroyGroup( udg_TempArrayGroup[udg_i] )
                    • Custom script: call RemoveLocation( udg_loc )
                    • -------- Change distance between segments here (Preset: 75 ) --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • PHSegmentMax[i] Less than 101
                        • PHSegmentMax[i] Less than or equal to ((Integer(PHDistance[(i x 2)])) / 75)
                      • Then - Actions
                        • Set loc = (Position of PHCaster[i])
                        • Set loc2 = (Position of PHSegment[((i x 100) + (PHSegmentMax[i] - 1))])
                        • -------- Other hook dummys are created --------
                        • Unit - Create 1 PsychoHookDummy for (Owner of PHCaster[i]) at loc facing loc2
                        • Custom script: call RemoveLocation( udg_loc )
                        • Custom script: call RemoveLocation( udg_loc2 )
                        • Set PHSegment[((i x 100) + PHSegmentMax[i])] = (Last created unit)
                        • Set PHSegmentMax[i] = (PHSegmentMax[i] + 1)
                      • Else - Actions
                    • -------- Other hook dummys are moved --------
                    • Custom script: set u2 = udg_PHSegment[udg_i*100]
                    • For each (Integer i2) from 1 to PHSegmentMax[i], do (Actions)
                      • Loop - Actions
                        • Custom script: set u = udg_PHSegment[ udg_i * 100 + udg_i2 ]
                        • -------- This calculates the angle between a segment and the segment behind it --------
                        • Custom script: set a = Atan2( GetUnitY(u2) - GetUnitY(u), GetUnitX(u2) - GetUnitX(u) )
                        • Custom script: call SetUnitX( u, GetUnitX(u) + Cos(a) * udg_PHSpeed[udg_i*2] )
                        • Custom script: call SetUnitY( u, GetUnitY(u) + Sin(a) * udg_PHSpeed[udg_i*2] )
                        • -------- bj_RADTODEG is used to change radiants to degrees --------
                        • Custom script: call SetUnitFacing( u, a *bj_RADTODEG )
                        • Custom script: set u2 = u
                  • Else - Actions
                    • -------- Same the other way round --------
                    • Custom script: set u2 = udg_PHCaster[udg_i]
                    • Set loc = (Position of PHCaster[i])
                    • For each (Integer i2) from 1 to PHSegmentMax[i], do (Actions)
                      • Loop - Actions
                        • Custom script: set u = udg_PHSegment[ udg_i * 100 + ( udg_PHSegmentMax[udg_i] - udg_i2 ) ]
                        • Custom script: set a = Atan2( GetUnitY(u2) - GetUnitY(u), GetUnitX(u2) - GetUnitX(u) )
                        • Custom script: call SetUnitX( u, GetUnitX(u) + Cos(a) * udg_PHSpeed[udg_i*2+1] )
                        • Custom script: call SetUnitY( u, GetUnitY(u) + Sin(a) * udg_PHSpeed[udg_i*2+1] )
                        • Custom script: if udg_PHCaster[udg_i] != u2 then
                        • Custom script: call SetUnitFacing(u2, a*bj_RADTODEG+180)
                        • Custom script: endif
                        • Custom script: set u2 = u
                        • -------- Checks if the distance ^ 2 between the target and the caster is very small --------
                        • Custom script: if 25000>Pow(GetUnitX(u2)-GetUnitX(udg_PHCaster[udg_i]), 2)+Pow(GetUnitY(u2)-GetUnitY(udg_PHCaster[udg_i]), 2)then
                        • -------- Hides the segment --------
                        • Custom script: call ShowUnit(u2,false)
                        • Custom script: endif
                    • Custom script: call RemoveLocation( udg_loc )
                    • -------- Target is moved to the first/last hook (however you'd like to call it now) --------
                    • Custom script: set u = udg_PHTarget[udg_i]
                    • Custom script: set u2 = udg_PHSegment[udg_i*100]
                    • Custom script: call SetUnitX( u, GetUnitX( u2 ) )
                    • Custom script: call SetUnitY( u, GetUnitY( u2 ) )
                    • Set loc = (Position of PHTarget[i])
                    • -------- Killing trees again --------
                    • Destructible - Pick every destructible within 180.00 of loc and do (Actions)
                      • Loop - Actions
                        • -------- If the tree is not dead already --------
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • ((Picked destructible) is alive) Equal to True
                          • Then - Actions
                            • -------- Moves the harvest dummy to the position of the picked destructable --------
                            • Custom script: call SetUnitX(udg_harvester, GetWidgetX(GetEnumDestructable() ))
                            • Custom script: call SetUnitY(udg_harvester, GetWidgetY(GetEnumDestructable() ))
                            • -------- Orders the dummy to try to harvest the picked destructable --------
                            • Unit - Order harvester to Harvest (Picked destructible)
                            • -------- If the dummy is able to harvest the picked destructable it must be a tree --------
                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • (Current order of harvester) Equal to (Order(harvest))
                              • Then - Actions
                                • -------- Create some special effect --------
                                • Set loc2 = (Position of (Picked destructible))
                                • Special Effect - Create a special effect at loc2 using Abilities\Weapons\DemolisherFireMissile\DemolisherFireMissile.mdl
                                • Special Effect - Destroy (Last created special effect)
                                • Custom script: call RemoveLocation( udg_loc2 )
                                • -------- Kill the Tree --------
                                • Destructible - Kill (Picked destructible)
                              • Else - Actions
                            • -------- Stops the dummy from going to the next tree after the previous one was killed --------
                            • Unit - Order harvester to Stop
                          • Else - Actions
                    • -------- Stop if the target vanishes or reached the caster --------
                    • Set loc2 = (Position of PHCaster[i])
                    • -------- Delete the "IsAlive?-Thing" to make this skill pull dead units --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (PHTarget[i] is alive) Equal to True
                        • PHTarget[i] Not equal to No unit
                        • (Distance between loc and loc2) Greater than 64.00
                      • Then - Actions
                      • Else - Actions
                        • Set PHReturn[i] = False
                    • Custom script: call RemoveLocation( udg_loc )
                    • Custom script: call RemoveLocation( udg_loc2 )
              • Else - Actions
                • -------- Clean up and sort array slots --------
                • For each (Integer i2) from 0 to 99, do (Actions)
                  • Loop - Actions
                    • Unit - Unhide PHSegment[((i x 100) + i2)]
                    • Unit - Kill PHSegment[((i x 100) + i2)]
                    • Set PHSegment[((i x 100) + i2)] = PHSegment[((PHMax x 100) + i2)]
                    • -------- So it won't waste space until the slots are used again --------
                    • -------- Usually I don't do that but for such an ammount of units it seems appropriate --------
                    • Set PHSegment[((PHMax x 100) + i2)] = No unit
                • Unit Group - Remove PHTarget[i] from PHTargetGroup
                • Set PHCaster[i] = PHCaster[PHMax]
                • Set PHTarget[i] = PHTarget[PHMax]
                • Set PHDistance[(i x 2)] = PHDistance[(PHMax x 2)]
                • Set PHDistance[((i x 2) + 1)] = PHDistance[((PHMax x 2) + 1)]
                • Set PHSpeed[(i x 2)] = PHSpeed[(PHMax x 2)]
                • Set PHSpeed[((i x 2) + 1)] = PHSpeed[((PHMax x 2) + 1)]
                • Set PHAngle[i] = PHAngle[PHMax]
                • Set PHReturn[i] = PHReturn[PHMax]
                • Set PHSegmentMax[i] = PHSegmentMax[PHMax]
                • Set PHMax = (PHMax - 1)
                • Set i = (i - 1)
    • -------- Clean leaks --------
    • Custom script: set u = null
    • Custom script: set u2 = null

  1. Release
  2. Fixed a Bug (thanks to Baassee), added other examples, improved documentatin, added new command (-nocd)
Tooltip:
 

Attachments

  • tooltip.JPG
    tooltip.JPG
    23.3 KB · Views: 9,999
Last edited:
Level 9
Joined
Aug 2, 2008
Messages
219
Holy.... The preview screenshot looks awesome
[downloading]

Well i have to say this really nicely made. 80 instances at the same time looks MUI enough for me and i couldn´t spot any leaks, but better do not relay on that, because im not that good at GUI. Visually it´s awesome, as i said before, but i don´t really understand how this thing finds its way to the target unit. It´s moving in curves and often gets a random unit instead of a the targeted one. I think this shouldn´t deal damage to the enemies, or at least a very few damage, because it´s not really balanced if it deals 600 damage to a hero and then drags it towards you. Well you also put some decent manual and tooltip into the map and the description. I personally would suggest that you may change some variable names, such as i i2 and loc could cause some trouble and in your rather long jass blocks you could do some indention. I think i repeat me but this is awesome !

regards TNT
 
Last edited:
Level 16
Joined
Oct 12, 2008
Messages
1,570
It looks ok, but i got a big question for you:
Why all the custom script? Yeah because you use Locals, but why not replace the locals by 3 globals, and leave all the custom script? The only things that cannot be done in GUI is RemoveLocation, Destroy Group and SetUnitX/Y, the rest is perfectly able to be done in GUI.
That besides, i didnt download and test, but the spell looks fine to me. I vote for approval..
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Looks nice but i think the range is much to high (Level 3 = 4000 o_O)

you can change it - it's not hardcoded
and since it is hard to aim I think it's fair
however this is just a testmap to show that it works if extreme conditions occur

It´s moving in curves and often gets a random unit instead of a the targeted one.

the first hook goes towards the same direction where the caster is looking at (no clue how to translate my uber german tooltip properly so it might be unclear....)

I think this shouldn´t deal damage to the enemies, or at least a very few damage, because it´s not really balanced if it deals 600 damage to a hero and then drags it towards you.

you may change it - my spells are not for melee only but for funmaps, too

I personally would suggest that you may change some variable names, such as i i2 and loc could cause some trouble

these variables are temporary so I don't give them a special name (I'd need at least 50% more globals for every spell and 50% more time to scroll threw the list of globals)

and in your rather long jass blocks you could do some indention.

yeah...sometimes I forget about that....It's like "DUH! I'VE GOT A BADASS SPELL IDEA! *CODING* AH! IT WORKS! *UPLOAD* -.- documentation.....*scribbelingsomestuffbetweenthelines* THERE IT GOES! time for breakfast :mwahaha:"

Why all the custom script? Yeah because you use Locals, but why not replace the locals by 3 globals, and leave all the custom script? The only things that cannot be done in GUI is RemoveLocation, Destroy Group and SetUnitX/Y, the rest is perfectly able to be done in GUI.

cause it's a pain in the ass to scroll threw a list of 999999 globals....coding in GUI is slow enough already

Would'nt that lag a bit?

for me it does not lag until there are like 300 units around the map and I need 33 frames per second to make it look smooth - change it if you want
(probably it will work with aritmethic stuff like 1/24)


thanks to all the people who commented :D
(but why just looking at it and not downloading - how can you stand the desire to see this spell????? o_O )
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Just one question, are you shadowing globals? (A)

Naah it looks fine to me the only buggish I can think of is when two casters each other with this spell, how will it appear to look? ^^

If you cast another time, doesn't the harvester overwrite itself? so you will have limitless unit leaks? Because I don't see the harvester being removed somewhere in the coding.

Else it's very good good good spell but I thought you could make it limitless segments with using the locals but you went the other way ;)

But it looks good as always but take a look about the harvester.

have fun.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Just one question, are you shadowing globals? (A)

never heared of that so I think I don't
what's that?

Naah it looks fine to me the only buggish I can think of is when two casters each other with this spell, how will it appear to look? ^^

right...I'll fix that


If you cast another time, doesn't the harvester overwrite itself? so you will have limitless unit leaks? Because I don't see the harvester being removed somewhere in the coding.

there is a condition (if harvester == no unit then...)

Else it's very good good good spell but I thought you could make it limitless segments with using the locals but you went the other way ;)

how? I don't have any idea how to save local arrays
won't they get removed after the trigger ran once?

But it looks good as always but take a look about the harvester.

I'll do

have fun.

sure :grin:

edit: everything done (and the dummy won't be created more then once)
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
@D4rk G4nd4lf
shadowing globlas means that you declare locals which have the same name as a global. For example: local integer udg_i I think if now use the global i in the GUI dialogs it will refer to the local instead of the local. Well but you cant do this anyway now since blizzard fixed that in 1.23 or 1.24

yeah right I just remember reading about some change with the latest patch regarding that (since I couldn't think of any use for it I forgot it :ugly:)

and @ baassee:
how is it possible to have an unlimited amount of segments?
without hashtables because they are very slow (don't know how slow but too slow for my spells at least))
and without JNGP because it will be killed by antivirus stuff....

edit: YAY! 300 POSTS! THIS....IS....MADNESS!!!!!!!!!!!!!!!!!!!!!!!!!!!!1111111111111111111112
 
Level 13
Joined
Mar 16, 2008
Messages
941
@D4rk G4nd4lf
shadowing globlas means that you declare locals which have the same name as a global. For example: local integer udg_i I think if now use the global i in the GUI dialogs it will refer to the local instead of the local. Well but you cant do this anyway now since blizzard fixed that in 1.23 or 1.24
They didn't fix it.
The patchlog said so, but I did a test with 3 different shadowed variables, set a value per globals, changed it while waiting in another trigger, and got the original values back. It works (or at least did so before 3 weeks).
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
They didn't fix it.
The patchlog said so, but I did a test with 3 different shadowed variables, set a value per globals, changed it while waiting in another trigger, and got the original values back. It works (or at least did so before 3 weeks).

awesome xD

seems like blizzard sux at fixing stuff

maybe it is possible to inject evil code using shadowed variables, too :ugly:
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
They do suck at fixing, but you dont need to shadow any globals as you use custom script all the time,, i wonder why you dont start (v)Jass?

(Shadowing globals is mainly to be able to use those 'shadowed' globals (which are actually locals!) in GUI.)
  • Actions
    • Custom script: local unit udg_Caster
    • Set Caster = Triggering Unit
    • Unit - Add Storm Bolt to Caster
    • Wait 3 seconds
    • Unit - Remove Storm Bolt from Caster
That would work, and be MUI, since the udg_Caster is a local now, (if it isnt fixed anyway)
But just dont use it, and if you use locals anyway, just go to JASS fully, and use Hashtable to make it MUI (or just vJass with structs)
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
They do suck at fixing, but you dont need to shadow any globals as you use custom script all the time,, i wonder why you dont start (v)Jass?

(Shadowing globals is mainly to be able to use those 'shadowed' globals (which are actually locals!) in GUI.)
  • Actions
    • Custom script: local unit udg_Caster
    • Set Caster = Triggering Unit
    • Unit - Add Storm Bolt to Caster
    • Wait 3 seconds
    • Unit - Remove Storm Bolt from Caster
That would work, and be MUI, since the udg_Caster is a local now, (if it isnt fixed anyway)
But just dont use it, and if you use locals anyway, just go to JASS fully, and use Hashtable to make it MUI (or just vJass with structs)

thanks a lot
and this won't bug if udg_Caster is set to something else within the 3 seconds in a different trigger?
I always did it like that
JASS:
local unit u = GetTriggerUnit()
wait some seconds
set udg_u = u
do something with udg_u
but I won't shadow my globals anyway cause blizzard might fix it properly some day :p

I can't use JNGP because it is detected as a hack and when I am at school I would not be able to work with my stuff....+JNGP is third party tool and I don't like blizzards attitude towards third party stuff
anyway I can do everything with GUI, too (might be a little harder but possible) and I like coding with mouse only so I can lay on my couch and use the other hand for other things :grin: (not what you think)
and I got so used to it....

and I won't use hashtables unless I have to
like I already said somewhere before:
they are too slow for me

thanks again for explaining the shadow global thing so I understood it x)
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
JNGP is the shit, really helps you coding better, I promise.

Well didn't see the condition sry :/

I thought about the segments that locals didn't were removed when looping? :S

well the thing about hashtables is that they are slower than indexing but sometimes in very small amounts but in this case as you will use very very many, I would sense that the changes could be seen but not sure at all.
 
Level 12
Joined
Mar 10, 2008
Messages
869
They do suck at fixing, but you dont need to shadow any globals as you use custom script all the time,, i wonder why you dont start (v)Jass?

(Shadowing globals is mainly to be able to use those 'shadowed' globals (which are actually locals!) in GUI.)
  • Actions
    • Custom script: local unit udg_Caster
    • Set Caster = Triggering Unit
    • Unit - Add Storm Bolt to Caster
    • Wait 3 seconds
    • Unit - Remove Storm Bolt from Caster
That would work, and be MUI, since the udg_Caster is a local now, (if it isnt fixed anyway)
But just dont use it, and if you use locals anyway, just go to JASS fully, and use Hashtable to make it MUI (or just vJass with structs)

I thought blizzard prevented the usage of shadowing in 1.24?
 
Level 2
Joined
May 8, 2011
Messages
19
Thank you nice spell

"how to make this spell target your friends and your enemies ? I tried doing so but then spell does not work"
mess around with the trigger's you have comment's that help you what is what ...
edit:why not made the straight hook go back ? can you post how to do that
 
Last edited:
Top