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

[Trigger] Whats wrong with this trigger?

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
For some reason ranged units are stuffing up my damage detection things.

Heres how it works. On init every unit is given the "Attack" ability, based off the orb of corruption. They also get it whenever they enter the map. Because I have my ways, I know these parts arent the ones bugging so i wont upload them.

When they get the attack ability they also get added to the DD trigger. Here it is now:

  • DD crit miss gore pillage and sappers by GoGo
    • Events
    • Conditions
    • Actions
      • Set Temppoint[0] = (Position of (Damage source))
      • Set Temppoint[1] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Damage source) is A Hero) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A structure) Equal to False
              • ((Triggering unit) has buff Attacked ) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Facing of (Triggering unit)) - (Angle from Temppoint[1] to Temppoint[0])) Less than AngleStart[0]
                  • ((Facing of (Triggering unit)) - (Angle from Temppoint[1] to Temppoint[0])) Greater than AngleEnd[0]
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Custom value of (Triggering unit)) Equal to 0
                    • Then - Actions
                      • Unit - Set the custom value of (Triggering unit) to 1
                      • Floating Text - Create floating text that reads (String((Integer(((Damage taken) x 2.00))))) at Temppoint[1] with Z offset 0.00, using font size 9.00, color (80.00%, 0.00%, 0.00%), and 25.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (Angle from Temppoint[0] to Temppoint[1]) degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                      • Floating Text - Create floating text that reads Backstabtext[(Random integer number between 0 and 3)] at Temppoint[0] with Z offset 0.00, using font size 8.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Cause (Damage source) to damage (Triggering unit), dealing (Damage taken) damage of attack type Chaos and damage type Universal
                    • Else - Actions
                      • Unit - Set the custom value of (Triggering unit) to 0
                • Else - Actions
                  • Set Tempint = (Agility of (Damage source) (Include bonuses))
                  • Set Tempint2 = (((Level of (Triggering unit)) x 10) + 5)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random real number between 0.00 and 100.00) Less than or equal to (100.00 x ((Real(Tempint)) / (Square root((Real(((Tempint x Tempint) + (Tempint2 x Tempint2))))))))
                    • Then - Actions
                      • Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at Temppoint[1] with Z offset 0.00, using font size 7.50, color (80.00%, 0.00%, 0.00%), and 25.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (Angle from Temppoint[0] to Temppoint[1]) degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 5) Equal to 1
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                    • Else - Actions
                      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
                      • Floating Text - Create floating text that reads Misstext[(Random integer number between 0 and 5)] at Temppoint[0] with Z offset 0.00, using font size 8.00, color (80.00%, 0.00%, 0.00%), and 25.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has buff Attacked ) Equal to True
            • Then - Actions
              • Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at Temppoint[1] with Z offset 0.00, using font size 7.50, color (80.00%, 0.00%, 0.00%), and 25.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (Angle from Temppoint[0] to Temppoint[1]) degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 5) Equal to 1
                • Then - Actions
                  • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
            • Else - Actions
              • Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at Temppoint[1] with Z offset 0.00, using font size 7.50, color (0.00%, 0.00%, 80.00%), and 25.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (Angle from Temppoint[0] to Temppoint[1]) degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 5) Equal to 1
                • Then - Actions
                  • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
      • Custom script: call RemoveLocation(udg_Temppoint[0])
      • Custom script: call RemoveLocation(udg_Temppoint[1])
  • |
  • |
  • |
  • THESE ARE ALL RELATED TO OTHER SYSTEMS
  • |
  • |
  • |
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) has buff Attacked ) Equal to True
        • ((Damage source) has buff Pillage ) Equal to True
      • Then - Actions
        • Player - Add (Level of Pillage for (Damage source)) to (Owner of (Damage source)) Current gold
        • Set Temppoint[0] = (Position of (Damage source))
        • Floating Text - Create floating text that reads (+ + (String((Level of Pillage for (Damage source))))) at Temppoint[0] with Z offset 14.00, using font size 9.00, color (80.00%, 80.00%, 0.00%), and 25.00% transparency
        • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        • Floating Text - Change (Last created floating text): Disable permanence
        • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
        • Custom script: call RemoveLocation(udg_Temppoint[0])
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (Triggering unit)) Equal to Kobold Sapper
        • (Random integer number between 1 and 3) Equal to 1
      • Then - Actions
        • Wait 0.01 seconds
        • Set Temppoint[0] = (Position of (Triggering unit))
        • Special Effect - Create a special effect at Temppoint[0] using war3mapImported\ExplosionBIG.mdx
        • Special Effect - Destroy (Last created special effect)
        • Unit - Cause (Damage source) to damage circular area after 0.00 seconds of radius 300.00 at Temppoint[0], dealing 200.00 damage of attack type Chaos and damage type Normal
        • Custom script: call RemoveLocation(udg_Temppoint[0])
        • Unit - Remove (Triggering unit) from the game
      • Else - Actions
Now, the problem. If you read through carefully, red or blue text is assigned to the damage detection display based on if the damaged (triggering) unit has the "Attacked' buff. This is, obviously my attempt to separate spell damage from attack damage.

The bugs:

Ranged enemies (2 different types are all ive tested, most likely there are more) hits are being detected as both "Having" and "not having" the attacked buff, resulting in a red and a blue hitsplat at the same time. Also, the buff DEFINITELY gets applied for them, because I set the duration to 5 seconds or so and mopved my guy into the middle of a herd of centaur. Please dont suggest this >_>

Hero spells (Havn't tested any non-hero spells) are not having their damage detected at all.

Everyone that replies with a reasonable attempt at fixing this will have their efforts recognized. Thank you all, even if all you did was read this :)

Please tell me if more information is required.
 
Level 8
Joined
Mar 3, 2009
Messages
327
  • UnitReg, if it means that much to you
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Custom script: call AddUnitAcceleration(GetTriggerUnit())
      • Trigger - Add to DD crit miss gore pillage and sappers by GoGo <gen> the event (Unit - (Triggering unit) Takes damage)
      • Unit - Add Attack to (Triggering unit)
Would you be able to explain all the other things you said?

I still think the problem lies in the trigger.. And also none of the monsters have any additional sources of damage. Theres at least a problem with the spell detection because the text doesn't show up for spell damage.
 
Level 8
Joined
Mar 3, 2009
Messages
327
Quit bumping your thread so often. 48 hours minimum.

Also, noticed the problem, apparently I ctrl+fed the wrong thing earlier.

It's this line:



The problem should be obvious.

Thats the backstab/critical strike thing. It only activates for heroes when theyre attacking within 40 or so degrees of behind the unit being attacked. While im at it, ill mention that the attacked buff works perfectly fine for the backstab segment.
 
Level 8
Joined
Mar 3, 2009
Messages
327
What the face.

I made a much simplified trigger, and using melee ranged units, and custom ones, I think that they do an additional 0 magic damage or something? would anyone be able to confirm this, or tell me why its happening >.<

EDIT: well not magic damage, just something that gets detected as a damage instance by the game engine..

EDIT: Further research is showing this random damage to not be prevalent with the instand attack type. Ill try with artillery.

EDIT: artillery doesnt apply the buff. I could maybe use a 0.01 second boiling oil, but another problem is the attack ground button, anyone know how to remove it?
 
Level 2
Joined
Oct 6, 2008
Messages
8
In my damage detection when structures takes damage the damage is shown twice as well... i know that because the velocity of the floating go in a (random angle), so 2 equal damages go in different ways. Couldn't fix the problem, just disabled the damage showing when attacking buildings :p
 
Status
Not open for further replies.
Top