[Solved] Parabola in GUI (don't know how to adjust X and Y of Point)

Level 11
Joined
May 16, 2020
Messages
653
Hi guys,

I'm trying to formulate a trigger which throws fireballs in a parabola to random points in the target area for 10 seconds (the parabola should go "up and down" as well as "left/right", i.e. both X/Y and Z need to be adjusted throughout the flight of the projectile).

Creating the Parabola for the Z worked. But I'm lost at creating the parabola for the X and Y of a point.

I'm aware there are missile systems which do the same, but my problem with those is that they work based on using units for projectiles. I want to use Specialeffects directly instead (since I read that this is a lot more efficient than creating units).

Can someone please help?

***

  • TBD
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blaze
    • Actions
      • Set VariableSet AA_Index = (AA_Index + 1)
      • Set VariableSet AA_Caster[AA_Index] = (Triggering unit)
      • Set VariableSet AA_Counter[AA_Index] = 0
      • Set VariableSet AA_CounterMax[AA_Index] = 334
      • Set VariableSet AA_PointOrigin[AA_Index] = (Position of AA_Caster[AA_Index])
      • Set VariableSet AA_PointTarget[AA_Index] = (Target point of ability being cast)
      • -------- --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AA_Index Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: ON
          • Countdown Timer - Start AA_Timer as a Repeating timer that will expire in 0.03 seconds
          • Trigger - Turn on TBD Loop <gen>
        • Else - Actions
  • TBD Loop
    • Events
      • Time - AA_Timer expires
    • Conditions
    • Actions
      • For each (Integer AA_Integer) from 1 to AA_Index, do (Actions)
        • Loop - Actions
          • Set VariableSet AA_Counter[AA_Integer] = (AA_Counter[AA_Integer] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AA_Counter[AA_Integer] Less than AA_CounterMax[AA_Integer]
              • (AA_Counter[AA_Integer] mod 5) Equal to 0
            • Then - Actions
              • Set VariableSet AA_PointTemp = (AA_PointTarget[AA_Integer] offset by (Random real number between 0.00 and 200.00) towards (Random angle) degrees.)
              • -------- --------
              • Set VariableSet AA_Index2 = (AA_Index2 + 1)
              • Game - Display to (All players) the text: (String(AA_Index2))
              • Set VariableSet AA_Angle[AA_Index2] = (Angle from AA_PointOrigin[AA_Integer] to AA_PointTemp)
              • Set VariableSet AA_Speed[AA_Index2] = 25.00
              • Set VariableSet AA_DistanceReached[AA_Index2] = 0.00
              • Set VariableSet AA_DistanceMax[AA_Index2] = (Distance between AA_PointOrigin[AA_Integer] and AA_PointTemp)
              • -------- HEIGHT --------
              • Set VariableSet AA_HeigthAdjustor[AA_Index2] = (Random real number between 0.10 and 0.50)
              • Set VariableSet AA_HeightReal[AA_Index2] = (AA_DistanceMax[AA_Index2] x AA_HeigthAdjustor[AA_Index2])
              • Set VariableSet AA_HeightDegree[AA_Index2] = 0.00
              • -------- X-AXIS --------
              • Set VariableSet AA_X_Adjustor[AA_Index2] = (Random real number between 0.10 and 0.50)
              • Set VariableSet AA_X_Real[AA_Index2] = (AA_DistanceMax[AA_Index2] x AA_X_Adjustor[AA_Index2])
              • Set VariableSet AA_X_Degree[AA_Index2] = 0.00
              • -------- --------
              • Special Effect - Create a special effect at AA_PointOrigin[AA_Integer] using Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
              • Set VariableSet AA_SFX[AA_Index2] = (Last created special effect)
              • Special Effect - Set Yaw of AA_SFX[AA_Index2] to: (AA_Angle[AA_Index2] x (Pi / 180.00))
              • -------- --------
              • Custom script: call RemoveLocation(udg_AA_PointTemp)
            • Else - Actions
          • -------- --------
          • For each (Integer AA_Integer2) from 1 to AA_Index2, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AA_DistanceReached[AA_Integer2] Less than AA_DistanceMax[AA_Integer2]
                • Then - Actions
                  • Set VariableSet AA_DistanceReached[AA_Integer2] = (AA_DistanceReached[AA_Integer2] + AA_Speed[AA_Integer2])
                  • -------- --------
                  • -------- HEIGHT --------
                  • Set VariableSet AA_HeightDegree[AA_Integer2] = (AA_HeightDegree[AA_Integer2] + (180.00 / (AA_DistanceMax[AA_Integer2] / AA_Speed[AA_Integer2])))
                  • Set VariableSet AA_HeightReached[AA_Integer2] = ((Sin(AA_HeightDegree[AA_Integer2])) x AA_HeightReal[AA_Integer2])
                  • -------- --------
                  • -------- X-AXIS --------
                  • Set VariableSet AA_X_Degree[AA_Integer2] = (AA_X_Degree[AA_Integer2] + (180.00 / (AA_DistanceMax[AA_Integer2] / AA_Speed[AA_Integer2])))
                  • Set VariableSet AA_X_Reached[AA_Integer2] = ((Sin(AA_X_Degree[AA_Integer2])) x AA_HeightReal[AA_Integer2])
                  • -------- --------
                  • Set VariableSet AA_PointTemp = (AA_PointOrigin[AA_Integer] offset by AA_DistanceReached[AA_Integer2] towards (AA_Angle[AA_Integer2] + AA_X_Reached[AA_Integer2]) degrees.)
                  • -------- --------
                  • Special Effect - Set Position of AA_SFX[AA_Integer2] to x: (X of AA_PointTemp), y: (Y of AA_PointTemp), z: AA_HeightReached[AA_Integer2]
                  • -------- --------
                  • Custom script: call RemoveLocation(udg_AA_PointTemp)
                • Else - Actions
                  • Special Effect - Destroy AA_SFX[AA_Integer2]
                  • -------- --------
                  • Set VariableSet AA_Angle[AA_Integer2] = AA_Angle[AA_Index2]
                  • Set VariableSet AA_Speed[AA_Integer2] = AA_Speed[AA_Index2]
                  • Set VariableSet AA_DistanceReached[AA_Integer2] = AA_DistanceReached[AA_Index2]
                  • Set VariableSet AA_DistanceMax[AA_Integer2] = AA_DistanceMax[AA_Index2]
                  • Set VariableSet AA_HeigthAdjustor[AA_Integer2] = AA_HeigthAdjustor[AA_Index2]
                  • Set VariableSet AA_HeightReal[AA_Integer2] = AA_HeightReal[AA_Index2]
                  • Set VariableSet AA_HeightDegree[AA_Integer2] = AA_HeightDegree[AA_Index2]
                  • Set VariableSet AA_X_Adjustor[AA_Integer2] = AA_X_Adjustor[AA_Index2]
                  • Set VariableSet AA_X_Real[AA_Integer2] = AA_X_Real[AA_Index2]
                  • Set VariableSet AA_X_Degree[AA_Integer2] = AA_X_Degree[AA_Index2]
                  • Set VariableSet AA_SFX[AA_Integer2] = AA_SFX[AA_Index2]
                  • -------- --------
                  • Set VariableSet AA_Index2 = (AA_Index2 - 1)
                  • Set VariableSet AA_Integer2 = (AA_Integer2 - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • AA_Index2 Equal to 0
                    • Then - Actions
                      • -------- TBD? --------
                    • Else - Actions
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AA_Counter[AA_Integer] Greater than or equal to AA_CounterMax[AA_Integer]
              • AA_Index2 Equal to 0
            • Then - Actions
              • Custom script: call RemoveLocation(udg_AA_PointOrigin[udg_AA_Integer])
              • Custom script: call RemoveLocation(udg_AA_PointTarget[udg_AA_Integer])
              • -------- --------
              • Set VariableSet AA_Caster[AA_Integer] = AA_Caster[AA_Index]
              • Set VariableSet AA_Counter[AA_Integer] = AA_Counter[AA_Index]
              • Set VariableSet AA_CounterMax[AA_Integer] = AA_CounterMax[AA_Index]
              • Set VariableSet AA_PointOrigin[AA_Integer] = AA_PointOrigin[AA_Index]
              • Set VariableSet AA_PointTarget[AA_Integer] = AA_PointTarget[AA_Index]
              • -------- --------
              • Set VariableSet AA_Index = (AA_Index - 1)
              • Set VariableSet AA_Integer = (AA_Integer - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AA_Index Equal to 0
                • Then - Actions
                  • Game - Display to (All players) the text: OFF
                  • Countdown Timer - Pause AA_Timer
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Level 17
Joined
Jun 26, 2020
Messages
1,352
That's because in:
  • Set VariableSet AA_PointTemp = (AA_PointTarget[AA_Integer] offset by (Random real number between 0.00 and 200.00) towards (Random angle) degrees.)
You used "Random angle" and that angle is the direction of the new point with respect the previous point, you should change it for a constant value or a variable that wont change during the process.

PD: I don't know why everybody have this inside the loop instead of outside.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • AA_Index Equal to 0
    • Then - Actions
      • Game - Display to (All players) the text: OFF
      • Countdown Timer - Pause AA_Timer
      • Trigger - Turn off (This trigger)
    • Else - Actions
 
Level 11
Joined
May 16, 2020
Messages
653
That's because in:
  • set.gif
    Set VariableSet AA_PointTemp = (AA_PointTarget[AA_Integer] offset by (Random real number between 0.00 and 200.00) towards (Random angle) degrees.)

In my opinion this part is correct, but a bit of background:
  • This trigger defines the new point based on a random direction within the target area (=AA_PointTarget)
  • Since with SFX I cannot get the current position of the SFX (like with units), I instead need to rely on the AA_PointOrigin, and from there choose the distance and angle to the point where the projectile should land next
  • This is why I use 2 constant points: One for the origin and one for the target point where the projectiles should more or less land.

  • Set VariableSet AA_PointTemp = (AA_PointOrigin[AA_Integer] offset by AA_DistanceReached[AA_Integer2] towards (AA_Angle[AA_Integer2] + AA_X_Reached[AA_Integer2]) degrees.)
PD: I don't know why everybody have this inside the loop instead of outside.

I guess because of this guide :)
Visualize: Dynamic Indexing
 
Level 13
Joined
Jan 30, 2020
Messages
361
First off: there are good special-effect-based projectile systems out there, this one for example: Relativistic Missiles
(It's vjass though)

In my opinion this part is correct, but a bit of background:
  • This trigger defines the new point based on a random direction within the target area (=AA_PointTarget)
  • Since with SFX I cannot get the current position of the SFX (like with units), I instead need to rely on the AA_PointOrigin, and from there choose the distance and angle to the point where the projectile should land next
  • This is why I use 2 constant points: One for the origin and one for the target point where the projectiles should more or less land.
So the "Random angle" part is to get the target for a new projectile?

Ehhm, you can get effect x/y/z with this? ("Special Effect - Special Effect Position - X")
  • getEffectTest
    • Actions
      • Set real1 = (Position - X of effect1)
This part below looks really wierd...

  • -------- X-AXIS --------
  • Set VariableSet AA_X_Degree[AA_Integer2] = (AA_X_Degree[AA_Integer2] + (180.00 / (AA_DistanceMax[AA_Integer2] / AA_Speed[AA_Integer2])))
  • Set VariableSet AA_X_Reached[AA_Integer2] = ((Sin(AA_X_Degree[AA_Integer2])) x AA_HeightReal[AA_Integer2])
  • -------- --------
  • Set VariableSet AA_PointTemp = (AA_PointOrigin[AA_Integer] offset by AA_DistanceReached[AA_Integer2] towards (AA_Angle[AA_Integer2] + AA_X_Reached[AA_Integer2]) degrees.)
  • -------- --------
AA_Angle[]: is the angle of the projectile?
AA_X_Degree[]: is ... what? Is it XY degree something?
AA_X_Reached[]: is... total X distance traveled? That has some splash of height in it? Is it X/Y something?

Also: What's the issue really? Does it misbehave somehow?
 
Level 11
Joined
May 16, 2020
Messages
653
Thanks you two.

So, what is the real problem?

The problem is that I don't know how to adjust the x and y angle throughout the flight of the missile. Currently I have the point of origin and the new point where the missile should land (which gives me the base-line angle). But I need a way to constantly adjust the angle throughout the flight of the missile(s).

Relativistic Missiles
That first GIF of Relativistic Missiles is exactly what I want to make - but in GUI since then I have control over it (make it a channel spell for example)

So the "Random angle" part is to get the target for a new projectile?

Exactly. It defines where the created projectile should land (limited to an AOE of 200 within the original target).

Ehhm, you can get effect x/y/z with this? ("Special Effect - Special Effect Position - X")

Yes! That's what I'm currently using. But I don't know how to define X and Y in a parabola.

  • Special Effect - Set Position of AA_SFX[AA_Integer2] to x: (X of AA_PointTemp), y: (Y of AA_PointTemp), z: AA_HeightReached[AA_Integer2]
AA_Angle[]: is the angle of the projectile?
AA_X_Degree[]: is ... what? Is it XY degree something?
AA_X_Reached[]: is... total X distance traveled? That has some splash of height in it? Is it X/Y something?

It's weird because that's exactly where I'm lost. A bit of explanation here:
  1. AA_Angle: Is the angle in a straight line, from the AA_PointOrigin to the newly defined Point where the missile should land (this point is not defined as variable, but as expression of "AA_PointOrigin + Angle + Distance)
  2. AA_X_Degree: Yes - this is the degree that I need to constantly adjust throughout the flight of the missile, to get my parabola. I'm really lost though how to do it.
  3. Should be yes.. but now that I think about it, this should probably be a constant value

Also: What's the issue really? Does it misbehave somehow?

The problem is that it doesn't work currently, and I don't know how to adjust x and y throughout the flight for the projectile to fly in a parabola to the "new" target point.
 
Level 13
Joined
Jan 30, 2020
Messages
361
Right, now I understand what you're after etc.
You want to know how to move from a defined starting-point to a defined end-point with a defined arc. Say that you have an arc degree of 60, you will start the path 60 degrees offset "towards" the target, at the half-way-point, you will be moving parallel with the target to end up going directly towards target.

First: The basics - Move something in a straight line:
So to make it move in an angle, you do something long the lines of:
  • ---- x/y is the current x/y, dx is move amount, a is angle ----
  • set x = x + dx*Cos(a)
  • set y = y + dx*Sin(a)
The curve is hard to do in pure GUI becuase GUI Sin and Cos takes degrees and that math is easier to do with radians. I'll do a version with radians and some custom script, it's probably possible with pure GUI, but it'll take longer for me to do it in pure GUI.

I tried to do it myself first, but had to go and steal the math from @chopinski Relativistic Missiles in the end

The variables are:
startPoint - temporarly used point for casters position
targetPoint - temporarly used point for target position
effect - the effect to keep track of

reals:
sAngle - (Radians) Start angle, I.E. the angle from start -> target. The actual angle is calculated based of this one each tick
sDistance - Start Straight Distance from start -> target.
cDistance - currently traveled distance along the "closest route", kinda...
cX - current X
cY - current Y
prevX - x along the straigh path, without curve offset added to it
prevY - see above
cYaw - (Radians) temporarly used variable to calculate the visual angle of the effect
cVelocity - velocity along the straight path from start -> target, can be a constant or variable tracked per projectile
curveOffset - temporary used variable to offset the projectile from the straight path
curve - (radians) the curve amount to use - Set in "Start" trigger
real1 - temporary variable to set curve amount in degrees

  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set startPoint = (Position of (Triggering unit))
      • Set targetPoint = (Target point of ability being cast)
      • Special Effect - Create a special effect at startPoint using Abilities\Spells\Undead\DeathCoil\DeathCoilMissile.mdl
      • Set effect = (Last created special effect)
      • Set sDistance = (Distance between startPoint and targetPoint)
      • Set sAngle = (Radians((Angle from startPoint to targetPoint)))
      • Set cDistance = 0.00
      • Set cX = (X of startPoint)
      • Set cY = (Y of startPoint)
      • Set prevX = cX
      • Set prevY = cY
      • Set tX = (X of targetPoint)
      • Set tY = (Y of targetPoint)
      • Set cVelocity = 6.00
      • Set real1 = (Random real number between -30.00 and 30.00)
      • Special Effect - Set Position of effect to x: cX, y: cY, z: 50.00
      • Custom script: set udg_curve = Tan(udg_real1 * bj_DEGTORAD) * udg_sDistance
      • Custom script: call RemoveLocation(udg_startPoint)
      • Custom script: call RemoveLocation(udg_targetPoint)
      • Game - Display to (All players) the text: Start
      • Trigger - Turn on Tick <gen>
  • Tick
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Custom script: set udg_cX = udg_prevX + udg_cVelocity * Cos(udg_sAngle)
      • Custom script: set udg_cY = udg_prevY + udg_cVelocity * Sin(udg_sAngle)
      • Set prevX = cX
      • Set prevY = cY
      • Set cDistance = (cDistance + cVelocity)
      • Custom script: set udg_curveOffset = 4 * udg_curve * udg_cDistance * (udg_sDistance-udg_cDistance) / (udg_sDistance * udg_sDistance)
      • Game - Display to (All players) the text: (offset: + (String(curveOffset, 5, 2)))
      • Custom script: set udg_cX = udg_cX + udg_curveOffset * Cos(udg_sAngle + bj_PI / 2.0)
      • Custom script: set udg_cY = udg_cY + udg_curveOffset * Sin(udg_sAngle + bj_PI / 2.0)
      • Custom script: set udg_cYaw = udg_sAngle + Atan(-((4 * udg_curve) * (2 * udg_cDistance - udg_sDistance)) / (udg_sDistance * udg_sDistance))
      • Special Effect - Set Position of effect to x: cX, y: cY, z: 50.00
      • Special Effect - Set Orientation of effect to yaw: cYaw, pitch: 0.00, roll: 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • cDistance Greater than or equal to (sDistance + (1.00 / 10000.00))
        • Then - Actions
          • -------- Hit! --------
          • Game - Display to (All players) the text: Hit!
          • Special Effect - Destroy effect
          • Trigger - Turn off (This trigger)
        • Else - Actions

This is ofc only for 1 projectile and needs to be improved upon.
Map for version 1.31.1 (or newer) attached.
 

Attachments

  • CurveTest.w3x
    19 KB · Views: 16
Last edited:
Level 11
Joined
May 16, 2020
Messages
653
Thank you so much! Especially for the test map, this helped a lot. This is the final trigger, which (in-game) looks quite close to what chopinski did in JASS:

  • Blaze
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blaze
    • Actions
      • Set VariableSet AA_Index = (AA_Index + 1)
      • Set VariableSet AA_Caster[AA_Index] = (Triggering unit)
      • Set VariableSet AA_Counter[AA_Index] = 0
      • Set VariableSet AA_CounterMax[AA_Index] = 334
      • Set VariableSet AA_PointOrigin[AA_Index] = (Position of AA_Caster[AA_Index])
      • Set VariableSet AA_PointTarget[AA_Index] = (Target point of ability being cast)
      • Set VariableSet AA_Damage[AA_Index] = (10.00 + (25.00 x (Real((Level of Blaze for AA_Caster[AA_Index])))))
      • -------- --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AA_Index Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: ON
          • Countdown Timer - Start AA_Timer as a Repeating timer that will expire in 0.03 seconds
          • Trigger - Turn on Blaze Loop <gen>
        • Else - Actions
  • Blaze Loop
    • Events
      • Time - AA_Timer expires
    • Conditions
    • Actions
      • For each (Integer AA_Integer) from 1 to AA_Index, do (Actions)
        • Loop - Actions
          • Set VariableSet AA_Counter[AA_Integer] = (AA_Counter[AA_Integer] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AA_Counter[AA_Integer] Less than AA_CounterMax[AA_Integer]
              • (AA_Counter[AA_Integer] mod 2) Equal to 0
            • Then - Actions
              • Set VariableSet AA_PointTemp = (AA_PointTarget[AA_Integer] offset by (Random real number between 0.00 and 200.00) towards (Random angle) degrees.)
              • -------- --------
              • -------- BASE SETTINGS --------
              • Set VariableSet AA_Index2 = (AA_Index2 + 1)
              • Set VariableSet AA_Angle[AA_Index2] = (Radians((Angle from AA_PointOrigin[AA_Integer] to AA_PointTemp)))
              • Set VariableSet AA_Speed[AA_Index2] = 25.00
              • Set VariableSet AA_DistanceReached[AA_Index2] = 0.00
              • Set VariableSet AA_DistanceMax[AA_Index2] = (Distance between AA_PointOrigin[AA_Integer] and AA_PointTemp)
              • -------- HEIGHT --------
              • Set VariableSet AA_HeigthAdjustor[AA_Index2] = (Random real number between 0.10 and 0.30)
              • Set VariableSet AA_HeightReal[AA_Index2] = (AA_DistanceMax[AA_Index2] x AA_HeigthAdjustor[AA_Index2])
              • Set VariableSet AA_HeightDegree[AA_Index2] = 0.00
              • -------- --------
              • -------- X and Y AXIS --------
              • Special Effect - Create a special effect at AA_PointOrigin[AA_Integer] using Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
              • Set VariableSet AA_SFX[AA_Index2] = (Last created special effect)
              • Special Effect - Set Yaw of AA_SFX[AA_Index2] to: (AA_Angle[AA_Index2] x (Pi / 180.00))
              • -------- --------
              • Set VariableSet AA_Adjustor = (Random real number between -15.00 and 15.00)
              • Set VariableSet AA_cX[AA_Index2] = (X of AA_PointOrigin[AA_Integer])
              • Set VariableSet AA_cY[AA_Index2] = (Y of AA_PointOrigin[AA_Integer])
              • Set VariableSet AA_prevX[AA_Index2] = AA_cX[AA_Index2]
              • Set VariableSet AA_prevY[AA_Index2] = AA_cY[AA_Index2]
              • Custom script: set udg_AA_curve[udg_AA_Index2] = Tan(udg_AA_Adjustor * bj_DEGTORAD) * udg_AA_DistanceMax[udg_AA_Index2]
              • -------- --------
              • Custom script: call RemoveLocation(udg_AA_PointTemp)
            • Else - Actions
          • -------- --------
          • For each (Integer AA_Integer2) from 1 to AA_Index2, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AA_DistanceReached[AA_Integer2] Less than AA_DistanceMax[AA_Integer2]
                • Then - Actions
                  • Set VariableSet AA_DistanceReached[AA_Integer2] = (AA_DistanceReached[AA_Integer2] + AA_Speed[AA_Integer2])
                  • -------- --------
                  • -------- HEIGHT --------
                  • Set VariableSet AA_HeightDegree[AA_Integer2] = (AA_HeightDegree[AA_Integer2] + (180.00 / (AA_DistanceMax[AA_Integer2] / AA_Speed[AA_Integer2])))
                  • Set VariableSet AA_HeightReached[AA_Integer2] = ((Sin(AA_HeightDegree[AA_Integer2])) x AA_HeightReal[AA_Integer2])
                  • -------- --------
                  • -------- X and Y AXIS --------
                  • Custom script: set udg_AA_cX[udg_AA_Integer2] = udg_AA_prevX[udg_AA_Integer2] + udg_AA_Speed[udg_AA_Integer2] * Cos(udg_AA_Angle[udg_AA_Integer2])
                  • Custom script: set udg_AA_cY[udg_AA_Integer2] = udg_AA_prevY[udg_AA_Integer2] + udg_AA_Speed[udg_AA_Integer2] * Sin(udg_AA_Angle[udg_AA_Integer2])
                  • Set VariableSet AA_prevX[AA_Integer2] = AA_cX[AA_Integer2]
                  • Set VariableSet AA_prevY[AA_Integer2] = AA_cY[AA_Integer2]
                  • Custom script: set udg_AA_curveOffset = 4 * udg_AA_curve[udg_AA_Integer2] * udg_AA_DistanceReached[udg_AA_Integer2] * (udg_AA_DistanceMax[udg_AA_Integer2]-udg_AA_DistanceReached[udg_AA_Integer2]) / (udg_AA_DistanceMax[udg_AA_Integer2] * udg_AA_DistanceMax[udg_AA_Integer2])
                  • Custom script: set udg_AA_cX[udg_AA_Integer2] = udg_AA_cX[udg_AA_Integer2] + udg_AA_curveOffset * Cos(udg_AA_Angle[udg_AA_Integer2] + bj_PI / 2.0)
                  • Custom script: set udg_AA_cY[udg_AA_Integer2] = udg_AA_cY[udg_AA_Integer2] + udg_AA_curveOffset * Sin(udg_AA_Angle[udg_AA_Integer2] + bj_PI / 2.0)
                  • Custom script: set udg_AA_cYaw = udg_AA_Angle[udg_AA_Integer2] + Atan(-((4 * udg_AA_curve[udg_AA_Integer2]) * (2 * udg_AA_DistanceReached[udg_AA_Integer2] - udg_AA_DistanceMax[udg_AA_Integer2])) / (udg_AA_DistanceMax[udg_AA_Integer2] * udg_AA_DistanceMax[udg_AA_Integer2]))
                  • -------- --------
                  • Special Effect - Set Position of AA_SFX[AA_Integer2] to x: AA_cX[AA_Integer2], y: AA_cY[AA_Integer2], z: AA_HeightReached[AA_Integer2]
                  • Special Effect - Set Orientation of AA_SFX[AA_Integer2] to yaw: AA_cYaw, pitch: 0.00, roll: 0.00
                • Else - Actions
                  • Special Effect - Destroy AA_SFX[AA_Integer2]
                  • Set VariableSet AA_PointTemp = (AA_PointOrigin[AA_Integer] offset by AA_DistanceMax[AA_Integer2] towards (Degrees(AA_Angle[AA_Integer2])) degrees.)
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within 100.00 of AA_PointTemp.) and do (Actions)
                    • Loop - Actions
                      • Set VariableSet AA_Unit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (AA_Unit is alive) Equal to True
                          • (AA_Unit is A structure) Equal to False
                          • (AA_Unit belongs to an enemy of (Owner of AA_Caster[AA_Integer]).) Equal to True
                        • Then - Actions
                          • Unit - Cause AA_Caster[AA_Integer] to damage AA_Unit, dealing AA_Damage[AA_Integer] damage of attack type Spells and damage type Magic
                        • Else - Actions
                  • Custom script: call RemoveLocation(udg_AA_PointTemp)
                  • -------- --------
                  • Set VariableSet AA_Angle[AA_Integer2] = AA_Angle[AA_Index2]
                  • Set VariableSet AA_Speed[AA_Integer2] = AA_Speed[AA_Index2]
                  • Set VariableSet AA_DistanceReached[AA_Integer2] = AA_DistanceReached[AA_Index2]
                  • Set VariableSet AA_DistanceMax[AA_Integer2] = AA_DistanceMax[AA_Index2]
                  • Set VariableSet AA_HeigthAdjustor[AA_Integer2] = AA_HeigthAdjustor[AA_Index2]
                  • Set VariableSet AA_HeightReal[AA_Integer2] = AA_HeightReal[AA_Index2]
                  • Set VariableSet AA_HeightDegree[AA_Integer2] = AA_HeightDegree[AA_Index2]
                  • Set VariableSet AA_SFX[AA_Integer2] = AA_SFX[AA_Index2]
                  • Set VariableSet AA_cX[AA_Integer2] = AA_cX[AA_Index2]
                  • Set VariableSet AA_cY[AA_Integer2] = AA_cY[AA_Index2]
                  • Set VariableSet AA_prevX[AA_Integer2] = AA_prevX[AA_Index2]
                  • Set VariableSet AA_prevY[AA_Integer2] = AA_prevY[AA_Index2]
                  • Set VariableSet AA_curve[AA_Integer2] = AA_curve[AA_Index2]
                  • -------- --------
                  • Set VariableSet AA_Index2 = (AA_Index2 - 1)
                  • Set VariableSet AA_Integer2 = (AA_Integer2 - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • AA_Index2 Equal to 0
                    • Then - Actions
                      • -------- TBD? --------
                    • Else - Actions
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AA_Counter[AA_Integer] Greater than or equal to AA_CounterMax[AA_Integer]
              • AA_Index2 Equal to 0
            • Then - Actions
              • Custom script: call RemoveLocation(udg_AA_PointOrigin[udg_AA_Integer])
              • Custom script: call RemoveLocation(udg_AA_PointTarget[udg_AA_Integer])
              • -------- --------
              • Set VariableSet AA_Caster[AA_Integer] = AA_Caster[AA_Index]
              • Set VariableSet AA_Counter[AA_Integer] = AA_Counter[AA_Index]
              • Set VariableSet AA_CounterMax[AA_Integer] = AA_CounterMax[AA_Index]
              • Set VariableSet AA_PointOrigin[AA_Integer] = AA_PointOrigin[AA_Index]
              • Set VariableSet AA_PointTarget[AA_Integer] = AA_PointTarget[AA_Index]
              • Set VariableSet AA_Damage[AA_Integer] = AA_Damage[AA_Index]
              • -------- --------
              • Set VariableSet AA_Index = (AA_Index - 1)
              • Set VariableSet AA_Integer = (AA_Integer - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AA_Index Equal to 0
                • Then - Actions
                  • Game - Display to (All players) the text: OFF
                  • Countdown Timer - Pause AA_Timer
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

EDIT: Attached the adjusted trigger, maybe this is useful to someone.
 

Attachments

  • CurveTest2.w3x
    27.2 KB · Views: 16
Last edited:
Top