• 🏆 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] Why doesn't this simple trigger increase stacks in arrayindex [REFORGED]

Status
Not open for further replies.
Level 12
Joined
Feb 5, 2018
Messages
521
  • Might
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (Level of Might for PDD_target) Not equal to 0
      • (PDD_target belongs to an enemy of (Owner of PDD_source).) Equal to True
      • (Random integer number between 1 and 100) Less than or equal to 33
    • Actions
      • Set VariableSet MighTemp = (MighTemp + 1)
      • Set VariableSet MightStacks[MighTemp] = (MightStacks[MighTemp] + 1)
      • Set VariableSet MightSource[MighTemp] = PDD_source
      • Set VariableSet MightTarget[MighTemp] = PDD_target
      • Set VariableSet MightMax[MighTemp] = ((Level of Might for MightTarget[MighTemp]) x 5)
      • Game - Display to (All players) the text: (String(MightStacks[MighTemp]))
      • Set VariableSet MightTime[MighTemp] = 15.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MightStacks[MighTemp] Less than MightMax[MighTemp]
        • Then - Actions
          • Hero - Modify Strength of MightTarget[MighTemp]: Add 4.
          • Special Effect - Create a special effect attached to the origin of MightTarget[MighTemp] using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
          • Set VariableSet MightFX = (Last created special effect)
          • Special Effect - Destroy MightFX
        • Else - Actions
      • Wait MightTime[MighTemp] seconds
      • Hero - Modify Strength of MightTarget[MighTemp]: Subtract 4.
      • Set VariableSet MightStacks[MighTemp] = (MightStacks[MighTemp] - 1)
      • Game - Display to (All players) the text: (String(MightStacks[MighTemp]))
      • Set VariableSet MighTemp = (MighTemp - 1)
So the problem is that MightStacks[IndexArray] remains at 1. Instead of increasing it with the MightTemp integer.
And then reduces it to 0, but now below 0, so it remains at either 1 and when reduced at 0.

So it gives infinite stacks of strength, because its always less than MaxStacks[IndexArray] instead of reaching it's actual figure of 5 per level. So it would stop at 5.

I have Bribe's unit indexer that came with KnockBackSystem2.5D, so it might interfere with this. Although other triggers in the map run normally.
 
Level 12
Joined
Feb 5, 2018
Messages
521
I found another trigger where it doesn't apply.

  • Set VariableSet HC_Damage[HC_LoopInteger] = ((Level of Heroic Charge for HC_Caster[HC_LoopInteger]) x 65)
  • Set VariableSet HC_DamageSTR[HC_LoopInteger] = ((Strength of HC_Caster[HC_LoopInteger] (Include bonuses)) x 2)
  • Set VariableSet HC_DamageTOTAL[HC_LoopInteger] = (HC_Damage[HC_LoopInteger] + HC_DamageSTR[HC_DamageSTR[HC_LoopInteger]])
So here when the skill level is 1 it applies 65 damage instead of applying 65 damage + 2 times Strength in damage.
This is in REFORGED editor.

A similar trigger without MYtrigger[Indexarray] works properly and the damage is added as should.

  • Set VariableSet GB_Damage = ((Level of Mighty Blow for PDD_source) x 35)
  • Set VariableSet GB_DamageSTR = (Strength of PDD_source (Include bonuses))
  • Set VariableSet GB_DamageTOTAL = (GB_Damage + GB_DamageSTR)
  • Unit - Cause PDD_source to damage PDD_target, dealing (Real(GB_DamageTOTAL)) damage of attack type Normal and damage type Normal
All help is appreciated :)
 
Status
Not open for further replies.
Top