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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Rocketsystem v1.0d.w3x
Variables
Initialization
Initialization
Rocket System
AttackRocketInitiate
AttackRocket
AttackRocketFlyes
AttackRocketDies
AttackRocketIndexFinding
AttackRocketEnding
Name
Type
is_array
initial_value
Num
real
No
Number
real
Yes
Rocket_empty
boolean
Yes
Rocket_Index
integer
No
RocketTarget
unit
Yes
RocketType
unitcode
No
Initialization
Events
Time - Elapsed game time is 0.20 seconds
Conditions
Actions
Visibility - Disable fog of war
Visibility - Disable black mask
Set Variable Set Rocket_Index = "1"
Initialization here
AttackRocketInitiate
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
-------- This index must be initialized. Do not change this. --------
Set Variable Set Rocket_Index = "1"
-------- RocketType = Unit-Type of your rocket. Rocket unit must be flying. --------
Set Variable Set RocketType = "h005"
Initialize units which will uses this rocket system here.
AttackRocket
Events
Unit - A unit Is attacked
Conditions
Actions
-------- Unit1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Attacking unit)) Equal to AA tank
Then - Actions
Unit - Create 1 . RocketType for (Owner of (Attacking unit)) at ((Position of (Attacking unit)) offset by 0.00 towards 0 degrees.) facing (Real((Integer((Facing of (Attacking unit)))))) degrees
Unit - Add a 8.00 second Generic expiration timer to (Last created unit)
Set Variable Set RocketTarget[Rocket_Index] = (Attacked unit)
Set Variable Set Rocket_empty[Rocket_Index] = "true"
Unit - Set the custom value of (Last created unit) to Rocket_Index
-------- Rocket's Life = Rocket's Damage --------
Unit - Set life of (Last created unit) to 1.00
Trigger - Run AttackRocketIndexFinding <gen> (ignoring conditions)
Else - Actions
-------- Unit2 (Example. This is tank with 2 rocket pods, with 4 rockets each) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Attacking unit)) Equal to AA tank Massive
Then - Actions
For each (Integer A) from 1 to 4 , do (Actions)
Loop - Actions
Unit - Create 1 . RocketType for (Owner of (Attacking unit)) at ((Position of (Attacking unit)) offset by (35.00 + 0.00) towards ((Facing of (Attacking unit)) + 90.00) degrees.) facing (Real((Integer(((Facing of (Attacking unit)) + ((Real((Integer A))) x 20.00)))))) degrees
Unit - Add a 8.00 second Generic expiration timer to (Last created unit)
Set Variable Set RocketTarget[Rocket_Index] = (Attacked unit)
Set Variable Set Rocket_empty[Rocket_Index] = "true"
Unit - Set the custom value of (Last created unit) to Rocket_Index
Unit - Set life of (Last created unit) to 1.00
Trigger - Run AttackRocketIndexFinding <gen> (ignoring conditions)
Unit - Create 1 . RocketType for (Owner of (Attacking unit)) at ((Position of (Attacking unit)) offset by (35.00 + 0.00) towards ((Facing of (Attacking unit)) - 90.00) degrees.) facing (Real((Integer(((Facing of (Attacking unit)) - ((Real((Integer A))) x 20.00)))))) degrees
Unit - Add a 8.00 second Generic expiration timer to (Last created unit)
Set Variable Set RocketTarget[Rocket_Index] = (Attacked unit)
Set Variable Set Rocket_empty[Rocket_Index] = "true"
Unit - Set the custom value of (Last created unit) to Rocket_Index
Unit - Set life of (Last created unit) to 1.00
Trigger - Run AttackRocketIndexFinding <gen> (ignoring conditions)
Else - Actions
There you can change speed of rocket.
Num = Movement speed of rocket per every 0.03 Seconds
AttackRocketFlyes
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set Variable Set Num = "30.00"
Unit Group - Pick every unit in (Units of type Rocket) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Position of (Picked unit)) and (Position of RocketTarget[(Custom value of (Picked unit))])) Less than or equal to 32.00
((Current flying height of RocketTarget[(Custom value of (Picked unit))]) - (Current flying height of (Picked unit))) Less than or equal to 0.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is alive) Equal to True
Then - Actions
Unit - Cause (Picked unit) to damage RocketTarget[(Custom value of (Picked unit))] , dealing (Life of (Picked unit)) damage of attack type Siege and damage type Normal
Else - Actions
Set Variable Set Rocket_empty[(Custom value of (Picked unit))] = "false"
Unit - Kill (Picked unit)
Else - Actions
Set Variable Set Number[1] = (0.00 + ((Facing of (Picked unit)) - (Angle from (Position of (Picked unit)) to (Position of RocketTarget[(Custom value of (Picked unit))]))))
Set Variable Set Number[2] = (360.00 - ((Facing of (Picked unit)) - (Angle from (Position of (Picked unit)) to (Position of RocketTarget[(Custom value of (Picked unit))]))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Number[1] Greater than or equal to 360.00
Then - Actions
Set Variable Set Number[1] = (Number[1] - 360.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Number[1] Less than 0.00
Then - Actions
Set Variable Set Number[1] = (Number[1] + 360.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Number[2] Greater than or equal to 360.00
Then - Actions
Set Variable Set Number[2] = (Number[2] - 360.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Number[2] Less than 0.00
Then - Actions
Set Variable Set Number[2] = (Number[2] + 360.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Number[1] Greater than or equal to Number[2]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[1]) Greater than 0.01
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[1]) Greater than 1.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[1]) Greater than 5.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[1]) Greater than 10.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[1]) Greater than 45.00
Then - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) + 45.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) + 10.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) + 5.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) + 1.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) + 0.01) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) + 0.00) degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[2]) Greater than 0.01
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[2]) Greater than 1.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[2]) Greater than 5.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[2]) Greater than 10.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(360.00 - Number[2]) Greater than 45.00
Then - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) - 45.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) - 10.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) - 5.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) - 1.00) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) - 0.01) degrees
Else - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Num towards ((Facing of (Picked unit)) + 0.00) degrees.) , facing ((Facing of (Picked unit)) - 0.00) degrees
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Current flying height of RocketTarget[(Custom value of (Picked unit))]) - 0.00) Greater than (Current flying height of (Picked unit))
Then - Actions
Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) + 2.50) at 1000000000.00
Else - Actions
Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) - 2.50) at 1000000000.00
Nevermind. Just uninitialize of dead rockets
AttackRocketDies
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Rocket
Actions
Set Variable Set Rocket_empty[(Custom value of (Triggering unit))] = "false"
Index refinding system. Do not change anything, cuz it works.... Usually...
AttackRocketIndexFinding
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rocket_Index Greater than 98
Then - Actions
Set Variable Set Rocket_Index = "1"
Trigger - Run (This trigger) (ignoring conditions)
Skip remaining actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rocket_empty[Rocket_Index] Equal to True
Then - Actions
Set Variable Set Rocket_Index = (Rocket_Index + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Rocket_Index Greater than 98
Then - Actions
Set Variable Set Rocket_Index = "1"
Trigger - Run (This trigger) (ignoring conditions)
Skip remaining actions
Else - Actions
Trigger - Run (This trigger) (ignoring conditions)
Else - Actions
That's all. Easy to copy. Just copy this triggers, and system will work.
Idk... It can be usefull... Maybe not...
Anyway give me a credits, plz, if you use this system in your map....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.