Spell Grappling Hook

Sim

Forum Administrator
Staff member
Reaction score
534
> Actually units have a limit of 512

522.

------------------------------------

7 triggers? You can certainly do this with less than 7 triggers.

Triggers that use the same event should be merged together, in order to reduce the number of triggers.

Grapple Init + Lightning
Grapple Effect + GrappleHook + DestroyNHalt + MoveLightning
Grapple Damage alone

-------------------------------------

> Wait until ((Distance between (Position of GrappleHook) and TargetPoint) Less than or equal to 50.00), checking every 0.10 seconds

Leak

Code:
GrappleHook
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units of type GrappleDummy)) Equal to 0
                GrappleSnagged Equal to False
            Then - Actions
                Unit - Create 1 GrappleDummy for (Owner of Caster1) at (CasterPosition offset by 11.00 towards Angle degrees) facing Angle degrees
                Set GrappleHook = (Last created unit)
                Unit - Order GrappleHook to Move To TargetPoint
                [B]Set GrappleHookLoc = (Position of GrappleHook)[/B]
                Trigger - Add to GrappleDamage <gen> the event (Unit - A unit comes within 66.00 of GrappleHook)
                Trigger - Turn on GrappleDamage <gen>
            Else - Actions
        Wait until ((Distance between (Position of GrappleHook) and TargetPoint) Less than or equal to 50.00), checking every 0.10 seconds
        Trigger - Turn on Grapple Effect <gen>
        Set CasterPosition = (Position of Caster1)
        Wait until ((Distance between CasterPosition and GrappleHookLoc) Less than or equal to 10.00), checking every 0.10 seconds
        Unit - Remove GrappleHook from the game
        Trigger - Turn off (This trigger)

You must remove the location before setting it to a new value.

Code:
GrappleDamage
    Events
    Conditions
        (Triggering unit) Not equal to Caster1
        (Triggering unit) Not equal to GrappleHook
    Actions
        Unit - Pause GrappleHook
        Set GrappleSnagged = True
        Unit - Cause Caster1 to damage (Triggering unit), dealing (90.00 x (Real((Level of Grapple  for Caster1)))) damage of attack type Chaos and damage type Normal
        [B]Set TargetPoint = (Position of GrappleHook)
        Set GrappleHookLoc = (Position of GrappleHook)[/B]
        Set Distance = (Distance between CasterPosition and TargetPoint)
        Wait 1.00 seconds
        Trigger - Turn on DestroyNHalt <gen>
        Trigger - Turn off (This trigger)

Same.

Code:
MoveLightning
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        [B]Set CasterPos2 = (Position of Caster1)
        Set GrappleHookLoc = (Position of GrappleHook)[/B]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Caster1 is alive) Equal to True
            Then - Actions
                Lightning - Move (Last created lightning effect) to source CasterPos2 and target GrappleHookLoc
                Trigger - Turn on DestroyNHalt <gen>
            Else - Actions
                Lightning - Destroy Lightning

Same.

---------------------------------

Code:
Grapple Init
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Grapple 
    Actions
        Set GrappleSnagged = False
        Set Caster1 = (Casting unit)
        Set CasterPosition = (Position of Caster1)
        Set PointVarCaster1 = (Position of Caster1)
        Set TargetPoint = (Target point of ability being cast)
        Set Distance = (Distance between CasterPosition and TargetPoint)
        Set Angle = (Angle from CasterPosition to TargetPoint)
        Set N = 0.00
        Selection - Clear selection for (Owner of Caster1)
        [B]Wait 0.01 seconds[/B]
        Selection - Select Caster1 for (Owner of Caster1)
        Unit - Pause Caster1
        Animation - Play Caster1's attack animation
        Unit - Turn collision for Caster1 Off
        Trigger - Turn on GrappleHook <gen>

Remove the wait.

Code:
Lightning
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Grapple 
    Actions
        [B]Wait 0.03 seconds[/B]
        Set GrappleHookLoc = (Position of GrappleHook)
        Set CasterPos2 = (Position of Caster1)
        Lightning - Create a Magic Leash lightning effect from source CasterPos2 to target PointVarCaster1
        Set Lightning = (Last created lightning effect)
        Lightning - Change color of Lightning to (0.70 0.40 0.20) with 1.00 alpha
        Wait until (((Playable map area) contains GrappleHook) Equal to True), checking every 0.10 seconds
        Trigger - Turn on MoveLightning <gen>

Remove the wait.
 

Pigger

New Member
Reaction score
13
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...

Good news! It's a dummy unit :( (Sarcasm) but sarcasm aside, I just made the grappling hook it's own slide trigger so it can now travel at whatever speed I want. It's working almost perfectly now, the only problem I am having is for some reason the hook will hit a unit, the caster will go to the location, but then continues on. It's only happened about twice so I'm not too worried about it, I'll fix it later.

I've added in an immobilization part to the spell so that when a unit is hit by it, he cannot move until the caster has reached the destination.
 

Cohadar

master of fugue
Reaction score
209
It's working almost perfectly now, the only problem I am having is for some reason the hook will hit a unit, the caster will go to the location, but then continues on. It's only happened about twice so I'm not too worried about it, I'll fix it later.

You are comparing locations to see if 2 units are close.
If for example your caster is moving 100. distance per timer event
and you are comparing proximity of units with:
Code:
if distance(caster, target) < 20 then
   endslide.
endif

what could happen is this:
caster comes at 30 distance from target,
so 30>20 and it does not end but goes one timer event more.
so the distance now becomes 30-100 = 70 distance
(distance is always greater than zero = sqrt( (Cx-Tx)^2+(Cy-Ty)^2 )
and it is still bigger than 20 so the caster keeps moving.

If you set the numbers properly you can even see some weird effects
like caster oscillating around target. :D

My advice:
make it so that end distance is 2 times bigger that caster move distance per timer event
 

Pigger

New Member
Reaction score
13
You are comparing locations to see if 2 units are close.
If for example your caster is moving 100. distance per timer event
and you are comparing proximity of units with:
Code:
if distance(caster, target) < 20 then
   endslide.
endif

what could happen is this:
caster comes at 30 distance from target,
so 30>20 and it does not end but goes one timer event more.
so the distance now becomes 30-100 = 70 distance
(distance is always greater than zero = sqrt( (Cx-Tx)^2+(Cy-Ty)^2 )
and it is still bigger than 20 so the caster keeps moving.

If you set the numbers properly you can even see some weird effects
like caster oscillating around target. :D

My advice:
make it so that end distance is 2 times bigger that caster move distance per timer event

I'll try that, I hope it works, by your logic yes it should :D. And Daxtreme, I will begin merging the triggers together tonight, this whole spell since is kind of taking me aback in my current map project because of it's constant problems that are only minor yet screw it up so much.

I fixed the location leak.

I never knew you had to remove locations before you could reset them, thanks for that bit of info. Hopefully the merging will go together smoothly, if not I may have to leave it as is and maybe let someone else pick up on it just so I can continue on with my map.

Thanks again
 

Hatebreeder

So many apples
Reaction score
381
Everything is fine now :) Well i tested ur Map, and, the Spell works on yourself xD Just fix that, and you'll get a +Rep from me :)
 
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

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top