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

SingleTarget Airborne No Jass question

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
You beat me to the punch Pyro.

Anyway, I went ahead and assumed that OP wanted something like Impale but it only targets a single unit:
  • Airborne Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__Unit = (Target unit of ability being cast)
      • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
      • -------- --------
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- CONFIGURE: --------
      • -------- Define the Height and Duration of your Airborne spell: --------
      • Set VariableSet Airborne_Duration[Airborne__CV] = 2.00
      • Set VariableSet Airborne_Height[Airborne__CV] = 250.00
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- --------
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = 0.00
      • Set VariableSet Airborne__Speed[Airborne__CV] = (2.00 x Airborne_Height[Airborne__CV])
      • Unit - Add Storm Crow Form to Airborne__Unit
      • Unit - Remove Storm Crow Form from Airborne__Unit
      • Unit Group - Add Airborne__Unit to Airborne__Group
      • Trigger - Turn on Airborne Loop <gen>
  • Airborne Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Airborne__Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Airborne__Unit = (Picked unit)
          • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
          • -------- --------
          • -------- TimeElapsed should increase by the Periodic Interval amount (0.02 by default): --------
          • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = (Airborne__TimeElapsed[Airborne__CV] + 0.02)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Airborne__Unit is alive) Equal to True
              • Airborne__TimeElapsed[Airborne__CV] Less than Airborne_Duration[Airborne__CV]
            • Then - Actions
              • -------- The unit is alive and the duration hasn't expired: --------
              • Set VariableSet Airborne_Height[0] = ((Airborne__Speed[Airborne__CV] x Airborne__TimeElapsed[Airborne__CV]) - (0.50 x (Airborne__Speed[Airborne__CV] x (Airborne__TimeElapsed[Airborne__CV] x Airborne__TimeElapsed[Airborne__CV]))))
              • Animation - Change Airborne__Unit flying height to ((Default flying height of Airborne__Unit) + Airborne_Height[0]) at 0.00
            • Else - Actions
              • -------- The unit died or the duration expired: --------
              • Animation - Change Airborne__Unit flying height to (Default flying height of Airborne__Unit) at 0.00
              • Unit Group - Remove Airborne__Unit from Airborne__Group.
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Airborne__Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off Airborne Loop <gen>
                • Else - Actions
I copied the math to calculate the Flying Height from this: TorrentSystem v2.1.0
 

Attachments

  • Airborne Example.w3m
    23.8 KB · Views: 5
Level 7
Joined
Oct 6, 2022
Messages
135
You need to be more specific. Knock up, knock back, suspend in the air indefinitely, transform to a flying version, etc.. Describe what you want to happen with more words and someone may be able to suggest a resource that does most of the work for you.
It was kinda like the impale but it was only a single unit being airborne "without using a targetable skill like firebolt or carrion swarm", the offset was only within the 50 or 75 range from the triggering unit the AoE where the one unit can be detected was 50 or 100.
 
Last edited:
Level 7
Joined
Oct 6, 2022
Messages
135
You beat me to the punch Pyro.

Anyway, I went ahead and assumed that OP wanted something like Impale but it only targets a single unit:
  • Airborne Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__Unit = (Target unit of ability being cast)
      • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
      • -------- --------
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- CONFIGURE: --------
      • -------- Define the Height and Duration of your Airborne spell: --------
      • Set VariableSet Airborne_Duration[Airborne__CV] = 2.00
      • Set VariableSet Airborne_Height[Airborne__CV] = 250.00
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- --------
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = 0.00
      • Set VariableSet Airborne__Speed[Airborne__CV] = (2.00 x Airborne_Height[Airborne__CV])
      • Unit - Add Storm Crow Form to Airborne__Unit
      • Unit - Remove Storm Crow Form from Airborne__Unit
      • Unit Group - Add Airborne__Unit to Airborne__Group
      • Trigger - Turn on Airborne Loop <gen>
  • Airborne Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Airborne__Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Airborne__Unit = (Picked unit)
          • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
          • -------- --------
          • -------- TimeElapsed should increase by the Periodic Interval amount (0.02 by default): --------
          • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = (Airborne__TimeElapsed[Airborne__CV] + 0.02)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Airborne__Unit is alive) Equal to True
              • Airborne__TimeElapsed[Airborne__CV] Less than Airborne_Duration[Airborne__CV]
            • Then - Actions
              • -------- The unit is alive and the duration hasn't expired: --------
              • Set VariableSet Airborne_Height[0] = ((Airborne__Speed[Airborne__CV] x Airborne__TimeElapsed[Airborne__CV]) - (0.50 x (Airborne__Speed[Airborne__CV] x (Airborne__TimeElapsed[Airborne__CV] x Airborne__TimeElapsed[Airborne__CV]))))
              • Animation - Change Airborne__Unit flying height to ((Default flying height of Airborne__Unit) + Airborne_Height[0]) at 0.00
            • Else - Actions
              • -------- The unit died or the duration expired: --------
              • Animation - Change Airborne__Unit flying height to (Default flying height of Airborne__Unit) at 0.00
              • Unit Group - Remove Airborne__Unit from Airborne__Group.
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Airborne__Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off Airborne Loop <gen>
                • Else - Actions
I copied the math to calculate the Flying Height from this: TorrentSystem v2.1.0
I'll think a unit that will be suitable for this, thank you Uncle :thumbs_up:
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
You don't need to use Storm Bolt to trigger that Airborne stuff. You can use any Event you want as long as there's a Unit set to Airborne_Unit. Hell, you don't even need an Event, just Set the variables and run the Actions.

For example, this trigger would make a Unit go Airborne whenever it's selected by Player 1:
  • Airborne Cast
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__Unit = (Triggering unit)
      • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
      • -------- --------
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- CONFIGURE: --------
      • -------- Define the Height and Duration of your Airborne spell: --------
      • Set VariableSet Airborne_Duration[Airborne__CV] = 2.00
      • Set VariableSet Airborne_Height[Airborne__CV] = 250.00
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- --------
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = 0.00
      • Set VariableSet Airborne__Speed[Airborne__CV] = (2.00 x Airborne_Height[Airborne__CV])
      • Unit - Add Storm Crow Form to Airborne__Unit
      • Unit - Remove Storm Crow Form from Airborne__Unit
      • Unit Group - Add Airborne__Unit to Airborne__Group
      • Trigger - Turn on Airborne Loop <gen>
Another example, this trigger will make a random unit go Airborne every second:
  • Airborne Cast
    • Events
      • Time - Every 1.00 seconds of a game time
    • Conditions
    • Actions
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__Unit = (Random unit from (Units in playable map area))
      • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
      • -------- --------
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- CONFIGURE: --------
      • -------- Define the Height and Duration of your Airborne spell: --------
      • Set VariableSet Airborne_Duration[Airborne__CV] = 2.00
      • Set VariableSet Airborne_Height[Airborne__CV] = 250.00
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- --------
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = 0.00
      • Set VariableSet Airborne__Speed[Airborne__CV] = (2.00 x Airborne_Height[Airborne__CV])
      • Unit - Add Storm Crow Form to Airborne__Unit
      • Unit - Remove Storm Crow Form from Airborne__Unit
      • Unit Group - Add Airborne__Unit to Airborne__Group
      • Trigger - Turn on Airborne Loop <gen>
But keep in mind, the only thing Stunning the Unit was Storm Bolt, so if you don't want them to move then you'll need to Stun them yourself. This can be done by using a Dummy unit to cast Storm Bolt on the Airborne_Unit or using the BlzPauseUnitEx() function.

Also, sorry if this comment is a little misleading:
  • -------- These variables must not change: --------
You'd want to change Airborne_Unit depending on the situation.

The three variables you can safely change the value of are:
Airborne__Unit
Airborne_Duration
Airborne_Height
 
Last edited:
Level 7
Joined
Oct 6, 2022
Messages
135
You don't need to use Storm Bolt to trigger that Airborne stuff. You can use any Event you want as long as there's a Unit set to Airborne_Unit. Hell, you don't even need an Event, just Set the variables and run the Actions.

For example, this would make a Unit go Airborne whenever it's selected by Player 1:
  • Airborne Cast
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__Unit = (Triggering unit)
      • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
      • -------- --------
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- CONFIGURE: --------
      • -------- Define the Height and Duration of your Airborne spell: --------
      • Set VariableSet Airborne_Duration[Airborne__CV] = 2.00
      • Set VariableSet Airborne_Height[Airborne__CV] = 250.00
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- --------
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = 0.00
      • Set VariableSet Airborne__Speed[Airborne__CV] = (2.00 x Airborne_Height[Airborne__CV])
      • Unit - Add Storm Crow Form to Airborne__Unit
      • Unit - Remove Storm Crow Form from Airborne__Unit
      • Unit Group - Add Airborne__Unit to Airborne__Group
      • Trigger - Turn on Airborne Loop <gen>
Another example, this trigger will make a random unit go Airborne every second:
  • Airborne Cast
    • Events
      • Time - Every 1.00 seconds of a game time
    • Conditions
    • Actions
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__Unit = (Random unit from (Units in playable map area))
      • Set VariableSet Airborne__CV = (Custom value of Airborne__Unit)
      • -------- --------
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- CONFIGURE: --------
      • -------- Define the Height and Duration of your Airborne spell: --------
      • Set VariableSet Airborne_Duration[Airborne__CV] = 2.00
      • Set VariableSet Airborne_Height[Airborne__CV] = 250.00
      • -------- ///////////////////////////////////////////////////////////////////// --------
      • -------- --------
      • -------- These variables must not change: --------
      • Set VariableSet Airborne__TimeElapsed[Airborne__CV] = 0.00
      • Set VariableSet Airborne__Speed[Airborne__CV] = (2.00 x Airborne_Height[Airborne__CV])
      • Unit - Add Storm Crow Form to Airborne__Unit
      • Unit - Remove Storm Crow Form from Airborne__Unit
      • Unit Group - Add Airborne__Unit to Airborne__Group
      • Trigger - Turn on Airborne Loop <gen>
But keep in mind, the only thing Stunning the Unit was Storm Bolt, so if you don't want them to move then you'll need to Stun them yourself. This can be done by using a Dummy unit to cast Storm Bolt on the Airborne_Unit or using the BlzPauseUnitEx() function.
Noted thank you, Btw what's the purpose of adding storm crow form to a certain unit?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
Warcraft 3 is a big mess and there's a lot of weird workarounds that we've discovered over the years.

In this case adding Storm Crow Form to a non-flying unit marks some flag that allows the unit to adjust it's flying height (A ground unit normally cant do this). Luckily, the unit doesn't need to keep the ability for it to work so we can remove the ability immediately afterwards.
 
Last edited:
Status
Not open for further replies.
Top