• 🏆 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] Integer A does not work. Need help..!

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2015
Messages
56
So I have been categorizing units so that if a specific special unit attacks them it deals damage bonus. For example if a pikeman attacks a "cavalry" unit, it deals +7 damage.


  • Unit Categorization 01
    • Events
      • Map initialization
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set A_Chal_UCag_Cavalry[1] = Troll Battlerider
          • Set A_Chal_UCag_Cavalry[2] = Blood Elf Pathfinder
          • Set A_Chal_UCag_Cavalry[3] = Town Scout
          • Set A_Chal_UCag_Cavalry[4] = Knight (Chalaguine)
          • Set A_Chal_UCag_Cavalry[5] = Knightess
          • Set A_Chal_UCag_Cavalry[6] = Elite Knight (Chalaguine - Tier 1)
          • Set A_Chal_UCag_Cavalry[7] = Elite Bashknight (Chalaguine)
          • Set A_Chal_UCag_Cavalry[8] = Grand Marshall (On Horse)
          • Set A_Chal_UCag_Cavalry[9] = Elite Knight (Chalaguine - Tier 2)
          • -------- ----------------------------TO BE UPDATED-------------------------- --------
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set A_Chal_UCag_Siege[1] = War Catapult
          • Set A_Chal_UCag_Siege[2] = Blood Elf Arcane Golem
          • Set A_Chal_UCag_Siege[3] = Blood Elf Ballista
          • Set A_Chal_UCag_Siege[4] = Armored Ogre
          • Set A_Chal_UCag_Siege[5] = Ballista
          • Set A_Chal_UCag_Siege[6] = Battering Ram
          • Set A_Chal_UCag_Siege[7] = Catapult
          • Set A_Chal_UCag_Siege[8] = Ballistic Catapult
          • Set A_Chal_UCag_Siege[9] = Wheeled Cannon
          • Set A_Chal_UCag_Siege[10] = Mangonel
          • Set A_Chal_UCag_Siege[11] = Trebuchet
          • -------- ----------------------------TO BE UPDATED-------------------------- --------
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set A_Chal_UCag_Flyer[1] = Siege Balloon
          • Set A_Chal_UCag_Flyer[2] = Staunch Jet N100 Series
          • Set A_Chal_UCag_Flyer[3] = Blood Elf Dragonhawk
          • Set A_Chal_UCag_Flyer[4] = Blood Elf Dragonhawk Windrider
          • Set A_Chal_UCag_Flyer[5] = Srcygon
          • -------- ----------------------------TO BE UPDATED-------------------------- --------
        • Else - Actions






  • Chal Tic Tac Toe
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • -------- ---> For Chalaguine Pikeman <--- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Pikeman (Chalaguine)
        • Then - Actions
          • For each (Integer A) from 1 to 100, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Attacked unit)) Equal to A_Chal_UCag_Cavalry[(Integer A)]
                • Then - Actions
                  • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 7.00 damage of attack type Normal and damage type Enhanced
                • Else - Actions
        • Else - Actions


Nothing works and happens.
 
Last edited:
Level 25
Joined
May 11, 2007
Messages
4,651
Use For each Integer Variable instead of Integer A, Integer A is bad for performance.

If the Kill unit is just for testing, you should remove it from the triggers you upload here as it causes confusion when reading the trigger.

What's the unit type of the attacked unit? Is it included in the map init trigger?


But wouldn't it just be simplier for you to change the armors, so that units with spears deal Spear damage (Piercing) against cavarly (chaos armor). You do this in gameplay interface and gameplay constants.
 
Level 3
Joined
Sep 9, 2015
Messages
56
What's the unit type of the attacked unit? Is it included in the map init trigger?

yes I think I'll change the integer variable now as I've been scrolling the forums that many people say Integer A / B sucks up so bad haha

As what you asked, I'm answering that no, it's not put into the map init trigger.
I thought it will be considered in the second trigger I put.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Erm, let's rephase that a bit.

Is your attacked unit-type one of these unit types?
Set A_Chal_UCag_Cavalry[1] = Troll Battlerider
Set A_Chal_UCag_Cavalry[2] = Blood Elf Pathfinder
Set A_Chal_UCag_Cavalry[3] = Town Scout
Set A_Chal_UCag_Cavalry[4] = Knight (Chalaguine)
Set A_Chal_UCag_Cavalry[5] = Knightess
Set A_Chal_UCag_Cavalry[6] = Elite Knight (Chalaguine - Tier 1)
Set A_Chal_UCag_Cavalry[7] = Elite Bashknight (Chalaguine)
Set A_Chal_UCag_Cavalry[8] = Grand Marshall (On Horse)
Set A_Chal_UCag_Cavalry[9] = Elite Knight (Chalaguine - Tier 2)

IF NOT, then it's quite obvious why it doesn't work, right?
 
Level 3
Joined
Sep 9, 2015
Messages
56
Erm, let's rephase that a bit.

Is your attacked unit-type one of these unit types?
Set A_Chal_UCag_Cavalry[1] = Troll Battlerider
Set A_Chal_UCag_Cavalry[2] = Blood Elf Pathfinder
Set A_Chal_UCag_Cavalry[3] = Town Scout
Set A_Chal_UCag_Cavalry[4] = Knight (Chalaguine)
Set A_Chal_UCag_Cavalry[5] = Knightess
Set A_Chal_UCag_Cavalry[6] = Elite Knight (Chalaguine - Tier 1)
Set A_Chal_UCag_Cavalry[7] = Elite Bashknight (Chalaguine)
Set A_Chal_UCag_Cavalry[8] = Grand Marshall (On Horse)
Set A_Chal_UCag_Cavalry[9] = Elite Knight (Chalaguine - Tier 2)

IF NOT, then it's quite obvious why it doesn't work, right?

Yes, one of them is the attacked unit and I don't know why my attacking unit does not do the additional damage.

Erm, let's rephase that a bit.

Is your attacked unit-type one of these unit types?
Set A_Chal_UCag_Cavalry[1] = Troll Battlerider
Set A_Chal_UCag_Cavalry[2] = Blood Elf Pathfinder
Set A_Chal_UCag_Cavalry[3] = Town Scout
Set A_Chal_UCag_Cavalry[4] = Knight (Chalaguine)
Set A_Chal_UCag_Cavalry[5] = Knightess
Set A_Chal_UCag_Cavalry[6] = Elite Knight (Chalaguine - Tier 1)
Set A_Chal_UCag_Cavalry[7] = Elite Bashknight (Chalaguine)
Set A_Chal_UCag_Cavalry[8] = Grand Marshall (On Horse)
Set A_Chal_UCag_Cavalry[9] = Elite Knight (Chalaguine - Tier 2)

IF NOT, then it's quite obvious why it doesn't work, right?

I guess fixing the variable integer will be the solution, will try it minutes from now. thanks

Thanks, man. The problem is fixed. I just changed the integer variable from being Integer A.
 
Last edited by a moderator:
Level 37
Joined
Jul 22, 2015
Messages
3,485
You'll want to use a DDS like Weep's GDD to detect a real damage event. Right now, this can be abused by spamming the "stop" order.

In addition to what Bribe said:

The event "Unit - A unit Is attacked" will run before the actual attack is even made. That means that even if the unit misses, they will still deal the damage with your current setup. Also, it will look a little awkward to see damage being dealt before the actual attack even hit.
 
Level 3
Joined
Sep 9, 2015
Messages
56
You'll want to use a DDS like Weep's GDD to detect a real damage event. Right now, this can be abused by spamming the "stop" order.

I think DDS is very hard to setup same as the Knockback Systems. I don't know. All I know is just copying the triggers of those stuff and paste and nothing more.
 
Status
Not open for further replies.
Top