• 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.

[Spell] Bird Launcher spell question

Status
Not open for further replies.
Level 8
Joined
Oct 6, 2022
Messages
185
Hello again, i would like to ask how to make a bird launcher spell just like this in Gui.? Hope anyone could help me with it.
Bird Launcher.png

as the bird reached it's destination, the bird dies.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
So the bird spawns to the left of the caster and swoops down towards the target point, dying upon impact.

Is there a minimum cast range? Does it do anything while flying (damage, stun, etc)? Does it do something when it reaches the target point?

If it damages/debuffs, can it hit the same target more than once?

Also, if I recall correctly you're on an older version of Warcraft 3. Do you mind letting people know which version you're using whenever you request something like this. Or better yet, put a message in your Signature like "I use version 1.31" so you don't have to keep repeating yourself. Thanks!
 
Level 8
Joined
Oct 6, 2022
Messages
185
There's a minimum cast range(i forgot to add that sorry)
The movement is the only thing i needed for now since I'll mix something with it after that
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
The ability is based on Carrion Swarm with the Art removed and Targets Allowed set to None. The Swoop Attack (Dummy) unit is based on the Locust with a disabled Attack and a 0 flying height minimum. The Swoop Attack Loop trigger should be Initially OFF (uncheck it).
  • Swoop Attack Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Swoop Attack
    • Actions
      • Set VariableSet SA_Index = (SA_Index + 1)
      • -------- --------
      • Set SA_Caster[SA_Index] = (Triggering unit)
      • Set SA_Angle = (Facing of SA_Caster[SA_Index])
      • Set SA_Point[0] = (Position of SA_Caster[SA_Index])
      • Set SA_Point[1] = (Target point of ability being cast)
      • Set SA_Distance[SA_Index] = (Distance between SA_Point[0] and SA_Point[1])
      • -------- --------
      • -------- Define bird speed (multiply this by 50 to get the distance traveled per second): --------
      • Set SA_Speed[SA_Index] = 10.00
      • -------- --------
      • -------- Define bird start position: --------
      • Set SA_Point[2] = (SA_Point[0] offset by 100.00 towards (SA_Angle + 90.00) degrees.)
      • -------- --------
      • -------- Define bird starting flying height (should match it's Object Editor flying height): --------
      • Set SA_Flying_Height = 150.00
      • -------- --------
      • -------- Define minimum distance traveled (500.00 by default): --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SA_Distance[SA_Index] Less than 500.00
        • Then - Actions
          • Set VariableSet SA_Distance[SA_Index] = 500.00
          • -------- --------
          • Custom script: call RemoveLocation(udg_SA_Point[1])
          • Set SA_Point[1] = (SA_Point[0] offset by SA_Distance[SA_Index] towards SA_Angle degrees.)
        • Else - Actions
      • -------- --------
      • Unit - Create 1 Swoop Attack (Dummy) for (Triggering player) at SA_Point[2] facing SA_Angle degrees
      • Set SA_Bird[SA_Index] = (Last created unit)
      • -------- --------
      • -------- Get the duration of how long it will take to reach the destination: --------
      • Set SA_Duration = (SA_Distance[SA_Index] / (SA_Speed[SA_Index] x 50.00))
      • -------- --------
      • -------- Make the bird face the destination: --------
      • Unit - Make SA_Bird[SA_Index] face SA_Point[1] over 0.00 seconds
      • -------- --------
      • -------- Make the bird swoop down over the duration (0.00 = final height): --------
      • Animation - Change SA_Bird[SA_Index] flying height to 0.00 at (SA_Flying_Height / SA_Duration)
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation(udg_SA_Point[0])
      • Custom script: call RemoveLocation(udg_SA_Point[1])
      • Custom script: call RemoveLocation(udg_SA_Point[2])
      • -------- --------
      • Trigger - Turn on Swoop Attack Loop <gen>
  • Swoop Attack Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SA_Loop) from 1 to SA_Index, do (Actions)
        • Loop - Actions
          • Set SA_Point[0] = (Position of SA_Bird[SA_Loop])
          • Set SA_Point[1] = (SA_Point[0] offset by SA_Speed[SA_Loop] towards (Facing of SA_Bird[SA_Loop]) degrees.)
          • -------- --------
          • -------- Move the bird: --------
          • Custom script: call SetUnitX(udg_SA_Bird[udg_SA_Loop], GetLocationX(udg_SA_Point[1]))
          • Custom script: call SetUnitY(udg_SA_Bird[udg_SA_Loop], GetLocationY(udg_SA_Point[1]))
          • -------- --------
          • -------- SA_Point[1] is the new position of the Bird. You could use this Point to damage nearby enemy units for example. --------
          • -------- --------
          • -------- Clean up memory leaks: --------
          • Custom script: call RemoveLocation(udg_SA_Point[0])
          • Custom script: call RemoveLocation(udg_SA_Point[1])
          • -------- --------
          • -------- Check if the bird has reached it's destination: --------
          • Set SA_Distance[SA_Loop] = (SA_Distance[SA_Loop] - SA_Speed[SA_Loop])
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SA_Distance[SA_Loop] Less than or equal to 0.01
            • Then - Actions
              • -------- The bird has reached it's destination. --------
              • Unit - Kill SA_Bird[SA_Loop]
              • -------- --------
              • -------- This process removes the current instance of the spell from the For Loop by replacing it with the last instance: --------
              • Set SA_Bird[SA_Loop] = SA_Bird[SA_Index]
              • Set SA_Caster[SA_Loop] = SA_Caster[SA_Index]
              • Set SA_Distance[SA_Loop] = SA_Distance[SA_Index]
              • Set SA_Speed[SA_Loop] = SA_Speed[SA_Index]
              • -------- --------
              • Set SA_Index = (SA_Index - 1)
              • Set SA_Loop = (SA_Loop - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SA_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
variables.png


Note that the way I've handled Distance and Speed isn't perfect and the Bird will not necessarily stop at the exact destination point (but it should be very close). If you want something to happen at the exact destination point, for example an AoE explosion of damage, you could store the destination point as an Array variable and reference it at the end of the spell instead of the position of the Bird. This way your damage will occur exactly where you clicked rather than very close to where you clicked. The visual being slightly off is hardly even noticeable unless you use some weird values so I think it's fine the way it is.
 

Attachments

  • Swoop Attack 1.w3m
    21.1 KB · Views: 3
Last edited:
Level 8
Joined
Oct 6, 2022
Messages
185
The ability is based on Carrion Swarm with the Art removed and Targets Allowed set to None. The Swoop Attack (Dummy) unit is based on the Locust with a disabled Attack and a 0 flying height minimum. The Swoop Attack Loop trigger should be Initially OFF (uncheck it).
  • Swoop Attack Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Swoop Attack
    • Actions
      • Set VariableSet SA_Index = (SA_Index + 1)
      • -------- --------
      • Set SA_Caster[SA_Index] = (Triggering unit)
      • Set SA_Angle = (Facing of SA_Caster[SA_Index])
      • Set SA_Point[0] = (Position of SA_Caster[SA_Index])
      • Set SA_Point[1] = (Target point of ability being cast)
      • Set SA_Distance[SA_Index] = (Distance between SA_Point[0] and SA_Point[1])
      • -------- --------
      • -------- Define bird speed (multiply this by 50 to get the distance traveled per second): --------
      • Set SA_Speed[SA_Index] = 10.00
      • -------- --------
      • -------- Define bird start position: --------
      • Set SA_Point[2] = (SA_Point[0] offset by 100.00 towards (SA_Angle + 90.00) degrees.)
      • -------- --------
      • -------- Define bird starting flying height (should match it's Object Editor flying height): --------
      • Set SA_Flying_Height = 150.00
      • -------- --------
      • -------- Define minimum distance traveled (500.00 by default): --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SA_Distance[SA_Index] Less than 500.00
        • Then - Actions
          • Set VariableSet SA_Distance[SA_Index] = 500.00
          • -------- --------
          • Custom script: call RemoveLocation(udg_SA_Point[1])
          • Set SA_Point[1] = (SA_Point[0] offset by SA_Distance[SA_Index] towards SA_Angle degrees.)
        • Else - Actions
      • -------- --------
      • Unit - Create 1 Swoop Attack (Dummy) for (Triggering player) at SA_Point[2] facing SA_Angle degrees
      • Set SA_Bird[SA_Index] = (Last created unit)
      • -------- --------
      • -------- Get the duration of how long it will take to reach the destination: --------
      • Set SA_Duration = (SA_Distance[SA_Index] / (SA_Speed[SA_Index] x 50.00))
      • -------- --------
      • -------- Make the bird face the destination: --------
      • Unit - Make SA_Bird[SA_Index] face SA_Point[1] over 0.00 seconds
      • -------- --------
      • -------- Make the bird swoop down over the duration (0.00 = final height): --------
      • Animation - Change SA_Bird[SA_Index] flying height to 0.00 at (SA_Flying_Height / SA_Duration)
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation(udg_SA_Point[0])
      • Custom script: call RemoveLocation(udg_SA_Point[1])
      • Custom script: call RemoveLocation(udg_SA_Point[2])
      • -------- --------
      • Trigger - Turn on Swoop Attack Loop <gen>
  • Swoop Attack Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SA_Loop) from 1 to SA_Index, do (Actions)
        • Loop - Actions
          • Set SA_Point[0] = (Position of SA_Bird[SA_Loop])
          • Set SA_Point[1] = (SA_Point[0] offset by SA_Speed[SA_Loop] towards (Facing of SA_Bird[SA_Loop]) degrees.)
          • -------- --------
          • -------- Move the bird: --------
          • Custom script: call SetUnitX(udg_SA_Bird[udg_SA_Loop], GetLocationX(udg_SA_Point[1]))
          • Custom script: call SetUnitY(udg_SA_Bird[udg_SA_Loop], GetLocationY(udg_SA_Point[1]))
          • -------- --------
          • -------- SA_Point[1] is the new position of the Bird. You could use this Point to damage nearby enemy units for example. --------
          • -------- --------
          • -------- Clean up memory leaks: --------
          • Custom script: call RemoveLocation(udg_SA_Point[0])
          • Custom script: call RemoveLocation(udg_SA_Point[1])
          • -------- --------
          • -------- Check if the bird has reached it's destination: --------
          • Set SA_Distance[SA_Loop] = (SA_Distance[SA_Loop] - SA_Speed[SA_Loop])
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SA_Distance[SA_Loop] Less than or equal to 0.01
            • Then - Actions
              • -------- The bird has reached it's destination. --------
              • Unit - Kill SA_Bird[SA_Loop]
              • -------- --------
              • -------- This process removes the current instance of the spell from the For Loop by replacing it with the last instance: --------
              • Set SA_Bird[SA_Loop] = SA_Bird[SA_Index]
              • Set SA_Caster[SA_Loop] = SA_Caster[SA_Index]
              • Set SA_Distance[SA_Loop] = SA_Distance[SA_Index]
              • Set SA_Speed[SA_Loop] = SA_Speed[SA_Index]
              • -------- --------
              • Set SA_Index = (SA_Index - 1)
              • Set SA_Loop = (SA_Loop - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SA_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
View attachment 438067

Note that the way I've handled Distance and Speed isn't perfect and the Bird will not necessarily stop at the exact destination point (but it should be very close). If you want something to happen at the exact destination point, for example an AoE explosion of damage, you could store the destination point as an Array variable and reference it at the end of the spell instead of the position of the Bird. This way your damage will occur exactly where you clicked rather than very close to where you clicked. The visual being slightly off is hardly even noticeable unless you use some weird values so I think it's fine the way it is.
Can you also tell me how do i make the bird falls sooner the nearer the target point was?
Edit:
Nvm, I've figured it out thanks again
 
Last edited:
Status
Not open for further replies.
Top