• 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.

[Solved] Blink Strike

Status
Not open for further replies.
Hello all, i dont normally have a problem with this spell. But it is quite old, so i thought i would go back to it on my computer and try and make it better.

So its Blink Strike (an old concept i know)
Basically Deals 150 base damge + 15 x (level of ability)
Level 1 - Attacks one unit
Level 2 - Attacks two units
Level 3 - Attacks three units

So i have made the trigger, and it runs smoothly, but the problem i get is it doesn't seem to be able to be casted again once it has been cast.
Here are the triggers...
  • Blink Strike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blink Strike
    • Actions
      • -------- --------
      • -------- VARIABLE START --------
      • Set Key = (Custom value of (Triggering unit))
      • Set SpellIndex = (SpellIndex + 1)
      • Set Caster[Key] = (Triggering unit)
      • Set Target[Key] = (Target unit of ability being cast)
      • Set SpellPower[Key] = (Level of Blink Strike for Caster[Key])
      • Set Damage[Key] = ((15.00 x (Real(SpellPower[Key]))) + 150.00)
      • Set Angle[Key] = (Random angle)
      • Set Distance[Key] = 0.00
      • Set SpellRan[Key] = True
      • Set BS_LoopStrikes[Key] = 0
      • Set BS_MaxLoopStrikes[Key] = SpellPower[Key]
      • Unit Group - Add Caster[Key] to SpellGroup
      • -------- --------
      • -------- VARIABLE FINISH --------
      • Trigger - Turn on Blink Strike loop <gen>
  • Blink Strike loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SpellGroup and do (Actions)
        • Loop - Actions
          • Set TempKey = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SpellRan[TempKey] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BS_LoopStrikes[TempKey] Less than BS_MaxLoopStrikes[TempKey]
                • Then - Actions
                  • Set BS_LoopStrikes[TempKey] = (BS_LoopStrikes[TempKey] + 1)
                  • Set TempPoint = (Position of Target[TempKey])
                  • Set TempPoint2 = (TempPoint offset by Distance[TempKey] towards Angle[TempKey] degrees)
                  • -------- Effects --------
                  • Set TempPoint3 = (Position of Caster[TempKey])
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[1]
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[2]
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TempPoint3)
                  • -------- Move Unit --------
                  • Unit - Move Caster[TempKey] instantly to TempPoint2, facing TempPoint
                  • Animation - Play Caster[TempKey]'s attack animation
                  • Unit - Cause Caster[TempKey] to damage Target[TempKey], dealing Damage[TempKey] damage of attack type Spells and damage type Normal
                  • -------- Effects --------
                  • Set TempPoint3 = (Position of Caster[TempKey])
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[1]
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[2]
                  • Special Effect - Destroy (Last created special effect)
                  • -------- Set Next Unit --------
                  • Set TempGroup = (Units within 500.00 of TempPoint3 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[Key])) Equal to True) and ((((Matching
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TempGroup is empty) Equal to True
                    • Then - Actions
                      • Custom script: call RemoveLocation(udg_TempPoint)
                      • Custom script: call RemoveLocation(udg_TempPoint2)
                      • Custom script: call RemoveLocation(udg_TempPoint3)
                      • Custom script: call DestroyGroup(udg_TempGroup)
                      • Set SpellRan[TempKey] = False
                      • Unit Group - Remove Caster[TempKey] from SpellGroup
                      • Set SpellIndex = (SpellIndex - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • SpellIndex Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (SpellGroup is empty) Equal to True
                            • Then - Actions
                              • Custom script: call DestroyGroup(udg_SpellGroup)
                            • Else - Actions
                        • Else - Actions
                    • Else - Actions
                  • Set Target[TempKey] = (Random unit from TempGroup)
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call RemoveLocation(udg_TempPoint2)
                  • Custom script: call RemoveLocation(udg_TempPoint3)
                  • Custom script: call DestroyGroup(udg_TempGroup)
                • Else - Actions
                  • Set SpellRan[TempKey] = False
                  • Unit Group - Remove Caster[TempKey] from SpellGroup
                  • Set SpellIndex = (SpellIndex - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SpellIndex Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (SpellGroup is empty) Equal to True
                        • Then - Actions
                          • Custom script: call DestroyGroup(udg_SpellGroup)
                        • Else - Actions
                    • Else - Actions
            • Else - Actions
 
You call a lot of uneeded actions. SpellInxdex is completely useless if you want this spell to work that way. However, I do not recommend using Custom values here. Better use hashtables or learn proper Indexing.

Additionaly: you do not need to call so many destroy/remove actions. Make sure the condition for turning trigger of if is out of group actions. Trigger should be able to turn off without being forced to run through so many code lines just to ensure it can shut down -.-
Use Set BS_LoopStrikes[TempKey] = BS_MaxLoopStrikes[TempKey] to end loop for given unit.

If it still doesn't work, I will make it myself, since I do not trust Custom values used like this - or you were thinking about Bribe's Unit Indexing - now we can talking ;D (but I don't see it here ;( )
  • Blink Strike loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SpellGroup and do (Actions)
        • Loop - Actions
          • Set TempKey = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SpellRan[TempKey] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BS_LoopStrikes[TempKey] Less than BS_MaxLoopStrikes[TempKey]
                • Then - Actions
                  • Set BS_LoopStrikes[TempKey] = (BS_LoopStrikes[TempKey] + 1)
                  • Set TempPoint = (Position of Target[TempKey])
                  • Set TempPoint2 = (TempPoint offset by Distance[TempKey] towards Angle[TempKey] degrees)
                  • -------- Effects --------
                  • Set TempPoint3 = (Position of Caster[TempKey])
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[1]
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[2]
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TempPoint3)
                  • -------- Move Unit --------
                  • Unit - Move Caster[TempKey] instantly to TempPoint2, facing TempPoint
                  • Animation - Play Caster[TempKey]'s attack animation
                  • Unit - Cause Caster[TempKey] to damage Target[TempKey], dealing Damage[TempKey] damage of attack type Spells and damage type Normal
                  • -------- Effects --------
                  • Set TempPoint3 = (Position of Caster[TempKey])
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[1]
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[2]
                  • Special Effect - Destroy (Last created special effect)
                  • -------- Set Next Unit --------
                  • Set TempGroup = (Units within 500.00 of TempPoint3 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[Key])) Equal to True) and ((((Matching <you missed something here>))))) and do (Actions)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((TeampGroup) is Empty) Equal to True
                    • Then - Actions
                      • Set BS_LoopStrikes[TempKey] = BS_MaxLoopStrikes[TempKey]
                    • Else - Actions
                      • Set Target[TempKey] = (Random unit from (TempGroup))
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call RemoveLocation(udg_TempPoint2)
                  • Custom script: call RemoveLocation(udg_TempPoint3)
                  • Custom script: call DestroyGroup(udg_TempGroup)
                • Else - Actions
                  • Set SpellRan[TempKey] = True
                  • Unit Group - Remove Caster[TempKey] from SpellGroup
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn Off (This trigger)
        • Else - Actions
 
You call a lot of uneeded actions. SpellInxdex is completely useless if you want this spell to work that way. However, I do not recommend using Custom values here. Better use hashtables or learn proper Indexing.

Additionaly: you do not need to call so many destroy/remove actions. Make sure the condition for turning trigger of if is out of group actions. Trigger should be able to turn off without being forced to run through so many code lines just to ensure it can shut down -.-
Use Set BS_LoopStrikes[TempKey] = BS_MaxLoopStrikes[TempKey] to end loop for given unit. You do not need to create additional group, make it smoother by using custom script.

If it still wont work, I will make it myself, since I do not trust Custom values used like this - or you were thinking about Bribe's Unit Indexing - now we can talk ;D
  • Blink Strike loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SpellGroup and do (Actions)
        • Loop - Actions
          • Set TempKey = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SpellRan[TempKey] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BS_LoopStrikes[TempKey] Less than BS_MaxLoopStrikes[TempKey]
                • Then - Actions
                  • Set BS_LoopStrikes[TempKey] = (BS_LoopStrikes[TempKey] + 1)
                  • Set TempPoint = (Position of Target[TempKey])
                  • Set TempPoint2 = (TempPoint offset by Distance[TempKey] towards Angle[TempKey] degrees)
                  • -------- Effects --------
                  • Set TempPoint3 = (Position of Caster[TempKey])
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[1]
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[2]
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TempPoint3)
                  • -------- Move Unit --------
                  • Unit - Move Caster[TempKey] instantly to TempPoint2, facing TempPoint
                  • Animation - Play Caster[TempKey]'s attack animation
                  • Unit - Cause Caster[TempKey] to damage Target[TempKey], dealing Damage[TempKey] damage of attack type Spells and damage type Normal
                  • -------- Effects --------
                  • Set TempPoint3 = (Position of Caster[TempKey])
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[1]
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at TempPoint3 using BS_Effects[2]
                  • Special Effect - Destroy (Last created special effect)
                  • -------- Set Next Unit --------
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within 500.00 of TempPoint3 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[Key])) Equal to True) and ((((Matching <you missed something here>))))) and do (Actions)
                  • Loop - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (TempGroup is empty) Equal to True
                      • Then - Actions
                        • Set BS_LoopStrikes[TempKey] = BS_MaxLoopStrikes[TempKey]
                      • Else - Actions
                        • Set Target[TempKey] = (Random unit from TempGroup)
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call RemoveLocation(udg_TempPoint2)
                  • Custom script: call RemoveLocation(udg_TempPoint3)
                  • Custom script: call DestroyGroup(udg_TempGroup)
                • Else - Actions
                  • Set SpellRan[TempKey] = False
                  • Unit Group - Remove Caster[TempKey] from SpellGroup
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn Off (This trigger)
        • Else - Actions

Cheers for that, i didn't think about making the two integers Equal each other, and yes i am using Bribes indexing system. I don't really understand hashtables (ATM anyways)

And nope it still don't work, still only able to cast once then not able to again.
 
I updated the trigger, was wrong about TempGroup, it is needed, I thought we could use here bj_wantDestroyGroup = true, but it seems inefficent here.

Remove Custom script about BJ.

EDIT: POST MAP

And thats why i didnt put the bj_wantDestroyGroup = true in,
and okay map is attached below.
 

Attachments

  • Blink Strike.w3x
    28.8 KB · Views: 90
Here you are. I see you have copied Cloud Spin trigger :p
Dont use this shit SpellIndex, it is not needed, group state proofs to be just fine here.

haha, I have a little way of writing things (Variable ordering)
i like them all to be arranged nicely,

And okay just going to test it now cheers.

Edit:

Works mate, cheers! +rep
 
Status
Not open for further replies.
Top