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

GUI Bullet/Arc Missile System v1.02

Well, this is Missile system WITH Arc that check Z axis changes and height between start and end points, that fix bug with hiting units from height or hiting units on height. Missiles dont repeat ground scales. It have traectory of triangle combined with arc. Distance is hypotinuse length. Some people may not understand how it calculates, because here need some knowlage of SINE COSINE HYPOTINUSE calculation.

153758-albums2624-picture29141.jpg


Story: long time ago I played Elimination Tournament. When I saw bullet traectory... shock... "how this guys do this?". About mounth ago I made something like this. This system meaby is a parody. But it is GUI and not JASS (I think creators of ET did it with JASS). If people have played ET or ET2 and they saw water that used theare, they know what it is model of platform with moving water texture. Why model and not warcraft water? Well, missile do some wierd things, it dont fly under water and suport water horizontaly. That is why they used model of water simulation.

Correct me if I am wrong. Have fun with system and dont be lazy to give credits.
  • BS Setings
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shot!
    • Actions
      • Custom script: local real Hyp
      • Custom script: local real SINE
      • Custom script: local real COSINE
      • Custom script: local real End_Z
      • Custom script: local real Distance
      • Custom script: local real Height
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BS_Skip Equal to 0
        • Then - Actions
          • Trigger - Turn on BS Loop <gen>
        • Else - Actions
      • Set BS_Point[0] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to No unit
        • Then - Actions
          • Set BS_Point[1] = (Target point of ability being cast)
        • Else - Actions
          • Set BS_Point[1] = (Position of (Target unit of ability being cast))
      • Set BS_Point[2] = (BS_Point[0] offset by 70.00 towards (Angle from BS_Point[0] to BS_Point[1]) degrees)
      • Set BS_MissileCount = 1
      • For each (Integer BS_MC) from 1 to BS_MissileCount, do (Actions)
        • Loop - Actions
          • Set BS_Skip = (BS_Skip + 1)
          • Set BS_Times = (BS_Times + 1)
          • Set BS_On[BS_Times] = True
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_Hero[BS_Times] = (Triggering unit)
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_Angle[BS_Times] = (Angle from BS_Point[0] to BS_Point[1])
          • Set BS_MaxDistance[BS_Times] = (Distance between BS_Point[2] and BS_Point[1])
          • Set BS_Distance[BS_Times] = BS_MaxDistance[BS_Times]
          • Set BS_Height[BS_Times] = 200.00
          • Set BS_Level[BS_Times] = (Level of Shot! for (Triggering unit))
          • Set BS_Damage[BS_Times] = (50.00 + (50.00 x (Real(BS_Level[BS_Times]))))
          • Set BS_Range[BS_Times] = 1500.00
          • Set BS_Colision[BS_Times] = 75.00
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Change 60 to unit "height" (not flying) to make caster aim in head. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Custom script: set udg_BS_StartZ[udg_BS_Times] = GetLocationZ(udg_BS_Point[0]) + 55
          • Custom script: set End_Z = GetLocationZ(udg_BS_Point[1]) + GetUnitFlyHeight(GetSpellTargetUnit())
          • Custom script: set Distance = DistanceBetweenPoints(udg_BS_Point[2],udg_BS_Point[1])
          • Custom script: if udg_BS_StartZ[udg_BS_Times] >= End_Z then
          • Custom script: set udg_BS_Up[udg_BS_Times] = false
          • Custom script: set End_Z = ( End_Z + GetRandomReal(40.00, 85.00) )
          • Custom script: set Height = ( udg_BS_StartZ[udg_BS_Times] - End_Z )
          • Custom script: else
          • Custom script: set udg_BS_Up[udg_BS_Times] = true
          • Custom script: set End_Z = ( End_Z + GetRandomReal(60.00, 85.00) )
          • Custom script: set Height = ( End_Z - udg_BS_StartZ[udg_BS_Times] )
          • Custom script: endif
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Lets check if missile fly up or down. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Custom script: set Hyp = SquareRoot(( ( Distance * Distance ) + ( Height * Height ) ))
          • Custom script: set SINE = ( Distance / Hyp )
          • Custom script: set COSINE = ( Height / Hyp )
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- HYPSpeed is hypotinuse movement per time interval. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Custom script: set udg_BS_HYPSpeed[udg_BS_Times] = Hyp * 0.03
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Because we know hypotinuse speed, SINE, COSINE, calculation of Height Speed and distance speed will calculate now. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Custom script: set udg_BS_Speed[udg_BS_Times] = ( udg_BS_HYPSpeed[udg_BS_Times] * SINE )
          • Custom script: set udg_BS_SpeedZ[udg_BS_Times] = ( udg_BS_HYPSpeed[udg_BS_Times] * COSINE )
          • Unit - Create 1 Bullet for (Owner of BS_Hero[BS_Times]) at BS_Point[2] facing BS_Angle[BS_Times] degrees
          • Set BS_Missile[BS_Times] = (Last created unit)
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- In Object Data dummy unit have no movement type. Like that it will not change height when get close to trees and nautrial buildings. --------
          • -------- But it must to change height. Adding and Removing Storm Crown ability will help. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Unit - Add Storm Crow Form to (Last created unit)
          • Unit - Remove Storm Crow Form from (Last created unit)
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Cleaning leaks --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Custom script: call RemoveLocation ( udg_BS_Point[0] )
      • Custom script: call RemoveLocation ( udg_BS_Point[1] )
      • Custom script: call RemoveLocation ( udg_BS_Point[2] )
  • BS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer BS) from 1 to BS_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BS_On[BS] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BS_Range[BS] Less than or equal to 0.00
                • Then - Actions
                  • Unit - Kill BS_Missile[BS]
                  • Set BS_On[BS] = False
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Starting Recycling Indexes --------
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BS Less than BS_Times
                    • Then - Actions
                      • Set BS_On[BS] = BS_On[BS_Times]
                      • Set BS_Missile[BS] = BS_Missile[BS_Times]
                      • Set BS_Hero[BS] = BS_Hero[BS_Times]
                      • Set BS_Range[BS] = BS_Range[BS_Times]
                      • Set BS_Speed[BS] = BS_Speed[BS_Times]
                      • Set BS_HYPSpeed[BS] = BS_HYPSpeed[BS_Times]
                      • Set BS_SpeedZ[BS] = BS_SpeedZ[BS_Times]
                      • Set BS_StartZ[BS] = BS_StartZ[BS_Times]
                      • Set BS_Parabola[BS] = BS_Parabola[BS_Times]
                      • Set BS_Height[BS] = BS_Height[BS_Times]
                      • Set BS_Distance[BS] = BS_Distance[BS_Times]
                      • Set BS_MaxDistance[BS] = BS_MaxDistance[BS_Times]
                      • Set BS_Damage[BS] = BS_Damage[BS_Times]
                      • Set BS_Angle[BS] = BS_Angle[BS_Times]
                      • Set BS_Colision[BS] = BS_Colision[BS_Times]
                      • Set BS_Level[BS] = BS_Level[BS_Times]
                      • Set BS_Up[BS] = BS_Up[BS_Times]
                    • Else - Actions
                  • Set BS = (BS - 1)
                  • Set BS_Times = (BS_Times - 1)
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- End of Recycling Indexes --------
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set BS_Skip = (BS_Skip - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BS_Skip Equal to 0
                    • Then - Actions
                      • Set BS_Times = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Set BS_Point[3] = (Position of BS_Missile[BS])
                  • Set BS_Point[4] = (BS_Point[3] offset by BS_Speed[BS] towards BS_Angle[BS] degrees)
                  • Unit - Move BS_Missile[BS] instantly to BS_Point[4]
                  • Set BS_Distance[BS] = (BS_Distance[BS] - BS_Speed[BS])
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- If missile comes to black areas around map, than range seted to zero. --------
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Playable map area) contains BS_Point[4]) Equal to False
                    • Then - Actions
                      • Set BS_Range[BS] = 0.00
                    • Else - Actions
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Missile traveled some range. Lets set remaining range. --------
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • Set BS_Range[BS] = (BS_Range[BS] - BS_HYPSpeed[BS])
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Need to check height of point where missile traveled to calculate debug height and make missile movement "real" --------
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • Custom script: set udg_BS_DebugZ[udg_BS] = GetLocationZ(udg_BS_Point[4])
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Height of missile will change at diferent way when it fly up/down. --------
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BS_Up[BS] Equal to False
                        • Then - Actions
                          • Set BS_StartZ[BS] = (BS_StartZ[BS] - BS_SpeedZ[BS])
                        • Else - Actions
                          • Set BS_StartZ[BS] = (BS_StartZ[BS] + BS_SpeedZ[BS])
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Calculation of height that missile must have. --------
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • Set BS_Parabola[BS] = (((4.00 x BS_Height[BS]) / BS_MaxDistance[BS]) x ((BS_MaxDistance[BS] - BS_Distance[BS]) x (BS_Distance[BS] / BS_MaxDistance[BS])))
                      • Set BS_Debug[BS] = ((BS_StartZ[BS] - BS_DebugZ[BS]) + BS_Parabola[BS])
                      • Custom script: call SetUnitFlyHeight( udg_BS_Missile[udg_BS], udg_BS_Debug[udg_BS], 0.00 )
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Missile flying height is zero and it hit the ground. --------
                      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BS_Debug[BS] Less than or equal to 0.00
                        • Then - Actions
                          • Set BS_Range[BS] = 0.00
                        • Else - Actions
                          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- Not zero yet? Pick units to damage someone. --------
                          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • Set BS_Group[BS] = (Units within BS_Colision[BS] of BS_Point[4] matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)) and (((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is dead) Equal to Fa
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in BS_Group[BS]) Greater than 0
                            • Then - Actions
                              • Unit Group - Pick every unit in (Random 1 units from BS_Group[BS]) and do (Actions)
                                • Loop - Actions
                                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- I have seted height of unit to 85. It Must be diferent for units of diferent type. --------
                                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ((Picked unit) is A flying unit) Equal to True
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • BS_Debug[BS] Less than or equal to ((Current flying height of (Picked unit)) + 50.00)
                                          • BS_Debug[BS] Greater than or equal to (Current flying height of (Picked unit))
                                        • Then - Actions
                                          • Set BS_Range[BS] = 0.00
                                          • Unit - Cause BS_Hero[BS] to damage (Picked unit), dealing BS_Damage[BS] damage of attack type Spells and damage type Normal
                                        • Else - Actions
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • And - All (Conditions) are true
                                            • Conditions
                                              • BS_Debug[BS] Less than or equal to 85.00
                                        • Then - Actions
                                          • Set BS_Range[BS] = 0.00
                                          • Unit - Cause BS_Hero[BS] to damage (Picked unit), dealing BS_Damage[BS] damage of attack type Spells and damage type Normal
                                        • Else - Actions
                            • Else - Actions
                          • Custom script: call DestroyGroup ( udg_BS_Group[udg_BS] )
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Kill leaks. --------
                  • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Custom script: call RemoveLocation ( udg_BS_Point[3] )
                  • Custom script: call RemoveLocation ( udg_BS_Point[4] )
            • Else - Actions
-Recycling added to better system performance
-Added arc traectory as well.


NOTE: System works now as bullet spell and Impact grenade spell.
To make it bullet like, change BS_Height to 0 in Setings and set HYPSpeed to number instead of Hypotinuse * 0.03 (it is calculation of speed to make flow of arc nicer. Change 0.03 to other number to make it faster of slower. Care with it.).

Keywords:
Missile, System, Bullet, Arc, Real, Smart, Hypotinuse, Sine, Cosine, Grenade, Impact
Contents

NFWar's Missile system v1.02 (Map)

Reviews
14:59, 6th Feb 2010 The_Reborn_Devil: Seems fair enough, but maybe add support for collision with trees and buildings? The triggers look ok too. Status: Approved Rating: Useful
how come i cant target air units in (1.01 jass upgrade), i tryed to fix that with (targets alowed: air, but this didnt seem to change eny thing)

im attempting to build a bow and arrow and the old one was better in the aspect of the more extreme ark and halariously accruate flying sheep kills, what do you change to increase ark? (i suck at triggering so ... yea)
You can easy make it to work like old one. Just set height to zero. Ifthis is not what you need, tell me a reason to post old version.

this just confused me more as i am not sure which value ''height'' you refrence, in your old verson it was represented by BS_Height.... that value dosent exist in your (1.01 jass upgrade) so i cant exactly change it...
this systom still kicks ass though its so intence holy fuck, wish i could get the updated one to ark.

epic job regardless as one of my fav triggers iv seen.

8/10
 
Last edited:
Level 5
Joined
Dec 19, 2004
Messages
110
Wow I was just looking for a projectile system that works like this one!

This one is almost perfectly what I need, except for one major thing:

The missile speed is variable: it depends on how far the target is, how fast it goes. It would be more realistic if the speed is always the same, and the longer the distance, the more time it takes for the missile to fly to the target. Can you fix this? Or is this easily customizable?

===========edit============
Oh I now see your update, that's much better! The speed is constant now :)

Almost perfect for my map! Only one thing now: it looks like the projectile has unlimited range (it only stops when hitting a unit or the ground) It would be even better if it goes down after a while (due to gravity :)) like real bullets do too (or arrows - in my map). Like what you had in your first version.. Can I customize this?

And then I want to make some minor changes (like making it stop when hitting a structure or tree).. I haven't looked at the triggers yet, but it's GUI (wherefor I'm very thankful), so I can probably change the rest :)

I hope you are still active on The Hive Workshop and can reply to me about the max range :)
thnx! +rep
 
Last edited:
I have done a small update. Now you can set ArcHeight to change missile type.
Keeping this as zero will make missile a bullet. Making this number as a proportion with MaxDistance, will create an arc missile.
example: ArcHeight = MaxDistance * 0.1 OR ArcHeight = MaxDistance * 0.25
Else you will see that your missile become faster as closer you shoot.
 
Level 5
Joined
Dec 19, 2004
Messages
110
Great, I will test it tonight! thanks!

Btw, do you know how I can make the arrow missile face the right way? (in z-rotation)

Because your bullet model is round and spins, so it doesn't matter, but an arrow should fly with the point to the target and the tail coming behind the point :)
 
after 4 years you still have yet to fix the issues with targeting air units, what happened man? the original one had no problems hitting air units, sometimes it missed if they had neutral wander but that was part of the fun of aiming, no matter what I change in the trigger settings it never hits air units now. this is a pretty lame issue to have lasted this long. especially when the original was better at hitting air units.
 
Top