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

Air Strike Ability

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
I want to make an MUI air strike ability. The unit casts an area of effect indicator at a target location. It spawns a helicopter which drops a bomb. The bomb slowly descends and explodes once it reaches a low flying height. Here is my triggering so far:

  • Air Raid New
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Air Strike (New)
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Set TempPoint2 = (TempPoint offset by (-800.00, -800.00))
      • Unit - Create 1 Bomber for (Owner of (Casting unit)) at TempPoint facing Default building facing degrees
      • Sound - Play AirStrikeLaunch <gen> at 90.00% volume, located at TempPoint with Z offset 0.00
      • Unit - Order (Last created unit) to Move To TempPoint2
      • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 Bomb for (Owner of (Casting unit)) at TempPoint facing Default building facing degrees
      • Unit Group - Add (Last created unit) to AirRaidGroup
      • Animation - Change (Last created unit) flying height to 25.00 at 55.00
      • Game - Display to (All players) the text: (String((Current flying height of (Last created unit))))
      • Trigger - Turn on Air Raid Bomb <gen>
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call RemoveLocation (udg_TempPoint2)
  • Air Raid Bomb
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Trigger turned on
      • Unit Group - Pick every unit in AirRaidGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current flying height of (Picked unit)) Equal to 25.00
            • Then - Actions
              • Game - Display to (All players) the text: (String((Current flying height of TempUnit)))
              • Unit - Kill (Picked unit)
              • Unit Group - Remove (Picked unit) from AirRaidGroup
              • Set TempUnit = (Picked unit)
              • Set TempPoint = (Position of (Picked unit))
              • Set TempUnitGroup = (Units within 225.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True))
              • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause TempUnit to damage (Picked unit), dealing 225.00 damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup (udg_TempUnitGroup)
              • Custom script: call RemoveLocation (udg_TempPoint)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in AirRaidGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Game - Display to (All players) the text: Trigger turned off
                • Else - Actions
            • Else - Actions
I think everything works except for the flying height of the bomb. The messages report that the flying height changes from 300 to 25 instantly. It does not slowly descend. I read somewhere that the first value is what height you want the unit to be set to, and the "rate" is how many units it changes per second. The default height of the bomb is 300. If it changes at 55 units per second, it will hit 25 units in 5 seconds.

Why is the flying height of the unit changning from 300 to 25 within half a second?
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
The debug message will display the height that the unit is set to go. The current flying height condition will trigger the first time the check is made. The game sees the flying height as 25 even though visually it isn't there yet.

You leak center of playable map area in the second trigger.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
The debug message will display the height that the unit is set to go. The current flying height condition will trigger the first time the check is made. The game sees the flying height as 25 even though visually it isn't there yet.

Oh. I see, thats lame. I dont know how else to make the damage wait for the bomb to be close to the ground. I cant add "Wait 5 seconds" otherwise its no longer MUI :/ This is my first advanced MUI spell (advanced for me because I've only made very very simple MUI before.)

I suppose I could make a single trigger 12 times (for each player)? lol.

You leak center of playable map area in the second trigger.

Thanks, forgot to set it the the "TempPoint" variable.

Any help Anyone?
 
Last edited:
Level 8
Joined
Feb 3, 2013
Messages
277
EDIT: wait... let me re read ur spell lol

can you do like a.. call SetUnitZ?
or
instead of changing the height via rate, why don't u manually change it every time ur second trigger goes off and make it instant? maybe that will work :p
 
Status
Not open for further replies.
Top