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

[Trigger] Condition not correct?

Status
Not open for further replies.
Level 7
Joined
Nov 4, 2006
Messages
153
I have this trigger where whenever the hero kills a unit, it adds some value to a real variable. When the variable reaches an integer, that amount is added to the hero. The problem is, in the middle of my trigger, I have a condition checking if the variable is over or equal to 1.00. When it does equal 1.00, it doesn't do the actions still, only after I go over 1.00(kill another unit). Why? I added the game message to check and it should be correct. Also, I know this isn't MUI :)
  • ra fewn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Abominable Hulk: Ra'Fewn for HeroUnits[14]) Greater than 0
      • Or - Any (Conditions) are true
        • Conditions
          • (Killing unit) Equal to HeroUnits[14]
          • (Killing unit) Equal to IndirectDamageDummy[(Player number of (Owner of HeroUnits[14]))]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Set Real[21] = (Real[21] + (0.75 + (0.25 x (Real((Level of Abominable Hulk: Ra'Fewn for HeroUnits[14]))))))
        • Else - Actions
          • Set Real[21] = (Real[21] + 0.10)
      • Game - Display to (All players) for 1.00 seconds the text: (String(Real[21]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real[21] Greater than or equal to 1.00
        • Then - Actions
          • Floating Text - Create floating text that reads (+ + ((String((Integer(Real[21])))) + Strength)) above HeroUnits[14] with Z offset 50.00, using font size 9.25, color (45.00%, 40.00%, 90.00%), and 0.00% transparency
          • Hero - Modify Strength of HeroUnits[14]: Add (Integer(Real[21]))
          • Set Real[21] = (Real[21] - (Real((Integer(Real[21])))))
        • Else - Actions
          • Floating Text - Create floating text that reads (String(Real[21], 1, 2)) above (Triggering unit) with Z offset 50.00, using font size 7.00, color (45.00%, 40.00%, 90.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Show (Last created floating text) for (Player group((Owner of HeroUnits[14])))
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.10 seconds
 
Last edited:
Level 7
Joined
Nov 4, 2006
Messages
153
The default isn't 1. The reason it is a real and not an integer is because it keeps track of how much Strength to add, not every time the hero kills a unit. Such as when the hero kills a unit, it adds .10 to Real[21]. When the hero kills 10 units, it should = 1.00 which gives 1 Strength, then the amount of Strength added is subtracted from Real[21]. Hero kills add like .95 Strength or something. The problem is if the hero kills 10 non-hero units, it will correctly add up to 1.00. But the actions in the condition block in the middle of the trigger ( Real[21] >= 1.00) still does not happen even though Real[21] is 1.00. It happens when I go over 1.00 by killing an eleventh unit. Why is this? Would Real[21] > .99 work?--testing...
 
Status
Not open for further replies.
Top