• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Wait To Distance Seconds

Status
Not open for further replies.
Level 24
Joined
May 15, 2013
Messages
3,782
Hello Hivers, I'm working on another spell, this one in particular is kinda like in Dota's Lich Last Skill, that bouncy ice thing that hits enemies. Now, this one's base spell is a Firebolt, once cast, waiting until it hits the target, will hit another random enemy unit within the range of 800, has four bounces.

Problem is; the waiting. I kinda think there is some sort of math in calculating or converting the distance between the caster and the enemy into seconds. But I have no idea how? Anybody can help?

  • FB Set
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frostbite
    • Actions
      • Set FB_Caster = (Casting unit)
      • Set FB_Targets[1] = (Target unit of ability being cast)
      • Set FB_Position[1] = (Position of FB_Targets[1])
      • Set FB_Damage = 400.00
      • Wait 1.00 seconds
      • Set FB_Targets[2] = (Random unit from (Units within 800.00 of FB_Position[1] matching ((((Matching unit) belongs to an enemy of (Owner of FB_Caster)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to FB_Targets[2])))))
      • Set FB_Position[2] = (Position of FB_Targets[2])
      • Unit - Create 1 Dummy (Frostbite Caster) for (Owner of FB_Caster) at FB_Position[1] facing Default building facing degrees
      • Set FB_Dummies[1] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[1] to Neutral - Firebolt FB_Targets[2]
      • Unit - Create 1 Dummy (Frostbite Nova) for (Owner of FB_Caster) at FB_Position[1] facing Default building facing degrees
      • Set FB_Dummies[2] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[2] to Undead Lich - Frost Nova FB_Targets[1]
      • Unit - Cause FB_Caster to damage FB_Targets[1], dealing FB_Damage damage of attack type Spells and damage type Cold
      • Wait 1.00 seconds
      • Set FB_Targets[3] = (Random unit from (Units within 800.00 of FB_Position[2] matching ((((Matching unit) belongs to an enemy of (Owner of FB_Caster)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to FB_Targets[3])))))
      • Set FB_Position[3] = (Position of FB_Targets[3])
      • Unit - Create 1 Dummy (Frostbite Caster) for (Owner of FB_Caster) at FB_Position[2] facing Default building facing degrees
      • Set FB_Dummies[3] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[3] to Neutral - Firebolt FB_Targets[3]
      • Unit - Create 1 Dummy (Frostbite Nova) for (Owner of FB_Caster) at FB_Position[2] facing Default building facing degrees
      • Set FB_Dummies[4] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[4] to Undead Lich - Frost Nova FB_Targets[2]
      • Unit - Cause FB_Caster to damage FB_Targets[2], dealing (FB_Damage - 50.00) damage of attack type Spells and damage type Cold
      • Wait 1.00 seconds
      • Set FB_Targets[4] = (Random unit from (Units within 800.00 of FB_Position[3] matching ((((Matching unit) belongs to an enemy of (Owner of FB_Caster)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to FB_Targets[4])))))
      • Set FB_Position[4] = (Position of FB_Targets[4])
      • Unit - Create 1 Dummy (Frostbite Caster) for (Owner of FB_Caster) at FB_Position[3] facing Default building facing degrees
      • Set FB_Dummies[5] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[5] to Neutral - Firebolt FB_Targets[4]
      • Unit - Create 1 Dummy (Frostbite Nova) for (Owner of FB_Caster) at FB_Position[3] facing Default building facing degrees
      • Set FB_Dummies[6] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[6] to Undead Lich - Frost Nova FB_Targets[3]
      • Unit - Cause FB_Caster to damage FB_Targets[3], dealing (FB_Damage - 100.00) damage of attack type Spells and damage type Cold
      • Wait 1.00 seconds
      • Set FB_Targets[5] = (Random unit from (Units within 800.00 of FB_Position[4] matching ((((Matching unit) belongs to an enemy of (Owner of FB_Caster)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to FB_Targets[5])))))
      • Set FB_Position[5] = (Position of FB_Targets[5])
      • Unit - Create 1 Dummy (Frostbite Caster) for (Owner of FB_Caster) at FB_Position[4] facing Default building facing degrees
      • Set FB_Dummies[7] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[7] to Neutral - Firebolt FB_Targets[5]
      • Unit - Create 1 Dummy (Frostbite Nova) for (Owner of FB_Caster) at FB_Position[4] facing Default building facing degrees
      • Set FB_Dummies[8] = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order FB_Dummies[8] to Undead Lich - Frost Nova FB_Targets[4]
      • Unit - Cause FB_Caster to damage FB_Targets[4], dealing (FB_Damage - 150.00) damage of attack type Spells and damage type Cold
      • Wait 1.00 seconds
      • Unit - Cause FB_Caster to damage FB_Targets[5], dealing (FB_Damage - 200.00) damage of attack type Spells and damage type Cold
      • Custom script: call RemoveLocation(udg_FB_Position[1])
      • Custom script: call RemoveLocation(udg_FB_Position[2])
      • Custom script: call RemoveLocation(udg_FB_Position[3])
      • Custom script: call RemoveLocation(udg_FB_Position[4])
      • Custom script: call RemoveLocation(udg_FB_Position[5])
 
Level 28
Joined
Sep 26, 2009
Messages
2,516
There's no such thing. You will do better to create a dummy unit to imitate the fiery ball and move it towards the target.
Unless your target is static. Then you can easily compute the time it takes for the ball to fly to the target.
If the target is not static then there's simply no way to calculate it. Imagine the following scenario:
1) You cast Fire ball
2) You compute time. Time = distance_between_A_and_B / projectile_speed... let's say you get that Time = 2.00 seconds.
3) After 0.5 seconds since you shot the projectile, the target moves:
a) moves towards caster​
b) moves away from caster​
c) blinks towards caster​
d) moves to any other direction​

Now in case a) and c) your spell will cause some effect after the projectile hits the target, in case b) it will cause the effect before the projectile hits the target and in case d) it will be some completely random time.

Hence why you need a dummy unit. With dummy unit you can do the following:
1) Check distance between dummy and target
2) If dummy is close enough, cause effect, else move dummy towards target by certain distance

The downside is that you don't use native functionality of WCIII, but instead a workaround, but the good things is that this is the best way to do it.

Of course there are some other options like damage detection, etc., however you will either need a very complicated DDS that can differentiate between various attacks (e.g. fire, poison, and so on) or limit yourself (make this spell the only spell that deals spell damage and other spells will deal physical damage, etc.)
 
Level 13
Joined
Jan 2, 2016
Messages
978
Of course there are some other options like damage detection, etc., however you will either need a very complicated DDS that can differentiate between various attacks (e.g. fire, poison, and so on) or limit yourself (make this spell the only spell that deals spell damage and other spells will deal physical damage, etc.)
He could add a custom buff to the spell and the trigger will be quite simple:
a unit takes damage, conditions "damaged unit has the custom buff", actions:
remove the buff and set some boolean to "true".
Have the original trigger have a "wait for condition: boolean get value true"
then set the value back to false and begin the next jump.
 
You're better off triggering the whole thing.

I'm pretty sure Nichilus explained it in his post, but this is how I calculate time on a non-static target: velocity = distance / time. This makes it so that no matter the distance between the missle and target, it will always take TimeToHit seconds to reach the target. PeriodicTimer is whatever your loop timer is set to.

  • Set TimePassed[LoopInt] = (TimePassed[LoopInt] + PeriodicTimer)
  • Set CurrentLoc = (Position of Dummy)
  • Set TargetLoc = (Position of Target)
  • Set Angle = (Angle from CurrentLoc to TargetLoc)
  • Set Distance = (Distance between CurrentLoc and TargetLoc)
  • Set Velocity = (Distance / ((TimeToHit - TimePassed[LoopInt]) / PeriodicTimer))
  • Set NewLoc = (CurrentLoc offset by Velocity towards Angle degrees)
  • Unit - Move Dummy instantly to NewLoc

Also, I think this should be in Triggers & Scripts xP
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I want to add that it is possible to calculate the time even with nonstatic units, but its not done in one calculation, since you dont know at what speed will the target move and where will he move. You can however re-compute it every time you move your projectile, but yes this is highly impractical and using dds for this would probably yield much better effects
 
A DDS is not the best solution here as, while PDD and Damage Engine can tell if the damage was physical or from a spell, neither can tell which spell it was that damaged them. The only way to keep track of which units cast the spell is to have dummy units cast the spells, then index the ID of the ability and the caster to the dummy unit.

Sound complex? It is. I would rather use a missile system if I were in your shoes, as it keeps things completely under your control.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
The downside is that you don't use native functionality of WCIII, but instead a workaround, but the good things is that this is the best way to do it.
"The upside is that you don't use native functionality of WCIII, but instead a workaround,"
Fixed it for you ;)

About the damage detection, you can always do this.

I suppose that some missile systems can just use the exact same missile to bounce... at least mine can.
 
Level 24
Joined
May 15, 2013
Messages
3,782
  • FB Confingure
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Ability --------
      • Set FB_Ability = Frostbite (New)
      • -------- Dummy type --------
      • Set FB_DummyType = Dummy (Frostbite)
      • -------- Projectile model --------
      • Set FB_Model = Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
      • -------- Number of Bounce --------
      • Set FB_Bounce[FB_TempIndex] = 4
      • -------- Range for next Bounce --------
      • Set FB_BounceAoE[FB_TempIndex] = 500.00
      • -------- Damage per Bounce --------
      • Set FB_DamagePerBounce[FB_TempIndex] = 200.00
      • -------- Damage Addition per Bounce --------
      • Set FB_DamageAddition[FB_TempIndex] = 25.00
      • -------- Speed for Projectile --------
      • Set FB_Speed[FB_TempIndex] = (500.00 / 0.03)
      • -------- Max Height for Projectile --------
      • Set FB_Height[FB_TempIndex] = 400.00
      • -------- Dummy Ability --------
      • Set FB_AdditionalAbility = Frostbite (Dummy)
      • -------- Damage type --------
      • Set FB_DamageType = Normal
      • -------- Attack type --------
      • Set FB_AttackType = Spells
      • -------- Preloading --------
      • Set FB_TempPoint = (Center of (Playable map area))
      • Unit - Create 1 Dummy (Frostbite) for Neutral Passive at FB_TempPoint facing Default building facing degrees
      • Set FB_PreloadUnit = (Last created unit)
      • Unit - Add FB_AdditionalAbility to FB_PreloadUnit
      • Unit - Remove FB_AdditionalAbility from FB_PreloadUnit
      • Custom script: call RemoveLocation (udg_FB_TempPoint)
  • FB Ini
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FB_Ability
    • Actions
      • Set FB_MaxIndex = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FB_MaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn on FB Loop <gen>
        • Else - Actions
      • Set FB_MaxIndex = (FB_MaxIndex + 1)
      • Set FB_Caster[FB_MaxIndex] = (Triggering unit)
      • Set FB_Target[FB_MaxIndex] = (Target unit of ability being cast)
      • Set FB_DistanceTravelled[FB_MaxIndex] = 0.00
      • Set FB_DamagePerBounce[FB_MaxIndex] = FB_DamagePerBounce[FB_MaxIndex]
      • Set FB_CurrentBounces[FB_MaxIndex] = 0
      • Set FB_Player[FB_MaxIndex] = (Triggering player)
      • Set FB_TempPoint2 = (Position of FB_Caster[FB_MaxIndex])
      • Set FB_TempPoint3 = (Position of FB_Target[FB_MaxIndex])
      • Set FB_Angle[FB_MaxIndex] = (Angle from FB_TempPoint2 to FB_TempPoint3)
      • -------- xxx --------
      • Unit - Create 1 FB_DummyType for FB_Player[FB_MaxIndex] at FB_TempPoint2 facing FB_Angle[FB_MaxIndex] degrees
      • Set FB_Dummy[FB_MaxIndex] = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of FB_Dummy[FB_MaxIndex] using FB_Model
      • Set FB_FX[FB_MaxIndex] = (Last created special effect)
      • Unit - Add FB_AdditionalAbility to FB_Dummy[FB_MaxIndex]
      • Custom script: call RemoveLocation(udg_FB_TempPoint2)
      • Custom script: call RemoveLocation(udg_FB_TempPoint3)
  • FB Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FB_TempIndex) from 1 to FB_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FB_CurrentBounces[FB_TempIndex] Less than or equal to FB_Bounce[FB_TempIndex]
            • Then - Actions
              • Set FB_TempPoint3 = (Position of FB_Target[FB_TempIndex])
              • Set FB_TempPoint2 = (Position of FB_Dummy[FB_TempIndex])
              • Set FB_Distance[FB_TempIndex] = (Distance between FB_TempPoint3 and FB_TempPoint2)
              • Set FB_DistanceTravelled[FB_TempIndex] = (FB_DistanceTravelled[FB_TempIndex] + FB_Speed[FB_TempIndex])
              • Set FB_TotalDistance = (FB_DistanceTravelled[FB_TempIndex] + FB_Distance[FB_TempIndex])
              • Set FB_Angle[FB_TempIndex] = (Angle from FB_TempPoint2 to FB_TempPoint3)
              • Set FB_TempPoint = (FB_TempPoint2 offset by FB_Speed[FB_TempIndex] towards FB_Angle[FB_TempIndex] degrees)
              • Animation - Change FB_Dummy[FB_TempIndex] flying height to ((4.00 x FB_Height[FB_TempIndex]) x (FB_Height[FB_TempIndex] x ((FB_TotalDistance - FB_DistanceTravelled[FB_TempIndex]) / (FB_TotalDistance x FB_TotalDistance)))) at FB_Height[FB_TempIndex]
              • Unit - Move FB_Dummy[FB_TempIndex] instantly to FB_TempPoint, facing FB_Angle[FB_TempIndex] degrees
              • -------- xxx --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FB_Distance[FB_TempIndex] Less than or equal to 50.00
                • Then - Actions
                  • Unit - Cause FB_Caster[FB_TempIndex] to damage FB_Target[FB_TempIndex], dealing FB_DamagePerBounce[FB_TempIndex] damage of attack type FB_AttackType and damage type FB_DamageType
                  • -------- xxx --------
                  • Unit - Order FB_Dummy[FB_TempIndex] to Undead Lich - Frost Nova FB_Target[FB_TempIndex]
                  • Set FB_Group = (Units within FB_BounceAoE[FB_TempIndex] of FB_TempPoint2)
                  • -------- Getting a new target --------
                  • Unit Group - Pick every unit in BE_Group and do (Actions)
                    • Loop - Actions
                      • Set FB_PickedUnits = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (FB_PickedUnits is A structure) Equal to False
                          • (FB_PickedUnits is alive) Equal to True
                          • FB_PickedUnits Not equal to FB_Target[FB_TempIndex]
                        • Then - Actions
                        • Else - Actions
                          • Unit Group - Remove FB_PickedUnits from FB_Group
                  • -------- xxx --------
                  • Set FB_GroupCheck = (Number of units in FB_Group)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • FB_GroupCheck Equal to 0
                    • Then - Actions
                      • Set FB_CurrentBounces[FB_TempIndex] = FB_Bounce[FB_TempIndex]
                    • Else - Actions
                  • Set FB_Target[FB_TempIndex] = (Random unit from FB_Group)
                  • -------- Preparing for the next bounce. --------
                  • Animation - Change FB_Dummy[FB_TempIndex]'s size to (100.00%, 100.00%, 100.00%) of its original size
                  • Set FB_DamagePerBounce[FB_TempIndex] = (FB_DamagePerBounce[FB_TempIndex] + FB_DamageAddition[FB_TempIndex])
                  • Set FB_CurrentBounces[FB_TempIndex] = (FB_CurrentBounces[FB_TempIndex] + 1)
                  • Custom script: call DestroyGroup(udg_FB_Group)
                • Else - Actions
              • Custom script: call RemoveLocation(udg_FB_TempPoint)
              • Custom script: call RemoveLocation(udg_FB_TempPoint2)
              • Custom script: call RemoveLocation(udg_FB_TempPoint3)
            • Else - Actions
              • -------- Deindexing --------
              • Special Effect - Destroy FB_FX[FB_TempIndex]
              • Set FB_FX[FB_TempIndex] = FB_FX[FB_MaxIndex]
              • Unit - Kill FB_Dummy[FB_TempIndex]
              • Set FB_Dummy[FB_TempIndex] = FB_Dummy[FB_MaxIndex]
              • Set FB_Target[FB_TempIndex] = FB_Target[FB_MaxIndex]
              • Set FB_Caster[FB_TempIndex] = FB_Caster[FB_MaxIndex]
              • Set FB_Player[FB_TempIndex] = FB_Player[FB_MaxIndex]
              • Set FB_CurrentBounces[FB_TempIndex] = FB_CurrentBounces[BE_MaxIndex]
              • Set FB_Angle[FB_TempIndex] = FB_Angle[BE_MaxIndex]
              • Set FB_Distance[FB_TempIndex] = FB_Distance[FB_MaxIndex]
              • Set FB_DistanceTravelled[FB_TempIndex] = FB_DistanceTravelled[FB_MaxIndex]
              • Set FB_TempIndex = (FB_MaxIndex - 1)
              • Set FB_MaxIndex = (FB_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FB_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off FB Loop <gen>
                • Else - Actions
Well, I've taken a look at the Bouncing Energy, then done some editing on it, to make it a Frostbite. Problem is, nothing happens when casted, any ideas?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
A DDS is not the best solution here as, while PDD and Damage Engine can tell if the damage was physical or from a spell, neither can tell which spell it was that damaged them. The only way to keep track of which units cast the spell is to have dummy units cast the spells, then index the ID of the ability and the caster to the dummy unit.

Sound complex? It is. I would rather use a missile system if I were in your shoes, as it keeps things completely under your control.
It does not need to be 100% accurate. It just has to be mostly accurate. If it breaks because the unit is hit with 2 spells in a short time then it is not really a big deal as the chances of that happening are insignificant.
 
  • FB Confingure
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Ability --------
      • Set FB_Ability = Frostbite (New)
      • -------- Dummy type --------
      • Set FB_DummyType = Dummy (Frostbite)
      • -------- Projectile model --------
      • Set FB_Model = Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
      • -------- Number of Bounce --------
      • Set FB_Bounce[FB_TempIndex] = 4
      • -------- Range for next Bounce --------
      • Set FB_BounceAoE[FB_TempIndex] = 500.00
      • -------- Damage per Bounce --------
      • Set FB_DamagePerBounce[FB_TempIndex] = 200.00
      • -------- Damage Addition per Bounce --------
      • Set FB_DamageAddition[FB_TempIndex] = 25.00
      • -------- Speed for Projectile --------
      • Set FB_Speed[FB_TempIndex] = (500.00 / 0.03)
      • -------- Max Height for Projectile --------
      • Set FB_Height[FB_TempIndex] = 400.00
      • -------- Dummy Ability --------
      • Set FB_AdditionalAbility = Frostbite (Dummy)
      • -------- Damage type --------
      • Set FB_DamageType = Normal
      • -------- Attack type --------
      • Set FB_AttackType = Spells
      • -------- Preloading --------
      • Set FB_TempPoint = (Center of (Playable map area))
      • Unit - Create 1 Dummy (Frostbite) for Neutral Passive at FB_TempPoint facing Default building facing degrees
      • Set FB_PreloadUnit = (Last created unit)
      • Unit - Add FB_AdditionalAbility to FB_PreloadUnit
      • Unit - Remove FB_AdditionalAbility from FB_PreloadUnit
      • Custom script: call RemoveLocation (udg_FB_TempPoint)
  • FB Ini
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FB_Ability
    • Actions
      • Set FB_MaxIndex = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FB_MaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn on FB Loop <gen>
        • Else - Actions
      • Set FB_MaxIndex = (FB_MaxIndex + 1)
      • Set FB_Caster[FB_MaxIndex] = (Triggering unit)
      • Set FB_Target[FB_MaxIndex] = (Target unit of ability being cast)
      • Set FB_DistanceTravelled[FB_MaxIndex] = 0.00
      • Set FB_DamagePerBounce[FB_MaxIndex] = FB_DamagePerBounce[FB_MaxIndex]
      • Set FB_CurrentBounces[FB_MaxIndex] = 0
      • Set FB_Player[FB_MaxIndex] = (Triggering player)
      • Set FB_TempPoint2 = (Position of FB_Caster[FB_MaxIndex])
      • Set FB_TempPoint3 = (Position of FB_Target[FB_MaxIndex])
      • Set FB_Angle[FB_MaxIndex] = (Angle from FB_TempPoint2 to FB_TempPoint3)
      • -------- xxx --------
      • Unit - Create 1 FB_DummyType for FB_Player[FB_MaxIndex] at FB_TempPoint2 facing FB_Angle[FB_MaxIndex] degrees
      • Set FB_Dummy[FB_MaxIndex] = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of FB_Dummy[FB_MaxIndex] using FB_Model
      • Set FB_FX[FB_MaxIndex] = (Last created special effect)
      • Unit - Add FB_AdditionalAbility to FB_Dummy[FB_MaxIndex]
      • Custom script: call RemoveLocation(udg_FB_TempPoint2)
      • Custom script: call RemoveLocation(udg_FB_TempPoint3)
  • FB Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FB_TempIndex) from 1 to FB_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FB_CurrentBounces[FB_TempIndex] Less than or equal to FB_Bounce[FB_TempIndex]
            • Then - Actions
              • Set FB_TempPoint3 = (Position of FB_Target[FB_TempIndex])
              • Set FB_TempPoint2 = (Position of FB_Dummy[FB_TempIndex])
              • Set FB_Distance[FB_TempIndex] = (Distance between FB_TempPoint3 and FB_TempPoint2)
              • Set FB_DistanceTravelled[FB_TempIndex] = (FB_DistanceTravelled[FB_TempIndex] + FB_Speed[FB_TempIndex])
              • Set FB_TotalDistance = (FB_DistanceTravelled[FB_TempIndex] + FB_Distance[FB_TempIndex])
              • Set FB_Angle[FB_TempIndex] = (Angle from FB_TempPoint2 to FB_TempPoint3)
              • Set FB_TempPoint = (FB_TempPoint2 offset by FB_Speed[FB_TempIndex] towards FB_Angle[FB_TempIndex] degrees)
              • Animation - Change FB_Dummy[FB_TempIndex] flying height to ((4.00 x FB_Height[FB_TempIndex]) x (FB_Height[FB_TempIndex] x ((FB_TotalDistance - FB_DistanceTravelled[FB_TempIndex]) / (FB_TotalDistance x FB_TotalDistance)))) at FB_Height[FB_TempIndex]
              • Unit - Move FB_Dummy[FB_TempIndex] instantly to FB_TempPoint, facing FB_Angle[FB_TempIndex] degrees
              • -------- xxx --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FB_Distance[FB_TempIndex] Less than or equal to 50.00
                • Then - Actions
                  • Unit - Cause FB_Caster[FB_TempIndex] to damage FB_Target[FB_TempIndex], dealing FB_DamagePerBounce[FB_TempIndex] damage of attack type FB_AttackType and damage type FB_DamageType
                  • -------- xxx --------
                  • Unit - Order FB_Dummy[FB_TempIndex] to Undead Lich - Frost Nova FB_Target[FB_TempIndex]
                  • Set FB_Group = (Units within FB_BounceAoE[FB_TempIndex] of FB_TempPoint2)
                  • -------- Getting a new target --------
                  • Unit Group - Pick every unit in BE_Group and do (Actions)
                    • Loop - Actions
                      • Set FB_PickedUnits = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (FB_PickedUnits is A structure) Equal to False
                          • (FB_PickedUnits is alive) Equal to True
                          • FB_PickedUnits Not equal to FB_Target[FB_TempIndex]
                        • Then - Actions
                        • Else - Actions
                          • Unit Group - Remove FB_PickedUnits from FB_Group
                  • -------- xxx --------
                  • Set FB_GroupCheck = (Number of units in FB_Group)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • FB_GroupCheck Equal to 0
                    • Then - Actions
                      • Set FB_CurrentBounces[FB_TempIndex] = FB_Bounce[FB_TempIndex]
                    • Else - Actions
                  • Set FB_Target[FB_TempIndex] = (Random unit from FB_Group)
                  • -------- Preparing for the next bounce. --------
                  • Animation - Change FB_Dummy[FB_TempIndex]'s size to (100.00%, 100.00%, 100.00%) of its original size
                  • Set FB_DamagePerBounce[FB_TempIndex] = (FB_DamagePerBounce[FB_TempIndex] + FB_DamageAddition[FB_TempIndex])
                  • Set FB_CurrentBounces[FB_TempIndex] = (FB_CurrentBounces[FB_TempIndex] + 1)
                  • Custom script: call DestroyGroup(udg_FB_Group)
                • Else - Actions
              • Custom script: call RemoveLocation(udg_FB_TempPoint)
              • Custom script: call RemoveLocation(udg_FB_TempPoint2)
              • Custom script: call RemoveLocation(udg_FB_TempPoint3)
            • Else - Actions
              • -------- Deindexing --------
              • Special Effect - Destroy FB_FX[FB_TempIndex]
              • Set FB_FX[FB_TempIndex] = FB_FX[FB_MaxIndex]
              • Unit - Kill FB_Dummy[FB_TempIndex]
              • Set FB_Dummy[FB_TempIndex] = FB_Dummy[FB_MaxIndex]
              • Set FB_Target[FB_TempIndex] = FB_Target[FB_MaxIndex]
              • Set FB_Caster[FB_TempIndex] = FB_Caster[FB_MaxIndex]
              • Set FB_Player[FB_TempIndex] = FB_Player[FB_MaxIndex]
              • Set FB_CurrentBounces[FB_TempIndex] = FB_CurrentBounces[BE_MaxIndex]
              • Set FB_Angle[FB_TempIndex] = FB_Angle[BE_MaxIndex]
              • Set FB_Distance[FB_TempIndex] = FB_Distance[FB_MaxIndex]
              • Set FB_DistanceTravelled[FB_TempIndex] = FB_DistanceTravelled[FB_MaxIndex]
              • Set FB_TempIndex = (FB_MaxIndex - 1)
              • Set FB_MaxIndex = (FB_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FB_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off FB Loop <gen>
                • Else - Actions
Well, I've taken a look at the Bouncing Energy, then done some editing on it, to make it a Frostbite. Problem is, nothing happens when casted, any ideas?

You're using the loop integer as an index in the Config section, resulting in Variable[0]. They are supposed to be "levels", so if you wanted it to support 3 levels, you would have to do something like this:
  • Set Damage[1] = 50
  • Set Damage[2] = 75
  • Set Damage[3] = 125

This also doesn't look right on cast:
  • Set FB_DamagePerBounce[FB_MaxIndex] = FB_DamagePerBounce[FB_MaxIndex]
 
Status
Not open for further replies.
Top