• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Why this trigger no more working randomly?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,148
Hero can cast magical arrow that travels 3500 range and hits the first target on it's line.
This trigger sometimes not working. When you try to cast it, it stucks at the place that you have casted and never removes from the game.
This trigger not created by me and i haven't figured it out why it is not working.
This happens randomly

  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set DA_Index = 0
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Dark Arrow //
  • Actions
    • Set DA_Caster[DA_Index] = (Triggering unit)
    • Set Point_DA = (Position of DA_Caster[DA_Index])
    • Set Point_DA2 = (Target point of ability being cast)
    • Unit - Create 1 Dark Arrow // Dummy for (Triggering player) at Point_DA facing Point_DA2
    • Set DarkArrowToplamAtisSayisi[(Player number of (Triggering player))] = (DarkArrowToplamAtisSayisi[(Player number of (Triggering player))] + 1)
    • Custom script: call RemoveLocation(udg_Point_DA)
    • Custom script: call RemoveLocation(udg_Point_DA2)
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Dark Arrow // Dummy
  • Actions
    • Unit - Set the custom value of (Triggering unit) to DA_Index
    • Custom script: if udg_DA_Dummies == null then
    • Custom script: set udg_DA_Dummies = CreateGroup()
    • Custom script: endif
    • Unit Group - Add (Triggering unit) to DA_Dummies
    • Set DA_Index = (DA_Index + 1)
    • Unit - Add a 10.00 second Generic expiration timer to (Triggering unit)
  • Events
    • Time - Every 0.02 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in DA_Dummies and do (Actions)
      • Loop - Actions
        • Set Unit_DA = (Picked unit)
        • Set DA_Timer[(Custom value of Unit_DA)] = (DA_Timer[(Custom value of Unit_DA)] + 0.02)
        • Set Point_DA = (Position of Unit_DA)
        • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
        • Set DA_Range[(Custom value of Unit_DA)] = (DA_Range[(Custom value of Unit_DA)] + 22.00)
        • Unit - Move Unit_DA instantly to Point_DA2
        • Custom script: call RemoveLocation(udg_Point_DA)
        • Custom script: call RemoveLocation(udg_Point_DA2)
        • Set Point_DA = (Position of Unit_DA)
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units within 65.00 of Point_DA) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) is alive) Equal to True
                • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                • ((Picked unit) is A structure) Equal to False
                • ((Picked unit) is Mechanical) Equal to False
              • Then - Actions
                • Set DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] = (DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] + 1)
                • Unit - Kill Unit_DA
                • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
                • Unit Group - Remove Unit_DA from DA_Dummies
              • Else - Actions
        • Custom script: call RemoveLocation(udg_Point_DA)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
          • Then - Actions
            • Unit - Kill Unit_DA
            • Unit Group - Remove Unit from DA_Dummies
          • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,033
There are like 5 other things I would change to make the trigger for this spell less silly, easier to read, unlikely to bug out in some edge cases, and more efficient but since you didn't write it I'm guess you just don't care about any of that stuff. The issue is this part:
  • Then - Actions
    • Set DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] = (DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] + 1)
    • Unit - Kill Unit_DA
    • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
    • Unit Group - Remove Unit_DA from DA_Dummies
The arrow unit is killed and removed from the group after it hits a target, but it's never actually removed from the game... so it just sits there until its death animation plays. So, depending on if the arrow model it's using even has a death animation you might not see it disappear for quite a bit longer than that, but it shouldn't be there permanently. Also, some of the condition checks will get wonky for every unit besides the first one picked in the group because the dummy unit might not exist at all to be referred to (depends on its decay type, the time it takes to do so, and the length of any death/decay/dissipate animations it has). I would do this to consolidate the removal and other bologna to after all the damage has occurred.

  • Events
    • Time - Every 0.02 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in DA_Dummies and do (Actions)
      • Loop - Actions
        • -------- same up to here --------
        • Set TempBool = False
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units within 65.00 of Point_DA) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) is alive) Equal to True
                • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                • ((Picked unit) is A structure) Equal to False
                • ((Picked unit) is Mechanical) Equal to False
              • Then - Actions
                • Set TempBool = True
                • Set DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] = (DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] + 1)
                • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
              • Else - Actions
        • Custom script: call RemoveLocation(udg_Point_DA)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any condition is true
              • TempBool equal to True
              • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
          • Then - Actions
            • Unit - Kill Unit_DA
            • Unit Group - Remove Unit from DA_Dummies
          • Else - Actions
 
Level 17
Joined
Jun 2, 2009
Messages
1,148
@Pyrogasm Hello again. I could use some help. I don't have a knowledge about this trigger and i did exactly what you did. But now when i casts it, it stucks in the air and removes after few seconds. It is not moving. It is because of this part of this trigger.

  • Dark Arrow Move Yeni
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • Set TempBool = False
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 65.00 of Point_DA) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                • Then - Actions
                  • Set TempBool = True
                  • Set DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] = (DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] + 1)
                  • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA)
          • -------- ----- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • TempBool Equal to True
                  • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
            • Then - Actions
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
This is your trigger but it is the previous version.

  • Dark Arrow Move Yeni Copy
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • Set Unit_DA = (Picked unit)
          • Set DA_Timer[(Custom value of Unit_DA)] = (DA_Timer[(Custom value of Unit_DA)] + 0.02)
          • Set Point_DA = (Position of Unit_DA)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • Set DA_Range[(Custom value of Unit_DA)] = (DA_Range[(Custom value of Unit_DA)] + 22.00)
          • Unit - Move Unit_DA instantly to Point_DA2
          • Custom script: call RemoveLocation(udg_Point_DA)
          • Custom script: call RemoveLocation(udg_Point_DA2)
          • Set Point_DA = (Position of Unit_DA)
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 65.00 of Point_DA) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                • Then - Actions
                  • Set DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] = (DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] + 1)
                  • Unit - Kill Unit_DA
                  • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
                  • Unit Group - Remove Unit_DA from DA_Dummies
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
            • Then - Actions
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
Arrow is not moving when we get rid of these triggers.

  • Events
    • Time - Every 0.02 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in DA_Dummies and do (Actions)
      • Loop - Actions
        • Set Unit_DA = (Picked unit)
        • Set DA_Timer[(Custom value of Unit_DA)] = (DA_Timer[(Custom value of Unit_DA)] + 0.02)
        • Set Point_DA = (Position of Unit_DA)
        • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
        • Set DA_Range[(Custom value of Unit_DA)] = (DA_Range[(Custom value of Unit_DA)] + 22.00)
        • Unit - Move Unit_DA instantly to Point_DA2
        • Custom script: call RemoveLocation(udg_Point_DA)
        • Custom script: call RemoveLocation(udg_Point_DA2)
        • Set Point_DA = (Position of Unit_DA)
How can i make it work? I think you we're assuming i know how to implement your method into my map but sadly i don't get it.
 
Level 39
Joined
Feb 27, 2007
Messages
5,033
Please, please read what I wrote and use your brain. You deleted half of the trigger. Why? In my example trigger I did not want to show all of that stuff that didn't need to be changed, so I omitted it from the trigger example I posted. I did not tell you to remove those lines. I specifically wrote "-------- same up to here --------" so you would know that everything before that line was fine and I had just chosen not to show it.

Keep everything that was already there. Alter the part I showed in my post to match how I showed it in the post.
 
Level 17
Joined
Jun 2, 2009
Messages
1,148
Please, please read what I wrote and use your brain. You deleted half of the trigger. Why? In my example trigger I did not want to show all of that stuff that didn't need to be changed, so I omitted it from the trigger example I posted. I did not tell you to remove those lines. I specifically wrote "-------- same up to here --------" so you would know that everything before that line was fine and I had just chosen not to show it.

Keep everything that was already there. Alter the part I showed in my post to match how I showed it in the post.
Because i am brainless and idiot person. It wasn't my choice. I am sorry.

It is ok now?
  • Dark Arrow Move Yeni
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • Set Unit_DA = (Picked unit)
          • Set DA_Timer[(Custom value of Unit_DA)] = (DA_Timer[(Custom value of Unit_DA)] + 0.02)
          • Set Point_DA = (Position of Unit_DA)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • Set DA_Range[(Custom value of Unit_DA)] = (DA_Range[(Custom value of Unit_DA)] + 22.00)
          • Unit - Move Unit_DA instantly to Point_DA2
          • Custom script: call RemoveLocation(udg_Point_DA)
          • Custom script: call RemoveLocation(udg_Point_DA2)
          • Set Point_DA = (Position of Unit_DA)
          • Custom script: set bj_wantDestroyGroup = true
          • Set TempBool = False
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 65.00 of Point_DA) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                • Then - Actions
                  • Set TempBool = True
                  • Set DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] = (DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] + 1)
                  • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA)
          • -------- ----- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • TempBool Equal to True
                  • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
            • Then - Actions
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,033
Bruh. That is how this spell works and was always supposed to work. If you want to change that you’ll need to alter what happens when it picks units near the arrow’s new position after moving it. Right now every unit in range is damaged; you’ll either have to damage one unit randomly or figure out which one is closest to the target and work with that one.
 
Level 17
Joined
Jun 2, 2009
Messages
1,148
Bruh. That is how this spell works and was always supposed to work. If you want to change that you’ll need to alter what happens when it picks units near the arrow’s new position after moving it. Right now every unit in range is damaged; you’ll either have to damage one unit randomly or figure out which one is closest to the target and work with that one.
Sadly i don't have a sufficient knowledge about that.
Previously, spell was working as it should be but it was bugging.
Now we solved it, but not it is dealing damage to area.
 
Level 39
Joined
Feb 27, 2007
Messages
5,033
You can remove TempBool, it's no longer needed.
  • Dark Arrow Move Yeni
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • -------- keep other actions, just modify these: --------
          • Set Point_DA = (Position of Unit_DA)
          • Set TempUnit = (No unit)
          • Set MinDistance = 65.00
          • Custom script: set bj_wantDestroyGroup = true //only need to do this once, delete the other instance of this line right before it in your trigger
          • Unit Group - Pick every unit in (Units within MinDistance of Point_DA) and do (Actions) //Used MinDistance here instead of 65.00 directly
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                • Then - Actions
                  • Set Point_DA2 = (Position of (Picked unit))
                  • Set TempReal = (Distance between Point_DA and Point_DA2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Less than or equal to MinDistance
                    • Then - Actions
                      • Set TempBool = True
                      • Set TempUnit = (Picked Unit)
                      • Set MinDistance = TempReal
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_Point_DA2)
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA)
          • -------- ----- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnit Not equal to No Unit
            • Then - Actions
              • Set DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] = (DarkArrowDusmanHeroVurusSayisi[(Player number of (Owner of Unit_DA))] + 1)
              • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage TempUnit, dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic //use TempUnitHere
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
            • Then - Actions
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
 
Level 17
Joined
Jun 2, 2009
Messages
1,148
I wasn't remember it was you who tried to help me. But you helped me and i feel responsibility to reply you. Because this is another topic.

It is not working again. Arrow not moving.
Reminder: I am idiot, stupid person. I have copied what i see and i don't know keep which actions. I don't have a knowledge about this system.

  • Dark Arrow Move Yeni
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • Set Point_DA = (Position of Unit_DA)
          • Set TempUnit = No unit
          • Set MinDistance = 65.00
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within MinDistance of Point_DA) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                • Then - Actions
                  • Set Point_DA2 = (Position of (Picked unit))
                  • Set TempReal = (Distance between Point_DA and Point_DA2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Less than or equal to MinDistance
                    • Then - Actions
                      • Set TempBool = True
                      • Set TempUnit = (Picked unit)
                      • Set MinDistance = TempReal
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_Point_DA2)
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA2)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnit Not equal to No unit
            • Then - Actions
              • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
            • Then - Actions
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,033
You have again ignored the comment I wrote that said to keep everything at the beginning of the trigger up to the point I wrote the comment… and then gone and actively deleted part of the trigger.
Pyrogasm said:
-------- keep other actions, just modify these: --------
  • Dark Arrow Move Yeni
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • Set Unit_DA = (Picked unit)
          • Set DA_Timer[(Custom value of Unit_DA)] = (DA_Timer[(Custom value of Unit_DA)] + 0.02)
          • Set Point_DA = (Position of Unit_DA)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • Set DA_Range[(Custom value of Unit_DA)] = (DA_Range[(Custom value of Unit_DA)] + 22.00)
          • Unit - Move Unit_DA instantly to Point_DA2
          • Custom script: call RemoveLocation(udg_Point_DA)
          • Custom script: call RemoveLocation(udg_Point_DA2)
 
Level 17
Joined
Jun 2, 2009
Messages
1,148
  • Dark Arrow Move Yeni
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • Set Unit_DA = (Picked unit)
          • Set DA_Timer[(Custom value of Unit_DA)] = (DA_Timer[(Custom value of Unit_DA)] + 0.02)
          • Set Point_DA = (Position of Unit_DA)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • Set DA_Range[(Custom value of Unit_DA)] = (DA_Range[(Custom value of Unit_DA)] + 22.00)
          • Unit - Move Unit_DA instantly to Point_DA2
          • Custom script: call RemoveLocation(udg_Point_DA)
          • Custom script: call RemoveLocation(udg_Point_DA2)
          • Set Point_DA = (Position of Unit_DA)
          • Set TempUnit = No unit
          • Set MinDistance = 65.00
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within MinDistance of Point_DA) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                • Then - Actions
                  • Set Point_DA2 = (Position of (Picked unit))
                  • Set TempReal = (Distance between Point_DA and Point_DA2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Less than or equal to MinDistance
                    • Then - Actions
                      • Set TempBool = True
                      • Set TempUnit = (Picked unit)
                      • Set MinDistance = TempReal
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_Point_DA2)
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA2)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnit Not equal to No unit
            • Then - Actions
              • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
            • Then - Actions
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
Ok now it looks better. Arrow is moving now but when arrow hits the target, it vanishes like it's travel time expired and does not deal damage.

I am sharing the entire trigger for the make it clear.

  • Dark Arrow Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DA_Index = 0
  • Dark Arrow Cast Yeni
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Arrow //
    • Actions
      • Set DA_Caster[DA_Index] = (Triggering unit)
      • Set Point_DA = (Position of DA_Caster[DA_Index])
      • Set Point_DA2 = (Target point of ability being cast)
      • Unit - Create 1 Dark Arrow // Dummy for (Triggering player) at Point_DA facing Point_DA2
      • Set DarkArrowToplamAtisSayisi[(Player number of (Triggering player))] = (DarkArrowToplamAtisSayisi[(Player number of (Triggering player))] + 1)
      • Custom script: call RemoveLocation(udg_Point_DA)
      • Custom script: call RemoveLocation(udg_Point_DA2)
  • Dark Arrow Enter
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Dark Arrow // Dummy
    • Actions
      • Unit - Set the custom value of (Triggering unit) to DA_Index
      • Custom script: if udg_DA_Dummies == null then
      • Custom script: set udg_DA_Dummies = CreateGroup()
      • Custom script: endif
      • Unit Group - Add (Triggering unit) to DA_Dummies
      • Set DA_Index = (DA_Index + 1)
      • Unit - Add a 10.00 second Generic expiration timer to (Triggering unit)
 
Level 39
Joined
Feb 27, 2007
Messages
5,033
Look I know you don’t like the way I reply to you but you’re really not making any sort of effort to learn here. It is making my point even more obvious than it already was.

How can I say that? Consider the problem you just described:
it vanishes like it's travel time expired and does not deal damage.
What would be the first thing you should look at to explore this issue? Probably the line that causes the damage since it’s not being caused. Right? If we look at it we find this:

Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage (Picked unit), dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic

Look at that, it’s not damaging the correct unit. It’s damaging the picked unit, which in this case is the dummy arrow that is being moved. It should be TempUnit.

Again this should have been the very first place you looked and the first thing you tried to fix it. I’m asking you to please attempt to think about the problem you are having, and to at least spend the time necessary to check these simple, obvious things first before asking for help because it “doesn’t work”. What you’re doing is like saying “something is wrong with the wheels on my car, it’s driving differently” and then when the mechanic asks you “so did you see the giant knife just sticking out of your left front wheel?” You say “no, I didn’t even look at my wheels to check over them.”
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,148
As the beginning i am telling i don't have a knowledge about this system and still i don't understand how it works. Being stupid person wasn't my choice. I am not telling this because of running away from argument. It is a fact. I am stupid person. Learning something new is difficult for me.
And this trigger is far beyond my skills. I don't understand many parts of this trigger.
This trigger created by one of my friends and it is too advanced for me. I would like to know much as you.

I have changed Picked Unit with TempUnit but still it is not working.

Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage TempUnit, dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
 
Level 17
Joined
Jun 2, 2009
Messages
1,148
Please post all of the current triggers again. I have to guess what you've actually changed or not so it's easier to see it all at once.
Sure. Here is the entire trigger about Dark Arrow.

  • Dark Arrow Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DA_Index = 0
  • Dark Arrow Cast Yeni
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Arrow //
    • Actions
      • Set DA_Caster[DA_Index] = (Triggering unit)
      • Set Point_DA = (Position of DA_Caster[DA_Index])
      • Set Point_DA2 = (Target point of ability being cast)
      • Unit - Create 1 Dark Arrow // Dummy for (Triggering player) at Point_DA facing Point_DA2
      • Set DarkArrowToplamAtisSayisi[(Player number of (Triggering player))] = (DarkArrowToplamAtisSayisi[(Player number of (Triggering player))] + 1)
      • Custom script: call RemoveLocation(udg_Point_DA)
      • Custom script: call RemoveLocation(udg_Point_DA2)
  • Dark Arrow Enter
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Dark Arrow // Dummy
    • Actions
      • Unit - Set the custom value of (Triggering unit) to DA_Index
      • Custom script: if udg_DA_Dummies == null then
      • Custom script: set udg_DA_Dummies = CreateGroup()
      • Custom script: endif
      • Unit Group - Add (Triggering unit) to DA_Dummies
      • Set DA_Index = (DA_Index + 1)
      • Unit - Add a 10.00 second Generic expiration timer to (Triggering unit)
  • Dark Arrow Move Yeni
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DA_Dummies and do (Actions)
        • Loop - Actions
          • Set Unit_DA = (Picked unit)
          • Set DA_Timer[(Custom value of Unit_DA)] = (DA_Timer[(Custom value of Unit_DA)] + 0.02)
          • Set Point_DA = (Position of Unit_DA)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • Set DA_Range[(Custom value of Unit_DA)] = (DA_Range[(Custom value of Unit_DA)] + 22.00)
          • Unit - Move Unit_DA instantly to Point_DA2
          • Custom script: call RemoveLocation(udg_Point_DA)
          • Custom script: call RemoveLocation(udg_Point_DA2)
          • Set Point_DA = (Position of Unit_DA)
          • Set TempUnit = No unit
          • Set MinDistance = 65.00
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within MinDistance of Point_DA) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                • Then - Actions
                  • Set Point_DA2 = (Position of (Picked unit))
                  • Set TempReal = (Distance between Point_DA and Point_DA2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Less than or equal to MinDistance
                    • Then - Actions
                      • Set TempBool = True
                      • Set TempUnit = (Picked unit)
                      • Set MinDistance = TempReal
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_Point_DA2)
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA2)
          • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnit Not equal to No unit
            • Then - Actions
              • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage TempUnit, dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DA_Range[(Custom value of Unit_DA)] Greater than 3500.00
            • Then - Actions
              • Unit - Kill Unit_DA
              • Unit Group - Remove Unit from DA_Dummies
            • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,033
There are 3 lines that can be deleted (they do nothing and aren't necessary, maybe they are accidents:
  • Unit Group - Pick every unit in (Units within MinDistance of Point_DA) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is alive) Equal to True
          • ((Picked unit) belongs to an enemy of (Owner of Unit_DA)) Equal to True
          • ((Picked unit) is A structure) Equal to False
          • ((Picked unit) is Mechanical) Equal to False
        • Then - Actions
          • Set Point_DA2 = (Position of (Picked unit))
          • Set TempReal = (Distance between Point_DA and Point_DA2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempReal Less than or equal to MinDistance
            • Then - Actions
              • Set TempBool = True <<<--------- <<<---------
              • Set TempUnit = (Picked unit)
              • Set MinDistance = TempReal
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Point_DA2)
        • Else - Actions
  • Custom script: call RemoveLocation(udg_Point_DA2) <<<--------- <<<--------- These
  • Set Point_DA2 = (Point_DA offset by 22.00 towards (Facing of Unit_DA) degrees) <<<--------- <<<---------
This line is used in two places at the end of the trigger and I think it uses the wrong variable: Unit Group - Remove Unit from DA_Dummies. It should be "Remove Unit_DA..."

Other than that it looks like it should work so I'm not sure. Have the game show some debug messages before and after the damage to see if that line is being run?
  • Game - Display to (All Players) the text Before Dmg
  • Unit - Cause DA_Caster[(Custom value of Unit_DA)] to damage TempUnit, dealing ((40.00 + ((Real((Level of Dark Arrow // for DA_Caster[(Custom value of Unit_DA)]))) x 40.00)) + ((Real((Integer((DA_Range[(Custom value of Unit_DA)] / 550.00))))) x 100.00)) damage of attack type Spells and damage type Magic
  • Game - Display to (All Players) the text After Dmg
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
I recommend using a Unit Indexer if you're going to mess around with Custom Values. It does exactly what you're doing now but without the need to assign the Custom Value yourself. You could delete a lot of unnecessary stuff like DA_Index if you were to use this, just make sure the Unit Indexer is setup to register Dummy units, I think Bribe's system may ignore them.

Also, I notice you sometimes Set the starting value of your variables for no reason.
Understand that Integers, Reals, and Booleans all have a default starting value.

Integers = 0
Reals = 0.00
Booleans = False

Also, a unit's Custom Value is always 0 by default. It's an Integer so this makes sense.

So you never have to do this:
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set DA_Index = 0
DA_Index is already equal to 0 so Setting it to 0 again does nothing.

This starting value can be found in the Variable Editor, although in there it's called Initial Value. You can change this value to whatever you want.
 
Last edited:
Status
Not open for further replies.
Top