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

Unit group

Status
Not open for further replies.
loop should be .03 not .04

u never reduce the arcaneleafperiod ?
the if condition will never fire.

I did, somewhere near the end. I've found the problem: when I remove the 'set Temp_Int = Temp_Int - 1' then it works. So basically I have to finish the intire index structure to fix the small random 'bugs'.

Why is 0.03 better than 0.04?

Edit: ok my spell is done. Kind of. I still need to turn it off though. I think it has a very bad leak(s) because my pc lag while a spell is running. Some of the Life Rays doesn't get to their destenation and just stands frozen on the map.
  • Arcane leaf loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Temp_Int) from 1 to iArcaneLeafindex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • iArcaneLeafPeriod[Temp_Int] Equal to 0
              • (uArcaneLeafT[Temp_Int] is paused) Equal to False
            • Then - Actions
              • Set iArcaneLeafCount[Temp_Int] = (iArcaneLeafCount[Temp_Int] - 1)
              • Set iArcaneLeafPeriod[Temp_Int] = 25
              • Set Temp_Player = (Owner of uArcaneLeafC[Temp_Int])
              • Set Temp_Point = (Position of uArcaneLeafT[Temp_Int])
              • Set Temp_Real = ((Life of uArcaneLeafT[Temp_Int]) x 0.07)
              • Unit - Cause uArcaneLeafC[Temp_Int] to damage uArcaneLeafT[Temp_Int], dealing Temp_Real damage of attack type Spells and damage type Normal
              • Set Temp_Goup = (Units within 500.00 of Temp_Point matching (((Owner of (Matching unit)) is an ally of Temp_Player) Equal to True))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Temp_Goup) Greater than 0
                • Then - Actions
                  • Set iLifeRayIndex = (iLifeRayIndex + 1)
                  • Unit - Create 1 Life seed for Temp_Player at Temp_Point facing Default building facing degrees
                  • Set uLifeRayC[iLifeRayIndex] = (Last created unit)
                  • Set uLifeRayT[iLifeRayIndex] = (Random unit from Temp_Goup)
                  • Set rLifeRayHeal[iLifeRayIndex] = Temp_Real
                • Else - Actions
              • Custom script: call DestroyGroup(GetLastCreatedGroup())
              • Custom script: call RemoveLocation(udg_Temp_Point)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (uArcaneNovaC[Temp_Int] is paused) Equal to False
                • Then - Actions
                  • Set iArcaneLeafPeriod[Temp_Int] = (iArcaneLeafPeriod[Temp_Int] - 1)
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (iArcaneLeafCount[Temp_Int] Equal to 0) or ((uArcaneLeafC[Temp_Int] is dead) Equal to True)
            • Then - Actions
              • Set uArcaneLeafC[Temp_Int] = uArcaneLeafC[iArcaneLeafindex]
              • Set uArcaneLeafC[iArcaneLeafindex] = No unit
              • Set uArcaneLeafT[Temp_Int] = uArcaneLeafT[iArcaneLeafindex]
              • Set uArcaneLeafT[iArcaneLeafindex] = No unit
              • Set iArcaneLeafCount[Temp_Int] = iArcaneLeafCount[iArcaneLeafindex]
              • Set iArcaneLeafCount[iArcaneLeafindex] = 0
              • Set iArcaneLeafPeriod[Temp_Int] = iArcaneLeafPeriod[iArcaneLeafindex]
              • Set iArcaneLeafPeriod[iArcanePulseIndex] = 0
              • Set Temp_Int = (Temp_Int - 1)
            • Else - Actions
      • If (iLifeRayIndex Equal to 0) then do (Skip remaining actions) else do (Do nothing)
      • For each (Integer Temp_Int) from 1 to iLifeRayIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (uLifeRayC[Temp_Int] is paused) Equal to False
            • Then - Actions
              • Set Temp_Point = (Position of uLifeRayC[Temp_Int])
              • Set Temp_Point2 = (Position of uLifeRayT[Temp_Int])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Temp_Point and Temp_Point2) Less than 25.00
                • Then - Actions
                  • Unit - Kill uLifeRayC[Temp_Int]
                  • Unit - Set life of uLifeRayT[Temp_Int] to ((Life of uLifeRayT[Temp_Int]) + rLifeRayHeal[Temp_Int])
                  • Set uLifeRayC[Temp_Int] = uLifeRayC[iLifeRayIndex]
                  • Set uLifeRayC[iLifeRayIndex] = No unit
                  • Set uLifeRayT[Temp_Int] = uLifeRayT[iLifeRayIndex]
                  • Set uLifeRayT[iLifeRayIndex] = No unit
                  • Set rLifeRayHeal[Temp_Int] = rLifeRayHeal[iLifeRayIndex]
                  • Set rLifeRayHeal[iLifeRayIndex] = 0.00
                  • Set Temp_Int = (Temp_Int - 1)
                • Else - Actions
                  • Set Temp_Real = (Angle from Temp_Point to Temp_Point2)
                  • Custom script: call RemoveLocation(udg_Temp_Point2)
                  • Set Temp_Point2 = (Temp_Point offset by 10.00 towards Temp_Real degrees)
                  • Unit - Move uLifeRayC[Temp_Int] instantly to Temp_Point
                  • Custom script: call RemoveLocation(udg_Temp_Point)
                  • Custom script: call RemoveLocation(udg_Temp_Point2)
            • Else - Actions
This spell is suppose to drain a portion life from a target enemy unit and if there are a nearby ally, the Life Ray will go to him and increase his HP.
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
.04 can be seen by a player. .03 is to fast to be seen. its right on the edge. so .03 will look better in the long run and provide a closer time limit.

u see what ur missing here ?
  • Set uArcaneLeafC[Temp_Int] = uArcaneLeafC[iArcaneLeafindex]
  • Set uArcaneLeafC[iArcaneLeafindex] = No unit
  • Set uArcaneLeafT[Temp_Int] = uArcaneLeafT[iArcaneLeafindex]
  • Set uArcaneLeafT[iArcaneLeafindex] = No unit
  • Set iArcaneLeafCount[Temp_Int] = iArcaneLeafCount[iArcaneLeafindex]
  • Set iArcaneLeafCount[iArcaneLeafindex] = 0
  • Set iArcaneLeafPeriod[Temp_Int] = iArcaneLeafPeriod[iArcaneLeafindex]
  • Set iArcaneLeafPeriod[iArcanePulseIndex] = 0
  • Set Temp_Int = (Temp_Int - 1)
 
Status
Not open for further replies.
Top