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

[Trigger] Hook Pull in and pull to

Status
Not open for further replies.
Level 7
Joined
Oct 6, 2006
Messages
293
I've used the hook ability from the spells section : http://www.hiveworkshop.com/resources_new/spells/702/
and it works great ingame but im wondering if I can get it to behave like the meat hook in Pudge Wars where it can pull you to a unit(like a post) and pull units to you while being the same ability like P.W.

It would probably be the most fun ability to use in my map to be a character in 3rd person and use it to get across ledges in my second set of dungeons ill make later. Any help gladly appreciated, Ill keep looking over it and try to see how it functions.
 
Level 5
Joined
Jul 11, 2007
Messages
152
Unless you want to use GUI for a trigger like this:

  • Unit - A unit begins casting an ability
  • Ability equal to (Hook Pull)
  • Set TempPoint to Position of (targeted unit)
  • Unit - move (casting unit) instantly to center of TempPoint
  • Region - remove TempPoint
  • Unit - A unit begins casting an ability
  • Ability equal to (Hook Unit)
  • Set TempPoint to Position of (casting unit)
  • Unit - move (targeted unit) instantly to center of TempPoint
  • Region - remove TempPoint
Then I'd suggest asking this in the Spells and Systems section.
BTW: Thank you for not using meat hook in an AoS, grappling is awesome.
 
Level 7
Joined
Oct 6, 2006
Messages
293
Yea the spell is entirely GUI and behaves just like the hook in pudge wars, dota. Thats the only way I can actually tell how it works lol. I would use that 2 trigger system but I know pudge wars has )a way to trigger it all for 1 ability that allows to pull to units (some structure) or allows to pull units to you.

I think it has a way of determining what unit its coming in contact with and acting accordingly. Which in pudge wars that would work great since theirs only acouple units to hit. In my mod their would quite afew so maybe its not feasible for a large set of units unless I make a duplicate of the hook and make one for pulling to me and pulling to unit but just reversing the triggers functions so instead of the unit pulling to me, im pulled to the unit.

Mainly going for this because watching the hook go out in 3rd person and latch onto something and pull it to you on the hook looks sweet, and should look sweeter when I shoot a hook acrosssome falloff, watch it hit a post and pull me towards the post across the ledge =)

Can imagine watching 4 people scaling up some ledges with grapples flying everywhere haha.

(hmm this could be in the spell sections actually but maybe its better here since im trying to add triggers to the spell? not sure)
 
Level 5
Joined
Jul 11, 2007
Messages
152
Yea if you wanted it as one spell, you would have to make conditions and if/then /else for each different unit type. So if you only had a handful of units to grapple towards you could leave it as

  • If
  • Unit type of (targeted unit) equal to GrappleUnit1 or Unit type of (targeted unit) equal to GrappleUnit2 or Unit type of (targeted unit) equal to GrappleUnit3
  • Then
  • Set TempPoint to Position of (targeted unit)
  • Unit - move (casting unit) instantly to center of TempPoint
  • Region - remove TempPoint
  • Else
  • Set TempPoint to Position of (casting unit)
  • Unit - move (targeted unit) instantly to center of TempPoint
  • Region - remove TempPoint
But this would make all units game for being pulled towards you, so the more conditions the more specific the ability will be.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Meh move instantly would look like crap.
It can be done really easly that the unit will slowly move there.

Lets say something like this:
JASS:
local unit whichUnit = GetTriggerUnit() // triggering unit
local unit u = GetSpellTargetUnit() // target of the spell
local real heightWhichUnit = GetUnitFlyHeight(whichUnit) // height of whichUnit
local real heightU = GetUnitFlyHeight(u) // height of 'u'
local real distance = DistanceBetweenPointsXY(GetUnitX(whichUnit), GetUnitY(whichUnit), GetUnitX(u), GetUnitY(u))
(notice: DistanceBetweenPointsXY is my own function that takes 2 coordinates instead of two locations)

Now you decide how many steps you want it to make and according to that move the unit and set his height.
And you can also make the terrain a target and then check for "GetLocationZ(some location)" to get the height of the terrain.

It can also be done in GUI but it will suck.
 
Status
Not open for further replies.
Top