Tutorial Realistic Bullet & Jump

I

IKilledKEnny

Guest
Realistic Bullet & Jump
~By IKilledKEnny~​


In this tutorial I’ll try to teach you how to create a realistic effect of bullets and jumps . A lot of people asked for those triggers before and I thought it might be useful to post them. As always I know people would ask me why this is isn’t free trigger code. Well move it if you want it there, but instead of just giving the code I explain everything as well as posting different variations and such.

If after reading this tutorial you are under the impression that this should be moved to free trigger code forums ask an admin to do that, one way or another, I don’t mind.

Please comment about this tutorial, I love to hear positive and negative comments. But one thing I do ask is that you won’t be too aggressive, if you do not like the tutorial please say so in a calmed way we like to keep things cheerful in the forums. :)

Please Note: This tutorial is slightly more advanced then other tutorials I made, it’s still pretty simple and I will explain everything, I suggest that newer users won’t read it just yet, get a Trigger experience before continuing. Also I’m using dictionary and ‘Word’ but note that English is second language to me.

Now, before we start talking about the Triggers themselves we need to know a very important equation.

V = The Speed of an object moving which doesn’t change its movement speed.
T = The time the object have moved on speed equal to V.
S = How much the object have walked.

Code:
V * T = S
S / T = V
S / V = T

We could build an triangle which would look like this:



Note: For all that know something about physics it’s the exact same triangle to figure out density (/crowdedness?).

Code:
M = S
V = Ro 
T = V (Volume).
Now if we know 2 values (for example we know what S and T is) we can always figure out the third one using those equations.

Let’s move on then, before I bore you to death.

I read this tutorial 3 times and didn’t find mistakes, let me know if you find some though!!

Jump

Note Before Reading: While I designed this jump system alone (excuse me if there is a similar one already) the first 2 that helped me understand jumping spells are; Mythic Fr0st and Chocobo. Thank you. :)

So, let’s start with how can jump help us? Well what it does actually is making the unit raise above the ground, what will make it just like it jumps or flies. Now you can edit fling height in the Object Editor, however the only way you can edit this value is with the Triggers I’ll post below. Now let’s start with the most basic spell, which will cause was simply to make a unit raise above the ground.

Code:
 Actions
    Unit - Add Crow Form to (Triggering unit)
    Animation - Change (Triggering unit) flying height to 270.00 at 135.00
    Unit - Remove Crow Form from (Triggering unit)

I know this have been posted at the very least a 100 times, but another time can’t hurt! Anyway what we do first is to add to our unit (in our case Triggering Unit) the ability Crow Form. Crow Form allows us (the mappers) to change unit flying height, without that we couldn’t have done it if the unit wasn’t a flying. Crow Form can be found in Unit Abilities . Now the first integer in the second action will determine to what height our unit will each. In this case 270 (3 * Footman’s attack range). The second integer is how much it will go up every second , thus 270 / 135 = 2! So our unit will reach the height of 270 over 2 seconds. After we did that we remove Crow Form.

Now this was a very basic spell to make unit look like it goes up. The most important actions in this Trigger are the first and last ones, in every jumping trigger we will use this, if we don’t unit’s flying height will not be editable .

Now say we want to get the unit back to it’s original flying height. We’ll do this:

Code:
 Animation - Change (Triggering unit) flying height to 0.00 at 200.00

0 Is the unit’s default flying height. If you want to get the unit to the ground, even if at the start of the game it’s above / below ground you need to set it’s flying height to this:

Code:
 0 – Unit’s Default Flying Height
(If it’s below ground it will be positive, if above negative, and if it’s exactly on the ground, it’ll be 0.)

So now we know how to get units up and down, that’s good enough, for now. The real challenge is to make the units move while jumping, thus making it like they jumped say forward. But first few bonuses!

To climb a ladder we do this:
Code:
 Untitled Trigger 001
    Events
        Unit - A unit comes within 50.00 of No unit
    Conditions
    Actions
        Unit - Add Crow Form to (Triggering unit)
        Animation - Change (Triggering unit) flying height to 200.00 at 150.00
        Unit - Remove Crow Form from (Triggering unit)
        Set PointVariable = ((Position of (Triggering unit)) offset by 50.00 towards (Facing of No unit) degrees)
        Custom script:   call RemoveLocation(udg_PointVariable)

Replace No unit with your ladder unit. Make the ladder face the wished angle at the start of the game. We move the unit forward so it will look like it climb the ladder, and now it gets off it (by moving forward).

Make Unit Jump for the Whole Game:
Code:
 Actions
    For each (Integer A) from 1 to 11000000000, do (Actions)
        Loop - Actions
            For each (Integer B) from 1 to 1000000000, do (Actions)
                Loop - Actions
                    Unit - Add Crow Form to (Triggering unit)
                    Animation - Change (Triggering unit) flying height to 200.00 at 150.00
                    Unit - Remove Crow Form from (Triggering unit)
                    Wait (200.00 / 150.00) seconds
                     Unit - Add Crow Form to (Triggering unit)
                    Animation - Change (Triggering unit) flying height to 0.00 at 200.00
                    Unit - Remove Crow Form from (Triggering unit)
                    Wait 1.00 seconds

This will cause the unit to jump 10000000000000000000 times over 13400000000000000000 seconds, which is 37222222222222222.2 hours. If your game would take longer then this, I suggest you remake it…. Now the only thing we need to go over is the waits.

Now this loop would cursh computers, you need to make it waaaaay smaller, this was just an example. Making a loop that would last 2 hours would be more then enough. You could do 2 hours by reducing the the size of the loop, or adding a time event (every 3 minutes do this loop, or somthing like that.)
Now we’ll use the T,V,S equation for the first time. We now our way is 200 (sense we jumped 200) and we know we move at speed equal to 150. T = S / V = 200 / 150 (=1.333…). I could just wrote 1.34, but just wanted to show what you need to calculate. Now the next wait is 200 / 200, you don’t need to be a genius to figure that out. Again you could edit the wait time (use calculator!).

Attack based on ground level:
Code:
 Untitled Trigger 002
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Unit - Cause (Attacking unit) to damage (Attacked unit), dealing ((Current flying height of (Attacking unit)) - (Current flying height of (Attacked unit))) / 10 damage of attack type Normal and damage type Normal

You don’t need that / 10 at the end, but it simply makes it more balanced.

You can do other things with editing flying height, but let’s keep moving.

Unit Jump – There are countless ways to make units jump, let’s pick one, which will hopefully help you with other jump trigger. Let’s say we want to make a jump that will take 2.5 seconds, and the bigger your run speed is, the more you’ll jump. Again this is only one out of many examples.

Code:
 Actions
    Set UnitVariable = (Triggering unit)
    Set PointVariable = ((Position of UnitVariable) offset by (2.50 x (Current movement speed of UnitVariable)) towards (Facing of UnitVariable) degrees)
    Animation - Change UnitVariable's animation speed to 0.00% of its original speed
    Unit - Add Crow Form to UnitVariable 
    Unit - Order UnitVariable to Move To PointVariable
    Animation - Change (Triggering unit) flying height to 350.00 at (2.50 x ((Current movement speed of UnitVariable) / 2.00))
    Wait (2.50 / 2.00) seconds
    Animation - Change (Triggering unit) flying height to 0.00 at (2.50 x ((Current movement speed of UnitVariable) / 2.00))
    Unit - Remove Crow Form from UnitVariable
    Custom script:   call RemoveLocation(udg_PointVariable)

First of all we set UnitVariable to a certain unit so we could use it after the wait. Now we set a point variable to position of unit + 2.5 (our time) X Speed of Unit Variable (or speed, thus we got V and T so we know S) and then we make it a facing UnitVariable degrees.
Now we set animation speed to 0% to make it look like jumping and not walking in the air. Now we add crow form (as usual) and we order the unit to move to PointVairable. Now set the flying height to a certain height (350) in a rate that is half of S (thus 2.5 X unit’s V / 2) so when the unit reaches the middle of its way it will start coming back down. Notice! This time we know S and V, but we don’t know T! That’s what we need to get in this line! Now because we know it’ll take him 2.5 / 2 seconds to reach that height we wait the same time and then after that we make the unit start going down, again at the same rate. This should work like a charm.

Yes, this is very hard, I tried to explain it the best way I can with my lousy English. Please do ask questions about this if you don’t understand something.

Now I’ll try to show you another jump trigger.

In the next one I’ll make it look like I throw a grenade (I actually use this trigger (with slight changes of course) in my map). Now just to make it clear, we must always use units and we talk about jumping, so just create a unit that will look like grenade (I used dark green thunder lizard egg) and make it Locust and disable it’s attacks. Now of course we don’t throw a grenade from the ground, we throw from our hand, so let’s set it’s height to 65 (remember this! Its very important!) Now in this case we know S, T and V, so that’s not the problem, what’s harder in this Trigger it to make the grenade explode at the moment it reaches the ground. Now you might want to make grenades movement speed editable during the game for whatever reasons. Note my grenade’s speed is 312, change the needed balues if you want to make it faster / slower.

Note: Because I’m using GUI there are certain limits.
1. You need to figure out a way to make players not be able use Grenade ability for number of seconds, or it will mess up the whole thing.
2. Unless you want to get in annoying complicated stuff, this spell is not mui each player may only control 1 unit that will be able to cast that spell.

If you have basic knowledge at JASS (something I getting close to :p) I believe you can change few things to get off those limits of.

Code:
   UnitVariable1 = (Casting Unit)
   PointVariable1 = (Position of UnitVariable1)
   Unit - Create 1 Grenade - for (Owner of UnitVariable1) at PointVariable1 facing (Facing of UnitVariable1) degrees
   Set UnitVariable2[(Player number of (Owner of UnitVariable1))] = (Last created unit)
   Animation - Change UnitVariable2[(Player number of (Owner of  UnitVariable1))]'s animation speed to 0.00% of its original speed [b] // Again just to make things look better [/b]   
   Set PointVariable2 = (UnitVariable1 offset by (500) towards (Facing of UnitVariable2[[(Player number of (Owner of  UnitVariable1))] degrees)
   Unit - Order UnitVariable2[(Player number of (Owner of UnitVariable2))] to Move To PointVariable2
   Unit - Add Crow Form to UnitVariable2[(Player number of (Owner of UnitVariable1
))]
   Animation - Change UnitVariable2[(Player number of (Owner of UnitVariable1))] flying height to 200.00 at 250.00
   Wait 0.8 seconds
   Animation - Change GrenadeUnit[(Player number of (Owner of GrenadeCastingUnit))] flying height to -65.00 at 331.25
   Wait 0.8 seconds
   Unit - Remove Crow Form from UnitVariable2[(Player number of (Owner of UnitVariable1))]

<<Rest of Acions>> // Don’t forget to destroy points! i.e. call Remove blah blah

Now this is complicated indeed, but if you handled the first example you should be able to handle this as well. We get caster unit as a variable again, and we get it’s point. Then we create grenade unit in it, and just to make Trigger look better remove it’s animations. Now we get our wished point in another point variable. The point is 500 from the caster facing it’s angle. And now we order our grenade to get to it. We add Crow Form and we make it get to 200 height at 250 speed and then we wait 0.8 (200 / 250 = 0.8) seconds, now we want to make the grenade starting going down again. Here we face a problem, in order to get it to the ground we need to set it’s height to -65, and we are already at 200, so we are increasing the speed for it to get down by using T,V and S (again :) ) we wait 0.8 seconds once again and we do the rest of the actions..

That’s it with Jumping triggers, let’s move on to making a realistic bullet!

Bullet

Note Before Reading: Again, I need to thank someone, I did the system alone, but Sunny_D, did help me with one of the lines. Thank you man!

So in this chapter I’ll talk about making a realistic bullet Trigger. We will destroy it after a while, make it die when it reaches doodads and units, and most importantly, we’ll cause it to deal damage :)

So first of all the bullet should be a unit (I again use Thunder Lizard Egg, made it much smaller and colored it to grey color, that should be ok, except of the glowing red stuff :p )

Now I’ll post a trigger which Allows MUI and one that doesn’t. The one that doesn’t simply takes so much less space. Now note the my bullet speed is 250.

You need to follow the same unit creating rules as we did with grenade. Locust, color it nicely and most importantly, make sure you know it’s movement speed!

Just as a side note: I use this Trigger too in my map. :)

Code:
 Create Bullet
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Shoot 
    Actions
        Set PointVariable1 = (Position of (Casting unit))
        Unit - Create 1 Bullet for (Owner of (Casting unit)) at PointVariable1 facing (Facing of (Casting unit)) degrees
        Animation - Change (Last created unit)'s animation speed to 0.00% of its original speed
        Set PointVariable2 = (PointVariable1 offset by 750.00 towards (Facing of (Last created unit)) degrees)
        Unit - Order (Last created unit) to Move To PointVariable2
        Unit - Turn collision for (Last created unit) Off
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_PointVariable1)
        Custom script:   call RemoveLocation(udg_PointVariable2)

In this trigger we use it when we cast a spell, now if the spell is shoot then we may proceed. We set PointVariable1 to the casting unit position. Now we create a bullet for that player at his casting unit position (PointVariable1) and we make it face the casting’s unit face. Now again we set animation speed to 0. Now we get another point variable which is offset of 750 towards last created unit facing (that’s our bullet’s facing!). We order our bullet to move to that point and we turn of it’s collision (makes things better if you have tons of bulletst.) And then we add a 3.00 timer to the unit, we don’t want it to last for ever!

As you might noticed this is pretty similar to jumping, we get similar points, equations, units and such. Now let’s move on to our next Trigger, be prepared to a much longer Trigger!

Code:
 Kill Bullet
    Events
        Time - Every 0.20 seconds of game time
    Conditions
    Actions
        Set UnitGroupVariable1 = (Units of type Bullet)
        Unit Group - Pick every unit in UnitGroupVariable1 and do (Actions)
            Loop - Actions
                Set PointVariable1 = (Position of (Picked unit))
                Set UnitGroupVariable2 = (Units within 55.00 of PointVariable1s)
[b]                Set PointVariable2 = (Position of Heros[(Player number of (Owner of (Picked unit)))]) [/b]
                Set UnitVariable = (Picked unit)
                Unit Group - Pick every unit in UnitGroupVariable2 and do (Actions)
                    Loop - Actions
                        Set PointVariable3 = (Position of (Picked unit))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Abs(((Angle from PointVariable2 to PointVariable3) - (Angle from PointVariable2 to PointVariable1)))) Less than or equal to 20.00 // Sunny_D’s Work!
                            Then - Actions
                                   Unit - Cause UnitVariable to damage (Picked unit), dealing (Random real number between 25.00 and 45.00) damage of attack type Normal and damage type Normal                                        
                                   Unit - Remove UnitVariable1 from the game
                                   Custom script:   call RemoveLocation(udg_PointVariable1)
                                   Custom script:   call RemoveLocation(udg_PointVariable2)
                                   Custom script:   call RemoveLocation(udg_PointVariable3)
                                   Custom script:   call DestroyGroup(udg_UnitGroupVariable2)

                            Else - Actions
         Custom script:   call DestroyGroup(udg_UnitGroupVariable1)

About the line I marked as Sunny_D’s, to be honest I’m not 100% sure what it does (I do have a general idea though) so excuse me about not explaining it properly. Also notice I bolded a line, I’ll explain this in a second.

Now, first of all we get all units of type bullet and we get their position in a variable, and then we get all units which are in range of 55 of them. We choose 55, because it’s .2 X 250 + 5 (just to be sure there no little problems :) ). Now in the bolded line we get the position of the caster. Now in most AoS maps we get player’s unit in Heros (unit) variable with array equal to max number of players. If you want to make this MUI we’ll replace this line with something completely else. For now just take this as any other line. Now we get our picked unit in unit variable. You remembered we defined UnitGroupVariable2 just few lines ago? Now we use it and we pick every unit in it. We use yet another point variable we get with this one our new picked unit’s position.

Now is Sunny_D’s line. Abs is the total distance total distance in the number of numbers we need to skip to get to 0 from our number so abs –y = abs y. Let me explain this more properly. Say we get 50 and -50. You agree with me we need to jump over 50 numbers to get from 50 to 0? Now do you agree with me that we need to jump 50 numbers from -50 to 0? Thus abs 50 = abs -50!

So now we’ll get positive number, even if it’s originally was negative one. Now comes the part that I’m not sure about. Angle between PointVariable2 and PointVariable3 – angle between PointVariable2 and PointVariable1. I’m not sure how, anyway we get the angle between PointVariable1 and PointVariable3. From this part I finished the line alone: Now if this is equal to 20 (remember abs so even if it was -20 it’s 20 now!) then we may continue. I chose 20 because it show that the unit is about in front of our bullet, but it’s flexible, lol I guess none of the players could shoot so well. :) Now if this condition is true we remove our bullet and make it deal the picked unit a certain damage.

Now if you want it to work with doodads as well instead of using copy thw whole actions and change only this:

Code:
 Destructible - Pick every destructible within 110.00 of (PointVariable1) and do (Actions)
Loop – Actions 
<<Our Actions>>

No need to note that you need to use picked destructible and not picked unit, huh? (and replace position of unit to position of destructible!)

That’s it for this bullet, let’s move on to MUI bullet.

Ok one note: Lots of spell need Custom Values to make things work. I need too. :p thus units / heros that can use it can’t have spells that effect custom value!!

Ok first you need to know what types of units could use this ability, say Shooters can use it ok? Now create a 2 unit variables with an array equal 1000. We use such a big number just to make sure that there won’t be more unit that can use shoot then the array’s size.

Now, you need to add 2 more Triggers and few lines to our old Triggers.

Code:
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        (Unit-type of (Entering unit)) Equal to Shooter
    Actions
        Unit - Set the custom value of (Entering unit) to (Number of units in (Units of type Shooter))
        Set UnitVariableHugeArray1[(Custom value of (Entering unit))] = (Entering unit)

Here we get the number of units that can cast shot and then we set it to the custom value of out unit, as well as setting him into a unit variable with an array equal to his custom value.

Now you might want to change the vents but this is basically the Trigger, now to the second Trigger.

Code:
 Untitled Trigger 002
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to Shooter
    Actions
        Set UnitGroupVariable = (Units in (Entire map) matching ((((Unit-type of (Matching unit)) Equal to Bullet) or ((Unit-type of (Matching unit)) Equal to Shooter)) and ((Custom value of (Matching unit)) Greater than (Custom value of (Dying unit)))))
        Unit Group - Pick every unit in UnitGroupVariable and do (Actions)
            Loop - Actions
                Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)- 1)))

                Set UnitVariableHugeArray1[(Custom value of (Picked unit))] = (Picked unit)
         Call DestroyGroup(udg_UnitGroupVariable)

This will simply change custom values of all units needed when shooter dies. Now I will bold the changed / added lines in the Triggers.

Code:
 Create Bullet
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Shoot 
    Actions
        Set PointVariable1 = (Position of (Casting unit))
        Unit - Create 1 Bullet for (Owner of (Casting unit)) at PointVariable1 facing (Facing of (Casting unit)) degrees
      [b]  Set UnitVariableHugeArray2[(Custom value of (Casting unit))] = (Last Created unit) 
        Unit - Set the custom value of (Last created unit) to (Custom value of (Casting unit)) [/b]
        Animation - Change (Last created unit)'s animation speed to 0.00% of its original speed
        Set PointVariable2 = (PointVariable1 offset by 750.00 towards (Facing of (Last created unit)) degrees)
        Unit - Order (Last created unit) to Move To PointVariable2
        Unit - Turn collision for (Last created unit) Off
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_PointVariable1)
        Custom script:   call RemoveLocation(udg_PointVariable2)

Now we set the bullet to a variable equal to casting unit custom value, and change the bullets custom value to casting unit’s value as well. Now let’s move on to our last Trigger in this chapter!

Code:
 Kill Bullet
    Events
        Time - Every 0.20 seconds of game time
    Conditions
    Actions
           For each (Integer A) from 1 to 1000, do (Actions)
           Loop – Actions
[b]              Set PointVariable1 = (Position of UnitVariableHugeArray2[Integer A])
                Set UnitGroupVariable2 = (Units within 55.00 of PointVariable1)
                Set PointVariable2 = (Position of UnitVariableHugeArray1[Integer A]) 
                Set UnitVariable = (UnitVariableHugeArray2[Integer A]) [/b]
                Unit Group - Pick every unit in UnitGroupVariable2 and do (Actions)
                    Loop - Actions
                        Set PointVariable3 = (Position of (Picked unit))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Abs(((Angle from PointVariable2 to PointVariable3) - (Angle from PointVariable2 to PointVariable1)))) Less than or equal to 20.00 // Sunny_D’s Work!
                            Then - Actions
   Unit - Cause UnitVariable to damage (Picked unit), dealing (Random real number between 25.00 and 45.00) damage of attack type Normal and damage type Normal                                        
   Unit - Remove UnitVariable1 from the game
    Custom script:   call RemoveLocation(udg_PointVariable1)
    Custom script:   call RemoveLocation(udg_PointVariable2)
Custom script:   call RemoveLocation(udg_PointVariable3)
    Custom script:   call DestroyGroup(udg_UnitGroupVariable2)

                            Else - Actions

Alright, now instead of unit pick every unit in unit type of bullet, we choose each integer between 1 and 1,000. Now instead of picked unit we simply use UnitVariableHugeArray2[Integer A], and instead of Heros we use UnitVariableHugeArray1[Integer A], a part from that we are not doing anything else.

Anti-Rocket

Let’s say we want to destroy a missile (which is a unit of course, for example our bullet). What we’ll need to do is to create a unit which will serve as the Anti-Rocket/Missile/Bullet. Now make its missile speed to something high (1000+) Now first of all do this Trigger:

Code:
    Events
        Unit - A unit Finishes construction
    Conditions
        (Unit-type of (Constructed structure)) Equal to Anti-Rocket
    Actions
        Trigger - Add to Get Bullets Down <gen> the event (Unit - A unit comes within 900.00 of (Constructed structure))

Here was add an event that a unit becomes 900 range from our anti-rocket. Now let’s check the main Trigger:

Code:
 Get Bullets Down
Events
<<We added Events from Previous Trigger!!!>>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Bullet
    Actions
        Set UnitVariable1 = (Triggering unit)
        Unit - Pause UnitVariable1
        Set PointVariable1 = (Position of (UnitVariable1))
        Unit - Create 1 Dummy for Neutral Passive at GrenadeCaster facing Default building facing degrees
        Set UnitVariable2 = (Last created unit)
        Set UnitGroupVariable1 = (Units of type Anti-Rocket)
        Unit Group - Pick every unit in UnitGroupVariable1 and do (Actions)
            Loop - Actions
                Set PointVariable2 = (Position of (Picked unit))
                Set UnitGroupVariable2 = (Units within 1800.00 of Picked Unit matching ((Unit-type of (Matching unit)) Equal to Bullet))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in UnitVariable2) Equal to 1
                    Then - Actions
                        Unit - Order (Picked unit) to Attack UnitVariable2
                        Wait ((Distance between PointVariable1 and PointVariable2) / <<1.00>>) seconds
                        Unit - Remove UnitVariable1 from the game
                        Unit - Remove UnitVariable2 from the game 
                        Wait ((Distance between PointVariable1 and PointVariable2) / <<1.00>>) seconds
                        Custom script:   call RemoveLocation(udg_PointVariable2) 
                        Custom script:   call DestroyGroup(udg_UnitGroupVariable2)
                    Else – Actions
       Custom script:   call DestroyGroup(udg_UnitGroupVariable1)
       Custom script:   call RemoveLocation(udg_PointVariable1)

Alright this is our last Trigger (for this tutorial), so let’s get over with it quickly, huh? ;-) I know it was a long hard 1. So first of all remember we added events to Get Bullets Down, that’s why we don’t have pre-placed events. Now Triggering unit is the unit that became in range of whatever. So we check if that triggering unit is a bullet (if you have few missile types just put an or condition and put them all there), if it is we store the Triggering unit in a variable and we pause it. Then we get the position of our triggering unit and we create there a new unit (so it’ll be our attack point, we can’t attack locust unit!) (That dummy shouldn’t have Locust but it should be invisible).

Now we face a problem, we don’t know what unit is the unit that our triggering unit was nearing, so we have to check it. We get all units of type Anti-Rocket, now we check if there are any bullets in 1800 range (900 X 2), there should be only one unit like that, so we choose it and order it to attack PointVariable2. Now we wait the distance between our 2 point variables divided by the missile (Anti-Rocket’s missile!) speed and then we remove both our unit variables.

Well that’s it, if you understood everything you should be proud of yourself, really, this is some hard stuff!! I’m always happy to hear questions and comments here or by sending me a private massage.
 

Hero

─║╣ero─
Reaction score
250
That jump looks like a problem to me...idk I rather stick to jass...it makes jumping so much easier...and emjlr3 made a template for it
 

nate

New Member
Reaction score
3
Woah! At start I thought I won't understand anything but I understood few things.... Very few things... Anyway you get +REP for me, I'm sure it's helpful for people that are better at me in WE! :cool: :rolleyes: :eek:
 
I

IKilledKEnny

Guest
The jump loop.

Well of course this one is too heavy, I jus gave an example, just edit it to slowe numbers and it should work (make the unit jump for 2 hours would be more then enough for most games)
 

substance

New Member
Reaction score
34
good timing, i just came on the forums to find a bullet spell too ;]

I'll test it and edit this post
 
I

IKilledKEnny

Guest
Editted, I posted under the loop that it's way to be and it's size need to reduced.
 

Jazradel

Helping people do more by doing less.
Reaction score
102
You might want to look up parabolas, to get the way things actually jump in real life.
 

elmstfreddie

The Finglonger
Reaction score
203
Sigh, got bored reading. Found 1 mistake though for how far I got...

You misspelled "heroes", on an array variable in one of your codes (first/second bullet code)
 
I

IKilledKEnny

Guest
Bump.

Worked a lot on this, any addiotional comments would be appreciated. :)
 
I

IKilledKEnny

Guest
Just change it's model and it should work perfectly. :) You might want to add a little jump trigger so it would look a little more realistic.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top