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

Simple Sequence Cast Help

Status
Not open for further replies.
Level 3
Joined
Jan 27, 2020
Messages
13
Im using GUI Bullet/Arc Missile System v1.02

Can you guys help me modify it so i can make it work for my main project:

- I need it to cast multiple times like a barrage in the same direction (many as i set within a variable) and with ajustable timer between shots;

- Is there a way to make it bounce back of doodads / walls (even when project is flying)?
 
Last edited:
Just change the MissileCount = 1 to how many missiles you want to spawn from the caster, and add wait at the bottom of the loop so the missiles don't spawn at the same time.

  • 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))
      • Set BS_Point[1] = (Target point 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 = 3
      • 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[1] and BS_Point[2])
          • Set BS_DistanceToTravel[BS_Times] = BS_MaxDistance[BS_Times]
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Height of Arc is a fourth of range. if you will set this to a number and not a portion of distance, then missile will fly too high --------
          • -------- at short distances and this will create a feel like it moves faster than usual. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_ArcHeight[BS_Times] = (BS_MaxDistance[BS_Times] x 0.25)
          • Set BS_Level[BS_Times] = (Level of Shot! for (Triggering unit))
          • Set BS_Damage[BS_Times] = ((Random real number between 150.00 and 200.00) + (50.00 x (Real(BS_Level[BS_Times]))))
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Change Area of Effect variable to true, if you want missile to hit multiple targets. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_AoE[BS_Times] = False
          • Set BS_AoE_Radius[BS_Times] = 150.00
          • 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])
          • 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. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_HYPSpeed[BS_Times] = 40.00
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- 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)
          • Wait 0.10 seconds
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- 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] )
Next time post questions like this in World Editor Help Zone > Triggers and Scripts, your question will just be buried here in the Requests forums because this is no place for questions.
 

Attachments

  • upload_2020-2-19_12-27-14.png
    upload_2020-2-19_12-27-14.png
    2.4 MB · Views: 15
Last edited:
Level 3
Joined
Jan 27, 2020
Messages
13
Just change the MissileCount = 1 to how many missiles you want to spawn from the caster, and add wait at the bottom of the loop so the missiles don't spawn at the same time.

  • 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))
      • Set BS_Point[1] = (Target point 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 = 3
      • 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[1] and BS_Point[2])
          • Set BS_DistanceToTravel[BS_Times] = BS_MaxDistance[BS_Times]
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Height of Arc is a fourth of range. if you will set this to a number and not a portion of distance, then missile will fly too high --------
          • -------- at short distances and this will create a feel like it moves faster than usual. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_ArcHeight[BS_Times] = (BS_MaxDistance[BS_Times] x 0.25)
          • Set BS_Level[BS_Times] = (Level of Shot! for (Triggering unit))
          • Set BS_Damage[BS_Times] = ((Random real number between 150.00 and 200.00) + (50.00 x (Real(BS_Level[BS_Times]))))
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Change Area of Effect variable to true, if you want missile to hit multiple targets. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_AoE[BS_Times] = False
          • Set BS_AoE_Radius[BS_Times] = 150.00
          • 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])
          • 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. --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set BS_HYPSpeed[BS_Times] = 40.00
          • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- 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)
          • Wait 0.10 seconds
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- 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] )
Next time post questions like this in World Editor Help Zone > Triggers and Scripts, your question will just be buried here in the Requests forums because this is no place for questions.

Thank you so much!
Sorry didnt know that, i will.
 
Status
Not open for further replies.
Top