DotA Clockwork

AlExAlExAlEx

Member
Reaction score
7
Everyone knows his ultimate, kinda like pudge hook just a bit faster and drags you there.
A bit of help in reproducing it ? there was a link on dota-allstars but its down atm.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Everyone knows his ultimate

Unfortunately I do not. And I would not be surprised if many people here do not. Could you provide a full and clear description of what the ability does, please?
 

AlExAlExAlEx

Member
Reaction score
7
I'm sorry.
Fires a grappling, piston-like attachment at a unit or location. It will latch on the first, enemy target it encounters, pulling you to it. Any enemies whom you collide with while being reeled toward the target will take damage and will be stunned.
 

DioD

New Member
Reaction score
57
1200 per second, 0.03 period, 3000 range, actually this is slowportation.

direct movement with time is very easy to do, personally dont see any problems.
 

DioD

New Member
Reaction score
57
and what your problems?

there is 6001 tutorial about how to operate local variables.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
i wont give you the triggers cause i am lazy but i will tell you what you have to do:

first of all, get a dummy ability which is unit targeting. channel could be used for this pretty good i think.
next you need a dummy unit with the model of the projectile you want to use. give the dummy the "Ghost (visible)" 'Aeth' ability and maybe "Locust" 'Aloc' too. invulnerability would be good as well.
and very important, give it the "Rally" 'Aral' ability!

now you have a choice:
use a damage detection system
use no damage detection system
the latter will be a bit less effective and give worse performance but the first will need you to get a damage detection system if you havent already.

for the first you will need the ability "permanent immolation", copy it, change the values to deal 0.01 damage with a duration of 0.02 or 0.03 or so.
give this ability to your dummy projectile.

now the triggers.
when your ability is being cast. create the dummy projectile at the position of the caster.

now, shall the dummy projectile be homing?

YES!
change the owner of the dummy to the owner of the targeted unit.
now set the rally point for the dummy unit to be the targeted unit. (NOT! the position of it!) (in this case the permanent immolation ability needs to target friendly units only and not enemys if you are using the damage detection system!)
NO!
owner is not important, just set the rally point to be the position of the targeted unit.

add the dummy to a unit group variable, something like ProjectileDummyUnits

now create a trigger which runs periodically, like every 0.03, 0.02, 0.01, depending on how "smooth" you want the movement to look.
pick all units in your unit group then move them a little bit into the direction of their rally point. (if the rally point is a unit (homing projectile!) move it towards the position of that unit of course)

now, if using the damage detection system you can detect whether a unit has been hit by the projectile when a unit takes damage and the damage source is your dummy unit or a unit with the unit type of your dummy unit.
thats pretty simple and effective performance wise.

if you are not using the damage detection system what you have to do now is creating a unit group in which are all units within a certain range, which are alive and hostile to the caster of the original spell.
if you create such a unit group periodically every 0.01 seconds and you do this for multiple dummy units on the map this method can become really laggy thats why i suggested the damage detection system.

if you detect that a target is hit, you have to move the caster towards it.
to move the caster do the same method as with the dummy unit. a periodically running event with low intervals moving the caster a bit closer to the position of the target.
shall the caster be stunned within this time? then you should use the standard GUI function "Unit - move unit instantly" because this function will practically "stun" your unit since all of its orders given by the player will be nullified every time this function is terminated and since the intervall for the periodic event is pretty small it will be most likely permanently stunned until it reaches it location.

if the caster should be able to attack, cast abilitys, move, etc you need jass.
there is a jass function like this:
SetUnitX(unit, x)
SetUnitY(unit, y)
if you use this your unit will not lose its orders.

so, thats the basic concept.

if you still have problems to code all this stuff you should just say so. and better dont forget to tell us whether you want it to be MUI or MPI or non of both because this will determine how complex and advanced the triggers will become.
 

AlExAlExAlEx

Member
Reaction score
7
i wont give you the triggers cause i am lazy but i will tell you what you have to do:

first of all, get a dummy ability which is unit targeting. channel could be used for this pretty good i think.
next you need a dummy unit with the model of the projectile you want to use. give the dummy the "Ghost (visible)" 'Aeth' ability and maybe "Locust" 'Aloc' too. invulnerability would be good as well.
and very important, give it the "Rally" 'Aral' ability!

now you have a choice:
use a damage detection system
use no damage detection system
the latter will be a bit less effective and give worse performance but the first will need you to get a damage detection system if you havent already.

for the first you will need the ability "permanent immolation", copy it, change the values to deal 0.01 damage with a duration of 0.02 or 0.03 or so.
give this ability to your dummy projectile.

now the triggers.
when your ability is being cast. create the dummy projectile at the position of the caster.

now, shall the dummy projectile be homing?

YES!
change the owner of the dummy to the owner of the targeted unit.
now set the rally point for the dummy unit to be the targeted unit. (NOT! the position of it!) (in this case the permanent immolation ability needs to target friendly units only and not enemys if you are using the damage detection system!)
NO!
owner is not important, just set the rally point to be the position of the targeted unit.

add the dummy to a unit group variable, something like ProjectileDummyUnits

now create a trigger which runs periodically, like every 0.03, 0.02, 0.01, depending on how "smooth" you want the movement to look.
pick all units in your unit group then move them a little bit into the direction of their rally point. (if the rally point is a unit (homing projectile!) move it towards the position of that unit of course)

now, if using the damage detection system you can detect whether a unit has been hit by the projectile when a unit takes damage and the damage source is your dummy unit or a unit with the unit type of your dummy unit.
thats pretty simple and effective performance wise.

if you are not using the damage detection system what you have to do now is creating a unit group in which are all units within a certain range, which are alive and hostile to the caster of the original spell.
if you create such a unit group periodically every 0.01 seconds and you do this for multiple dummy units on the map this method can become really laggy thats why i suggested the damage detection system.

if you detect that a target is hit, you have to move the caster towards it.
to move the caster do the same method as with the dummy unit. a periodically running event with low intervals moving the caster a bit closer to the position of the target.
shall the caster be stunned within this time? then you should use the standard GUI function "Unit - move unit instantly" because this function will practically "stun" your unit since all of its orders given by the player will be nullified every time this function is terminated and since the intervall for the periodic event is pretty small it will be most likely permanently stunned until it reaches it location.

if the caster should be able to attack, cast abilitys, move, etc you need jass.
there is a jass function like this:
SetUnitX(unit, x)
SetUnitY(unit, y)
if you use this your unit will not lose its orders.

so, thats the basic concept.

if you still have problems to code all this stuff you should just say so. and better dont forget to tell us whether you want it to be MUI or MPI or non of both because this will determine how complex and advanced the triggers will become.
No idea on how to do most of the stuff, only basic GUI triggers here..newbie :D
also i don't want anything fancy...just working :) .
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
yeah but shall it work for only a single unit in the entire game? or shall it work for a single unit for every player? (MPI) or shall it work for unlimited units for all players? (MUI)

thats important to know before you can make the triggers.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
thats MPI.
now shall this projectile follow its target or shall it only fly to the position the target was standing at when the skill was used? (when not hitting anything no effect will take place == more player skill is needed)
 

AlExAlExAlEx

Member
Reaction score
7
Ina a straight line aimed by you with the mouse.(the direction where it starts and remains to go)
Basically like an hook just that it drags you to the target not the other way around.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
you read the big post of me i posted here first did you? i explained 2 ways of doing this, one using a damage detection system and one without.

which do you want to use? i have explained the major differences in that post as well.


as i said above it will quicken the process up if you tell us all neccessary information first. i would also recommend you to try it yourself before you want us to make it for you.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
geez.

here, i made you a rather simple one using as little jass as needed only to clean leaks.

it works for all 12 players right now but only 1 unit of every player might cast it at once, furthermore there mustnt be 2 hooks of any player at the same time or strange things might occur.
the heros collision is taken off while sliding to avoid nasty bugs, change this at will but on your own risk.

also there are no effects like damage, stun, whatever, do this yourself.
either with a permanent immolation given to the caster temporarily or with triggers. i dont know, what you like.

here are the triggers, only 3 are needed. i added some comments, maybe they are enough for you to understand. if not then you should try hard to understand it first before making any changes to the system.

this trigger runs if any unit on the map is casting the skill #Channel, change this to whatever you like.
Trigger:
  • Skill OnCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to #Channel
    • Actions
      • Set Temp_Integer = (Player number of (Owner of (Triggering unit)))
      • Set Skill_TargetLocation[Temp_Integer] = (Position of (Target unit of ability being cast))
      • Set Skill_Caster[Temp_Integer] = (Triggering unit)
      • Set Temp_Point[0] = (Position of (Triggering unit))
      • Unit - Create 1 MyDummy for (Player(Temp_Integer)) at Temp_Point[0] facing (Angle from Temp_Point[0] to Skill_TargetLocation[Temp_Integer]) degrees
      • Unit Group - Add (Last created unit) to Skill_ProjectileGroup
      • Custom script: call RemoveLocation (udg_Temp_Point[0])
      • Trigger - Turn on Skill ProjectileMoveLoop <gen>


this trigger handles the movement of the projectiles.
they are moving 24 units every 0.04 seconds by now. you can change this if you want but keep the performance in mind.
they will stop either when their target destination is within 32 units, then nothing will happen, or when any enemy unit which is:
alive
vulnerable
belongs to an enemy
is a ground unit
comes within 64 units of range, if this happens the caster will start moving.
for a better performance this trigger should be initially off. it is turned on when needed and turned off when no projectiles are used to save performance.
Trigger:
  • Skill ProjectileMoveLoop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Skill_ProjectileGroup and do (Actions)
        • Loop - Actions
          • -------- index number of the caster hero --------
          • Set Temp_Integer = (Player number of (Owner of (Picked unit)))
          • -------- check if an enemy is within range of 32 to the projectile --------
          • Set Temp_Point[0] = (Position of (Picked unit))
          • Set Temp_Group = (Units within 64.00 of Temp_Point[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Level of Unverwundbar (Neutral) for (Matching unit)) Less than 1) and (((Matching unit) belongs to an enem
          • Set Skill_TargetUnit[Temp_Integer] = (Random unit from Temp_Group)
          • Custom script: call DestroyGroup (udg_Temp_Group)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Skill_TargetUnit[Temp_Integer] Not equal to No unit
            • Then - Actions
              • -------- enemy is within range and marked as target --------
              • Custom script: call RemoveLocation (udg_Skill_TargetLocation[udg_Temp_Integer])
              • Unit Group - Remove (Picked unit) from Skill_ProjectileGroup
              • Unit - Remove (Picked unit) from the game
              • -------- check if there are no more projectiles flying around --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Skill_ProjectileGroup is empty) Equal to True
                • Then - Actions
                  • -------- there are no projectiles, lets turn off this trigger to save performance --------
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • -------- no enemy in range, move the projectile --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Temp_Point[0] and Skill_TargetLocation[Temp_Integer]) Greater than 32.00
                • Then - Actions
                  • -------- projectile is on its way, WUHUUU --------
                  • Set Temp_Point[1] = (Temp_Point[0] offset by 24.00 towards (Angle from Temp_Point[0] to Skill_TargetLocation[Temp_Integer]) degrees)
                  • Unit - Move (Picked unit) instantly to Temp_Point[1]
                  • Custom script: call RemoveLocation (udg_Temp_Point[1])
                • Else - Actions
                  • -------- projectile reached its targeted location, no enemy hit --------
                  • Custom script: call RemoveLocation (udg_Skill_TargetLocation[udg_Temp_Integer])
                  • Unit Group - Remove (Picked unit) from Skill_ProjectileGroup
                  • Unit - Remove (Picked unit) from the game
                  • -------- check if there are no more projectiles flying around --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Skill_ProjectileGroup is empty) Equal to True
                    • Then - Actions
                      • -------- there are no projectiles, lets turn off this trigger to save performance --------
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
          • Custom script: call RemoveLocation (udg_Temp_Point[0])


this trigger moves the caster by 24 units every 0.04 seconds if a target has been hit by a projectile owned by the same player.
if the target comes within 128 units (128 is the size of a single terrain tile in the editor, equal to the size of a human guard tower or farm) he will stop.
his collision will be turned off while moving because otherwise it might happen that he is blocked by something and never arrives at his target, this will result in permanent stun for the caster which is... well... less good.
Trigger:
  • Skill CasterMoveLoop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Temp_Integer = (Player number of (Picked player))
          • -------- check if there is a unit targeted for this player --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Skill_TargetUnit[Temp_Integer] Not equal to No unit
            • Then - Actions
              • Unit - Turn collision for Skill_Caster[Temp_Integer] Off
              • -------- yes there is, check if the distance towards the target is less then 64 --------
              • Set Temp_Point[0] = (Position of Skill_Caster[Temp_Integer])
              • Set Temp_Point[1] = (Position of Skill_TargetUnit[Temp_Integer])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Temp_Point[0] and Temp_Point[1]) Less than 128.00
                • Then - Actions
                  • -------- target is within range, lets stop the movement. --------
                  • Unit - Turn collision for Skill_Caster[Temp_Integer] On
                  • Set Skill_Caster[Temp_Integer] = No unit
                  • Set Skill_TargetUnit[Temp_Integer] = No unit
                • Else - Actions
                  • -------- not close enough, we need to move a little further. --------
                  • Set Temp_Point[2] = (Temp_Point[0] offset by 24.00 towards (Angle from Temp_Point[0] to Temp_Point[1]) degrees)
                  • Unit - Move Skill_Caster[Temp_Integer] instantly to Temp_Point[2]
                  • Custom script: call RemoveLocation (udg_Temp_Point[2])
              • Custom script: call RemoveLocation (udg_Temp_Point[1])
              • Custom script: call RemoveLocation (udg_Temp_Point[0])
            • Else - Actions


have fun and learn GUI to make the next spell by yourself.
 

Attachments

  • [Z]HookTheOtherWayAround.w3x
    17.4 KB · Views: 272

Laiev

Hey Listen!!
Reaction score
188
I suggest you to don't use 0.01/0.02, the lowest value that people will say to you use, is 0.03
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
What happens if i set the time to 0.2 it will be more accurate but will cause a bit of lag ?

wouldnt change anything in the demo map.
it wouldnt start to lag but i doubt you would feel a major difference either.

a map will most probably never lag because of a single trigger. todays computers are usually just too fast to lag because of such a small thing.

but what causes lag is the combination of many different systems, triggers and game data.
the more units there are, the more special effects played, the more sound effects, periodic events, whatever.

if you set the periodic time event to a smaller intervall the chance that your game might start to lag is increased. just imagine, if its set to 0.04 and then set to 0.02 it means that this system will run twice as often. all these actions within the loops currently run 25 times in a single second. if you set it to 0.02 they will run 50 times a second. for 12 projectiles moving at once its 1200 points created, 600 unit groups created and alot more other actions taken out in a single second. thats not nothing and might slow down the performance in a bigger map with alot of units and such.

of course there are several ways to increase the performance as well.
the triggers i made for you arent as efficient as they might be.
you could use jass to make it a hell lot faster.
unit group recycle systems, point recycle systems, projectiles and units moving without location variables but with x and y coordinates. damage detection instead of the unit group method like i already said above. all this could really make a difference as well.
but i wanted to keep it simple and easy to understand for beginners like you because you wouldnt be able to learn anything from it if i made a big bad jass systems with tons of systems needed to increase performance. besides, i wouldnt make such a system within 10 minutes for somebody i do not know at all just because he cannot do it himself. no offensive but lets stay realistic.
 

AlExAlExAlEx

Member
Reaction score
7
No offence taken.

I noticed an bug, if you use the spell on an hero and he goes in fog of war you don't tp to him anymore.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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