[Solved] Rocket attack system

Status
Not open for further replies.
Level 2
Joined
Nov 27, 2021
Messages
10
Hello guys, i am struggling to make this attacking system for tinker , when the enemy distance was less than 150 using melee and more then 150 using rockets. for that i use dummy for trigger rocket spell on target and for melee using dummy attack sound but i think my condition is not correct. thanks for helping

  • Firing Rockets
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Tinker
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Attacking unit)) and (Position of (Attacked unit))) Less than 150.00
        • Then - Actions
          • Unit - Create 1 Flying Dummy for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Unit - Add a 0.60 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Attack (Attacked unit)
        • Else - Actions
          • Animation - Play (Attacking unit)'s spell one Alternate animation
          • Unit - Create 1 Flying Dummy for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Unit - Add Firing Rockets to (Last created unit)
          • Unit - Add a 0.60 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets (Position of (Attacked unit))
 
Conditions look fine to me. Can you explain what is and isn't happening?

This action for example won't work because Tinker is already playing an animation:
  • Animation - Play (Attacking unit)'s spell one Alternate animation
This can also get interrupted very easily.

This probably isn't a long enough timer to support the entire Cluster Rockets duration:
  • Unit - Add a 0.60 second Generic expiration timer to (Last created unit)
It's a channeling ability so once the unit dies the ability stops.
 
Last edited:
Thank you all for your help. There is nothing wrong with the Scripts, and even those who want the attack to be performed automatically can use this system. My only mistake was that I used the building instead of attacking unit for the test. Of course, I changed the conditional values from 150 to 250 and the problem had solved.
 
Status
Not open for further replies.
Back
Top