[Trigger] Floating text not showing up what it should show up.

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
Hey there, i've made this trigger for a spell that has a certain percentage (right now 100, but thats just for testing it out) to deal a percentage (this level 5 percentage) of the units maximum hp in extra damage:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Ogre Smash for (Attacking unit)) Equal to 1
      • (Random integer number between 1 and 100) Less than or equal to 100
    • Then - Actions
      • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing ((Max life of (Attacking unit)) x ((Real((Level of Ogre Smash for (Attacking unit)))) x 0.05)) damage of attack type Hero and damage type Normal
      • Floating Text - Create floating text that reads (String(((Integer((Max life of (Attacking unit)))) x ((Level of Ogre Smash for (Attacking unit)) x (Integer(0.05)))))) at (Position of (Attacking unit)) with Z offset 0.00, using font size 12.00, color (50.00%, 50.00%, 100.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 fading age of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Special Effect - Create a special effect attached to the weapon of (Attacking unit) using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Special Effect - Destroy (Last created special effect)
    • Else - Actions
Everything works as it should, except that the floating text just shows a big 0. Why? I can't seem to find anything wrong with the create floating text, maybe someone can see what goes wrong.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Elainiel said:
x (Integer(0.05))

This is multiplying everything by 0. As Deaod said, the integer conversion of (0.05) is 0.

String(((Integer((Max life of (Attacking unit)))) x ((Level of Ogre Smash for (Attacking unit)) x (Integer(0.05))))))

Let's break this down.

We have:
  • String(((Integer((Max life of (Attacking unit)))) x ((Level of Ogre Smash for (Attacking unit)) x (Integer(0.05))))))
  • (Integer((Max life of (Attacking unit)))) --> This is fine. Let's call this (1).
  • (Level of Ogre Smash for (Attacking unit)) --> This is also fine. Let's also call this (1).
  • (Integer(0.05)) --> This evaluates to 0. (1 x 1 x 0 = 0)
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Do a "Convert Integer to String" and then a "Convert Real to Integer" when you first start making this trigger, when you're converting everything into a string for the text-tag (floating text) message.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Like this:

  • Set Message = (String((Integer(((Life of YourUnit) x 0.05)))))
Or, more specifically in your case:

  • Set Message = (String((Integer(((Life of YourUnit) x (0.05 x (Real((Level of Acid Bomb for YourUnit)))))))))
Though I used Acid Bomb instead of Ogre Smash though.
 
Status
Not open for further replies.
Top