• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] I need a system like this (i have a no idea how to create that)

Level 18
Joined
Jun 2, 2009
Messages
1,276
Moving units is always my weakness. I mean i never get it. And i need a system just like this.

Your hero grabs the target at X range and both of target and Hero jumps back or forward.
I have the system actually but trigger is not professional and i need to someone who experienced with that. I need to template just like this.
Hero can be invisible during the grab but i need if/then/action parts actually. It would be nice if i have system like this.
You can share map file (1.26 or reforged does not matter but trigger must work on previous versions) or trigger or even jass (i do not know about jass but it would be great if i can edit by myself)
No need to gui or mpi. Only one hero uses this ability.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    23.9 KB · Views: 31
I think Point With Polar Offset is a pretty simple function to understand:
  • Point With Polar Offset
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • -------- Ask and answer these three questions: --------
      • -------- --------
      • -------- What direction do we want to go towards? (0-360 degrees) (90 = Up, 180 = Left, 270 = Down, 360 or 0 = Right) --------
      • Set Angle = (Facing of (Triggering unit))
      • -------- --------
      • -------- How far away do we want to go? --------
      • Set Distance = 500.00
      • -------- --------
      • -------- Where are we currently standing? --------
      • Set Point_Start = (Position of (Triggering unit))
      • -------- --------
      • -------- --------
      • -------- Now that we've answered these questions we can use (Point With Polar Offset) to get our new position: --------
      • Set Point_End = (Point_Start offset by Distance towards Angle degrees.)
      • -------- --------
      • -------- Now let's create a Special Effect to show this new position: --------
      • Special Effect - Create a special effect at Point_End using Abilities\Spells\Orc\Bloodlust\BloodlustTarget.mdl
So making a Unit "jump" involves running those above Actions periodically, let's say every 0.02 or 0.03 seconds. Of course you'll want a much smaller Distance because you're moving at a much faster rate.

Then if you want it to go backwards you simply change Distance to a negative number. -500.00 is the opposite of 500.00.


Here's a Leap example from the past, although you'll have to edit it a bit:
 
Last edited:
Hmmm. I think i can share the system actually. Here is the map file (1.26a version) and let me check the Post that you mentioned it.
I do not wanted to share because i think this system can be created better with person who has knowledge.
IF changing it from this map file is easier than creating new one, here is the file.
 

Attachments

Ok ok we can forget about my file because the topic you mentioned and trigger shared by me extremely confusing. Let us work and empty file like you shared.
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Caster = (Triggering unit)
      • Set Angle = (Facing of (Triggering unit))
      • Set Distance = 500.00
      • Set Point_Start = (Position of (Triggering unit))
      • Set Point_End = (Point_Start offset by Distance towards Angle degrees)
      • Trigger - Turn on Run <gen>
  • Run
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Travel_Point = (Travel_Point + (500 / 10))
      • Unit - Move Caster instantly to Point_End
During this test, i want to see this unit moves to target location every 0.10 seconds but i know i need to detect how much distance he moved.
So we need 2 things. How much square he moved, how much square he needs to move every second.
I am confused in here

Run
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Set DistanceMoved = (DistanceMoved + 10)
Unit - Move Caster instantly to (Center of (Playable map area))
I want to select "DistanceMoved" instead of center of bla bla and currently stucked in here.
 
1) You're still not using the Point With Polar Offset function, so I'd definitely start by doing that.
2) You want to lower your Periodic Interval to say 0.02 or 0.03 seconds, like I suggested. 0.10 is very long and will look choppy.
3) The variables you Set in your "Start" trigger must be referenced in your "Run" trigger.

So something like this could work:
  • Jump Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Jump_Caster = (Triggering unit)
      • Set Jump_Target = (Target unit of ability being cast)
      • Set Jump_Caster_Start = (Position of Jump_Caster)
      • Set Jump_Target_Start = (Position of Jump_Target)
      • Set Jump_Angle = (Angle between Jump_Caster_Start and Jump_Target_Start)
      • Set Jump_Distance = 0.01
      • Trigger - Turn on Jump Interval
  • Jump Interval
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set Jump_Distance = (Jump_Distance + 4.00)
      • -------- -------
      • Set TempPoint = (Jump_Caster_Start offset by Jump_Distance towards Jump_Angle degrees.)
      • Unit - Move JumpCaster to TempPoint
      • Custom script: call RemoveLocation( udg_TempPoint )
      • -------- -------
      • Set TempPoint = (Jump_Target_Start offset by Jump_Distance towards Jump_Angle degrees.)
      • Unit - Move Jump_Target to TempPoint
      • Custom script: call RemoveLocation( udg_TempPoint )
      • -------- -------
      • -------- Check if they've traveled 400 total distance (or 2.00 seconds) (4.00 distance / 0.02 interval = 200.00 distance per second) -------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Jump_Distance Greater than or equal to 400.00
        • Then - Actions
          • Custom script: call RemoveLocation( udg_Jump_Caster_Start )
          • Custom script: call RemoveLocation( udg_Jump_Target_Start )
          • Trigger - Turn off (this trigger)
        • Else - Actions
How it works:

The "0.02" is your rate of travel. The lower this number is the faster and smoother the movement will be. I would keep it between 0.02 and 0.03:
  • Time - Every 0.02 seconds of game time
The "4.00" is your distance traveled. The bigger this number is the farther you will travel. I would keep it between 1.00 and 10.00:
  • Set Jump_Distance = (Jump_Distance + 4.00)
The "400.00" is your total distance traveled. You will stop once you've moved this much distance:
  • If - Conditions
    • Jump_Distance Greater than or equal to 400.00
Most ranged units have around 600.00 attack range and most melee units have around 100.00 attack range, so think about that when changing your math.
 
Last edited:
But it turns just like this when i do

Set Jump_Angle = (Angle from Jump_Caster_Start to Jump_Target_Start)

But yours is

Set Jump_Angle = (Angle between Jump_Caster_Start and Jump_Target_Start)

If both of them correct i will contine. They are not exact the same this is why i am confused.
 
But it turns just like this when i do

Set Jump_Angle = (Angle from Jump_Caster_Start to Jump_Target_Start)

But yours is

Set Jump_Angle = (Angle between Jump_Caster_Start and Jump_Target_Start)

If both of them correct i will contine. They are not exact the same this is why i am confused.
Don't worry about little stuff like that, just test it out and see if it works.

(But yes, they're the same thing)
 
Last edited:
I did everything 100% as you told me but they are not jumping. Check the picture in first post please. They are simply sliding.

  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Jump_Caster = (Triggering unit)
      • Set Jump_Target = (Target unit of ability being cast)
      • Set Jump_Caster_Start = (Position of Jump_Caster)
      • Set Jump_Target_Start = (Position of Jump_Target)
      • Set Jump_Angle = 0.00
      • Set Jump_Angle = (Angle from Jump_Caster_Start to Jump_Target_Start)
      • Set Jump_Distance = 0.01
      • Trigger - Turn on Run <gen>
  • Run
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set Jump_Distance = (Jump_Distance + 4.00)
      • Set TempPoint = (Jump_Caster_Start offset by Jump_Distance towards Jump_Angle degrees)
      • Unit - Move Jump_Caster instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- ------------ --------
      • Set TempPoint = (Jump_Target_Start offset by Jump_Distance towards Jump_Angle degrees)
      • Unit - Move Jump_Target instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Jump_Distance Greater than or equal to 400.00
        • Then - Actions
          • Custom script: call RemoveLocation(udg_Jump_Caster_Start)
          • Custom script: call RemoveLocation(udg_Jump_Target_Start)
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
That's good, now you need to adjust their Flying Height so that they will hover above the ground.

So just like you're increasing Distance by 4.00, you could also introduce a Flying Height variable -> Jump_Height.
  • Set Jump_Height = (Jump_Height + 5.00)
  • Animation - Change Jump_Caster flying height to Jump_Height at 0.00
  • Animation - Change Jump_Target flying height to Jump_Height at 0.00
Now their flying height will increase over time.

But you also want them to go back down instead of always up. The best way to handle two different outcomes (up or down) is with an If Then Else:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Jump_Distance Less than or equal to 200.00
    • Then - Actions
      • Set Jump_Height = (Jump_Height + 5.00)
    • Else - Actions
      • Set Jump_Height = (Jump_Height - 5.00)
  • Animation - Change Jump_Caster flying height to Jump_Height at 0.00
  • Animation - Change Jump_Target flying height to Jump_Height at 0.00
Now Height will go up for the first half of the jump and go back down for the second half of the jump. This only works because 200.00 is half of 400.00, if you change 400.00 then you'll want to change 200.00 as well (it's always half the total distance).

That SHOULD work, but flying height is buggy. To get this working for Non-Flying units you have to use a trick.
Add/Remove this ability to your units in the Start trigger:
  • Actions
    • ...
    • Unit - Add Storm Crow Form to Jump_Caster
    • Unit - Add Storm Crow Form to Jump_Target
    • Unit - Remove Storm Crow Form from Jump_Caster
    • Unit - Remove Storm Crow Form from Jump_Target
    • Trigger - Turn on Run <gen>
This makes them able to use the "Set Flying Height" action. They'll still be considered Ground units.

After you figure out how to change flying height you can move onto the next challenge which is making them jump over cliffs/doodads/units/and other unpathable things. This can be a bit challenging since you'll likely want to prevent them from getting stuck or going out of bounds.
 
Last edited:
Uhm. Not solved actually :D I was tought i can make arrangements but i couldn't :D

  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Jump_Height = (Jump_Height + 5.00)
      • Animation - Change Jump_Caster flying height to Jump_Height at 0.00
      • Animation - Change Jump_Target flying height to Jump_Height at 0.00
      • Set Jump_Caster = (Triggering unit)
      • Set Jump_Target = (Target unit of ability being cast)
      • Set Jump_Caster_Start = (Position of Jump_Caster)
      • Set Jump_Target_Start = (Position of Jump_Target)
      • Set Jump_Angle = 0.00
      • Set Jump_Angle = (Angle from Jump_Caster_Start to Jump_Target_Start)
      • Set Jump_Distance = 0.01
      • Unit - Add Storm Crow Form to Jump_Caster
      • Unit - Add Storm Crow Form to Jump_Target
      • Unit - Remove Storm Crow Form from Jump_Caster
      • Unit - Remove Storm Crow Form from Jump_Target
      • Trigger - Turn on Run <gen>


  • Run
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set Jump_Distance = (Jump_Distance + 4.00)
      • Set TempPoint = (Jump_Caster_Start offset by Jump_Distance towards Jump_Angle degrees)
      • Unit - Move Jump_Caster instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- ------------ --------
      • Set TempPoint = (Jump_Target_Start offset by Jump_Distance towards Jump_Angle degrees)
      • Unit - Move Jump_Target instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Jump_Distance Less than or equal to 200.00
        • Then - Actions
          • Set Jump_Height = (Jump_Height + 5.00)
        • Else - Actions
          • Set Jump_Height = (Jump_Height - 5.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Jump_Distance Greater than or equal to 400.00
        • Then - Actions
          • Custom script: call RemoveLocation(udg_Jump_Caster_Start)
          • Custom script: call RemoveLocation(udg_Jump_Target_Start)
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
You're forgetting how triggers work. Everything happens from top to bottom, this rule never changes.

So when you do something out of order like this, it doesn't make any sense:
  • Animation - Change Jump_Caster flying height to Jump_Height at 0.00
  • Set Jump_Caster = (Triggering unit)
How can you change the flying height of Jump_Caster if you haven't even Set Jump_Caster yet? Everything has to be ordered in a logical way.

Moving on, understand how this Action works:
  • Animation - Change Jump_Caster flying height to Jump_Height at 0.00
This changes a unit's flying height to the given value at a rate of "0.00" per second (or some other formula).
You can change the rate by increasing the "0.00" value.
Using a value of 0.00 will make the change happen immediately.
We use 0.00 since we're constantly adjusting Jump_Height and need that change to happen immediately.

With that in mind, here's how you should design the triggers:

First the Start trigger sets all of your important variables and gets things started. This means resetting old data and calculating new data:
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Jump_Caster = (Triggering unit)
      • Set Jump_Target = (Target unit of ability being cast)
      • -------- ------------ --------
      • Set Jump_Caster_Start = (Position of Jump_Caster)
      • Set Jump_Target_Start = (Position of Jump_Target)
      • Set Jump_Angle = (Angle from Jump_Caster_Start to Jump_Target_Start)
      • Set Jump_Distance = 0.01
      • -------- ------------ --------
      • Unit - Add Storm Crow Form to Jump_Caster
      • Unit - Add Storm Crow Form to Jump_Target
      • Unit - Remove Storm Crow Form from Jump_Caster
      • Unit - Remove Storm Crow Form from Jump_Target
      • Set Jump_Height = 0.00
      • Animation - Change Jump_Caster flying height to 0.00 at 0.00
      • Animation - Change Jump_Target flying height to 0.00 at 0.00
      • -------- ------------ --------
      • Trigger - Turn on Run <gen>
Then the Run trigger periodically uses this information to create the Jump effect:
  • Run
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set Jump_Distance = (Jump_Distance + 4.00)
      • -------- ------------ --------
      • Set TempPoint = (Jump_Caster_Start offset by Jump_Distance towards Jump_Angle degrees)
      • Unit - Move Jump_Caster instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- ------------ --------
      • Set TempPoint = (Jump_Target_Start offset by Jump_Distance towards Jump_Angle degrees)
      • Unit - Move Jump_Target instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- ------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Jump_Distance Less than or equal to 200.00
        • Then - Actions
          • Set Jump_Height = (Jump_Height + 5.00)
        • Else - Actions
          • Set Jump_Height = (Jump_Height - 5.00)
      • Animation - Change Jump_Caster flying height to Jump_Height at 0.00
      • Animation - Change Jump_Target flying height to Jump_Height at 0.00
      • -------- ------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Jump_Distance Greater than or equal to 400.00
        • Then - Actions
          • Custom script: call RemoveLocation(udg_Jump_Caster_Start)
          • Custom script: call RemoveLocation(udg_Jump_Target_Start)
          • Animation - Change Jump_Caster flying height to 0.00 at 0.00
          • Animation - Change Jump_Target flying height to 0.00 at 0.00
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Back
Top