Spell Grappling Hook

Pigger

New Member
Reaction score
13
This spell, grappling hook, is based off of a few things. 1) Sliding that I got from one of The Helper's tutorial section, and 2) Meat Hook from DotA (Somewhat) It is 95% done in this current form, and will be used by me in an upcoming map of mine completely finished.

Grappling Hook: Hurls out a grappling hook that will hit whatever is first in line infront of it. Pulls the caster towards the hook location shortly afterwards.

I'm not sure if it is fully leakless, as I'm a bit tired to check anymore. If you are to use this in any map please credit me on it, or atleast don't take credit for youself.

Screenshot:


Import Difficulty: Well, all you've gotta do is import units, triggers, and abilities. Not too hard to import.

EDIT: Map back up.

UPDATE: I have been doing a few other things, I now have it working perfectly I just need to finish exporting/importing it onto the test map from my current game map.

EDIT: Map is (or should be) completely fixed, finish, polished and whatever. Readme inserted into Triggers. Rope Added. Bugs fixed. Should be ready to go. Again, I'm pretty sure it's leakless.

View attachment 9966
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
hey brother...mind increase the size of your....Hook? increase its scale value...i barely able to see whats the thin thingy that fly out =.=

And there were some bugs out there....when u cast the spell...and u immediately press ''S'' (Stop)...then your hero is pause and wont be able to unpause....and when the hook came out...it just stuck there and wont disapear... Fix it..
 

Pigger

New Member
Reaction score
13
Oh boy, and here I thought I had everything fixed by now. I'm going to take it down until it's all fixed, thanks for the heads up.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
welcome...
_______
Just a suggestion...
you can fix it with a trigger like this

E - unit stops casting a spell
C - ability being casted equal to (your spell name)
A - Remove All Position
unpause unit
and remove the dummy arrow
 

Pigger

New Member
Reaction score
13
Well, I ended up with a quick fix of just deselcting and reselecting while there is the short wait that I needed. It should be fine now.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
i will try it later -_- buzy nw...
________
Edit:
Ok now it works better now....i think there were no leaks..is it?
But i would like to ask.....your spell name is grappling hook....which means the hook must grab something....but how come your hook didnt grab anything but the hero will be pulled?
 

Pigger

New Member
Reaction score
13
i will try it later -_- buzy nw...
________
Edit:
Ok now it works better now....i think there were no leaks..is it?
But i would like to ask.....your spell name is grappling hook....which means the hook must grab something....but how come your hook didnt grab anything but the hero will be pulled?

Well, It's not a perfect grappling hook, but it is meant to affect both units and terrain. This is the most basic of the finished forms of it. Before it was just a slide, I can make the hook more picky later on but for now it will grapple onto both units, and if none are present it will just grapple the ground.

I suppose I could do way more tweaking to it to make it more realistic, but for now I am leaving it as it is because it works as it should to an extent.

P.S. Sorry I fell asleep last night before I could post this :O
 

Sim

Forum Administrator
Staff member
Reaction score
534
You need to add implementation instructions.

The hook is way too small, and there should be some kind of "rope" linking you and the hook. Otherwise, it shouldn't be able to pull.

Why wait 0.20 seconds before pausing? My hero threw the hook, moved a bit, the hook went on and I got pulled. It shouldn't do that. The hook should be thrown first, before any wait occur.
 

Pigger

New Member
Reaction score
13
You need to add implementation instructions.

The hook is way too small, and there should be some kind of "rope" linking you and the hook. Otherwise, it shouldn't be able to pull.

Why wait 0.20 seconds before pausing? My hero threw the hook, moved a bit, the hook went on and I got pulled. It shouldn't do that. The hook should be thrown first, before any wait occur.

I'll add implementation instructions once the problems are fixed.

UPDATE: I've fixed the wait problem and am currently working on the rope issue. (Which really isn't liking me!!)
 

Cohadar

master of fugue
Reaction score
209
I actually made similar spell in my old Dragon Survival map
It is written completely in JASS but it is using some
nasty global variables, extremely hard to implement.

How it works:
If it catches a unit it will drag that unit to pudge,
you can even blink with pudge or use teleporters
and hook will still work.

If it "catches" a tree, it will drag pudge to the tree.

Code:
function Pudge_Net_Extending takes integer B returns nothing
    local real angle
        //---- extending..
    set angle = AngleBetweenPoints( udg_PNHeadLoc[B], udg_PNEndLoc[B] )
    // 40 is kvantum of movement, you can change this to speedUp/Slow the hook
    call CHS_MoveLocationToPolarProjection(udg_PNHeadLoc[B], 40, angle)  
    if ( DistanceBetweenPoints(udg_PNHeadLoc[B], udg_PNEndLoc[B]) <= 30.00 ) then
        set udg_PNStatus[B] = 2 // retracting
    endif
endfunction


function Pudge_Net_Retracting takes integer B returns nothing
    local real angle

    set angle = AngleBetweenPoints( udg_PNHeadLoc[B], udg_PNStartLoc[B] )
    call CHS_MoveLocationToPolarProjection(udg_PNHeadLoc[B], 40, angle) 
   
    call CHS_MoveLocationToLocation(udg_PNEndLoc[B], udg_PNHeadLoc[B])
endfunction

function Pudge_Net_Towering takes integer B returns nothing
    local real angle

    set angle = AngleBetweenPoints( udg_PNStartLoc[B], udg_PNEndLoc[B] )
    call CHS_MoveLocationToPolarProjection(udg_PNStartLoc[B], 40, angle) 
endfunction

// LoopA is group , LoopB is player number
function NetFilter takes nothing returns nothing
    local group victimsGroup = C_I2G(bj_forLoopAIndex)

    if (GetEnumUnit() == udg_PNPudge[bj_forLoopBIndex]) then
        call GroupRemoveUnitSimple(GetEnumUnit(), victimsGroup)
        return
    endif
    
    if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) == true ) then
        call GroupRemoveUnitSimple(GetEnumUnit(), victimsGroup)
        return
    endif
    
    if (IsUnitDeadBJ(GetEnumUnit()) == true) then
        call GroupRemoveUnitSimple(GetEnumUnit(), victimsGroup)
        return
    endif

    // towers are units to awoid "base under attack" game messages
    // so we must ignore them manually
    if (GetUnitTypeId(GetEnumUnit()) == 'h003') then
        call GroupRemoveUnitSimple(GetEnumUnit(), victimsGroup)
        return
    endif

endfunction

//-----
function GetTree takes nothing returns nothing
    set udg_PNSnaggedDestructable[GetForLoopIndexB()] = GetEnumDestructable()
endfunction


function Search_Victim takes integer B returns nothing
    local real angle
    local string modelName = "Abilities\\Spells\\Human\\AerialShackles\\AerialShacklesTarget.mdl"
    local group victimsGroup = GetUnitsInRangeOfLocAll(88.00, udg_PNHeadLoc[B])
        
    // clean up unwanted victims
    set bj_forLoopAIndex = C_G2I(victimsGroup)
    set bj_forLoopBIndex = B
    call ForGroup(victimsGroup, function NetFilter )

    set udg_PNSnaggedUnit[B] = FirstOfGroup(victimsGroup)
    call DestroyGroup(victimsGroup)
      
    if (udg_PNSnaggedUnit[B] == null) then
        call EnumDestructablesInCircleBJ( 88.00, udg_PNHeadLoc[B], function GetTree )
        if ( udg_PNSnaggedDestructable[B] != null )  then
            set udg_PNStatus[B] = 3 // towering
            call MoveLocation(udg_PNEndLoc[B], GetDestructableX(udg_PNSnaggedDestructable[B]), GetDestructableY(udg_PNSnaggedDestructable[B]))
            call CHS_MoveLocationToLocation(udg_PNHeadLoc[B], udg_PNEndLoc[B])
            call SetUnitPathing( udg_PNPudge[B], false )
        endif
    else 
        if ( IsUnitAlly(udg_PNSnaggedUnit[B], ConvertedPlayer(B)) == false ) then
            call UnitDamageTargetBJ( udg_PNPudge[B], udg_PNSnaggedUnit[B], udg_PNDmg[B], ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
        endif
        
        set udg_PNEffect[B] = AddSpecialEffectTarget(modelName, udg_PNSnaggedUnit[B], "chest")
        call SetUnitPathing( udg_PNSnaggedUnit[B], false )
        set udg_PNStatus[B] = 2 // retracting
    endif        
    
endfunction

function Move_Victim takes integer B returns nothing
    local real angle
    if ( udg_PNSnaggedDestructable[B] != null )then
        set angle = AngleBetweenPoints( udg_PNStartLoc[B], udg_PNEndLoc[B] ) 
        call SetUnitPositionLocFacingBJ( udg_PNPudge[B], udg_PNStartLoc[B], angle )
    else
        set angle = AngleBetweenPoints( udg_PNStartLoc[B], udg_PNHeadLoc[B] ) 
        call SetUnitPositionLocFacingBJ( udg_PNSnaggedUnit[B], udg_PNHeadLoc[B], angle )
    endif
endfunction


function  EndProcessingCondition takes integer B returns nothing
    if ( DistanceBetweenPoints(udg_PNStartLoc[B], udg_PNEndLoc[B]) <= 80.00 ) then
       call SetUnitPathing( udg_PNSnaggedUnit[B], true )
       call SetUnitPathing( udg_PNPudge[B], true )
       call DestroyLightning( udg_PNLightning[B] )
       call DestroyEffect( udg_PNEffect[B] )
       call   RemoveLocation( udg_PNStartLoc[B]  )
       call   RemoveLocation( udg_PNEndLoc[B]    )
       call   RemoveLocation( udg_PNHeadLoc[B]   )
       
       // This must be the last command of processing
       set udg_PNStatus[B] = 0       
    endif
endfunction

//===========================================================================
//  We use bj_forLoopBIndex to determine current player we process
//  because A and B loop indexes are passed throught trigger calls
//===========================================================================
function Trig_Pudge_Net_Routing_Actions takes nothing returns nothing
    local integer B = 1
    local integer netsInProcess = 0

    loop
        // only players 1..5 and 7..11 use pudge hook
        exitwhen B > 11
        if ( udg_PNStatus[B] != 0) then
            set netsInProcess = netsInProcess + 1
           
            call MoveLocation(udg_PNStartLoc[B], GetUnitX(udg_PNPudge[B]), GetUnitY(udg_PNPudge[B]) )
            call MoveLightningLoc(udg_PNLightning [B], udg_PNStartLoc[B], udg_PNHeadLoc[B])
            
            if (udg_PNStatus[B]==1) then
               call Pudge_Net_Extending(B)
            elseif (udg_PNStatus[B]==2) then
               call Pudge_Net_Retracting(B)
            elseif (udg_PNStatus[B]==3) then
               call Pudge_Net_Towering(B)               
            endif
            
            if ((udg_PNSnaggedUnit[B] == null) and (udg_PNSnaggedDestructable[B] == null)) then
                call Search_Victim(B)
            else
                call Move_Victim(B)      
            endif
            
            call EndProcessingCondition(B)
            
        else
        endif
        set B = B + 1
    endloop
    
    //if we dont use this trigger turn it off so it wont lag
    if (netsInProcess == 0) then
        call DisableTrigger(GetTriggeringTrigger())
    endif
endfunction

//===========================================================================
function InitTrig_Pudge_Net_Routing takes nothing returns nothing
    set gg_trg_Pudge_Net_Routing = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Pudge_Net_Routing, 0.04 )
    call TriggerAddAction( gg_trg_Pudge_Net_Routing, function Trig_Pudge_Net_Routing_Actions )
endfunction

I will attach the map below, so you can see how it works

NOTE: this map is unstable, it was written in times when I didn't know shit about JASS, I am working on version 2.0 and at some point I will redo the hook spell.

But I see you are completing you spell right now,
if you write it to be MUI I will be more than glad to steal it :D
 

Pigger

New Member
Reaction score
13
Cohadar I thank you for letting me look at you map and for the aid. I know nothing of JASS unfortunatly, Everything for my grapple spell seems to work flawlessly, except for right now when I am trying to make a lightning effect act as a rope. The lightning just acts funny, I have a thread on it in the main forums as to keep questions out of this forum.
 

Cohadar

master of fugue
Reaction score
209
Did you upload a new version?

The old one does not grapple to the unit really,
If grapples to the ground where target is standing,
so if target moves it looks silly.

Nice idea of putting an arrow in the hook top,
I will steal it :)

Keep up the good work.

ALSO: learn to program in some real programming language,
it will develop the right kind of brain attitude,
so you will be able to design more complicated spells.

EDIT:

Code:
Wait until (((Playable map area) contains GrappleHook) Equal to True), checking every 0.10 seconds
This is extremely bad way of doing things, and would create impossible lag in any real map.
Learn to use timers.
 

Pigger

New Member
Reaction score
13
Did you upload a new version?

The old one does not grapple to the unit really,
If grapples to the ground where target is standing,
so if target moves it looks silly.

Nice idea of putting an arrow in the hook top,
I will steal it :)

Keep up the good work.

ALSO: learn to program in some real programming language,
it will develop the right kind of brain attitude,
so you will be able to design more complicated spells.

EDIT:

Code:
Wait until (((Playable map area) contains GrappleHook) Equal to True), checking every 0.10 seconds
This is extremely bad way of doing things, and would create impossible lag in any real map.
Learn to use timers.

Yeah, I've only really begun to do things "seriously" in the World Editor in about the past month or so, I'm still learning. How does it create lag if I might ask? Thanks for the positive and constructive feedback.

It should be a new version up, I never renamed them so I can never tell. There are maybe a few things I could/would change about the spell (such as making the hit unit stop moving until the caster gets to it) but I feel it is complete to my standards (as of right now).
 

Cohadar

master of fugue
Reaction score
209
Everything that uses "Entire map area" creates lag,
because game must loop through a group of all units in map
just to check if there is your hook in there somewhere.

There are better ways to do this,
and like I said those are timers.

Learn, learn and only learn...
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
sry for the straight complaining...
______
The hook is Way TOO slow....hate pausing my unit for a long time...
And why dont make it like lvl 4 800range but 9999999999999999999 casting range...it would be nicer...(for my thought)
 

Pigger

New Member
Reaction score
13
sry for the straight complaining...
______
The hook is Way TOO slow....hate pausing my unit for a long time...
And why dont make it like lvl 4 800range but 9999999999999999999 casting range...it would be nicer...(for my thought)

The complaining is fine. As I was saying to Cohadar, I'm still learning, and the best way I was able to do for the hook would be to make it a unit and just make it move. I suppose I could go back and make the hook a sliding unit too :(
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
make the hook movesped faster would make it more realistic

Edit: and play the hero's animation before the hook is created
 

Pigger

New Member
Reaction score
13
> make the hook movesped faster would make it more realistic
I'm pretty sure that I have it set to max (if not is' 521) so I can't make it any faster.
 

Cohadar

master of fugue
Reaction score
209
Actually units have a limit of 512

Missiles can go up to 900 i think

And special effects can go at any speed.

Unless that arrow you use is a dummy unit,
there is no problem to increase the speed...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top