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

Floating Text Problem

Status
Not open for further replies.
Level 12
Joined
Aug 12, 2008
Messages
349
I have this weird spell problem in my map. Below is the triggers for the spell and a link to the screenshot.
  • Voodoo
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Voodoo
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • V_indexSize Equal to 0
        • Then - Actions
          • Trigger - Turn on Voodoo loop <gen>
        • Else - Actions
      • Set V_indexSize = (V_indexSize + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • V_indexSize Greater than V_indexMax
        • Then - Actions
          • Set V_index1[V_indexSize] = V_indexSize
          • Set V_indexMax = V_indexSize
        • Else - Actions
      • Set V_index2 = V_index1[V_indexSize]
      • -------- ---------------------------------------------------------------------------------------------------------------- --------
      • Set V_count[V_index2] = 0.00
      • Set V_caster[V_index2] = (Triggering unit)
      • Set V_target[V_index2] = (Target unit of ability being cast)
      • Set tempInteger = (Level of Voodoo for V_caster[V_index2])
      • Set V_duration[V_index2] = (6.00 + (2.00 x (Real(tempInteger))))
[trigger=Voodoo loop]Voodoo loop
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
For each (Integer V_index3) from 1 to V_indexSize, do (Actions)
Loop - Actions
Set V_index2 = V_index1[V_index3]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(V_caster[V_index2] is alive) Equal to True
(V_target[V_index2] is alive) Equal to True
V_duration[V_index2] Greater than 0.00
Then - Actions
Set V_duration[V_index2] = (V_duration[V_index2] - 0.10)
Set V_count[V_index2] = (V_count[V_index2] + 0.10)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
V_count[V_index2] Greater than or equal to 2.00
Then - Actions
Set V_damage = (Real((Intelligence of V_caster[V_index2] (Include bonuses))))
Unit - Cause V_caster[V_index2] to damage V_target[V_index2], dealing V_damage damage of attack type Spells and damage type Normal
Set tempPoint = (Position of V_target[V_index2])
Special Effect - Create a special effect at tempPoint using Abilities\Spells\Undead\VampiricAura\VampiricAura.mdl
Special Effect - Destroy (Last created special effect)
Floating Text - Create floating text that reads (+ + (|cffffc00 + ((Substring((String(V_damage)), 1, ((Length of (String(V_damage))) - 1))) + |r))) above V_target[V_index2] with Z offset 0.00, using font size 7.50, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
Custom script: call RemoveLocation (udg_tempPoint)
Set V_count[V_index2] = 0.00
Else - Actions
Else - Actions
Set V_index1[V_index3] = V_index1[V_indexSize]
Set V_index1[V_indexSize] = V_index2
Set V_indexSize = (V_indexSize - 1)
Set V_index3 = (V_index3 - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
V_indexSize Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
[/trigger]

154935-albums5387-picture55431.jpg


The problem is that the floating text does not show the exact value of the variable "V_damage". As you can see from the picture. The intelligence of the caster is 18 but the values showed is only 8. Can anyone help me?
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
I think you trigger reads another unit's intelligence ?

Are you sure that your trigger is MUI ? (cause I don't work with Indexing)

What does this do ?

((Length of (String(V_damage))) - 1)))

Perhaps, from 18, you subtract 1 = 10, it becomes 8 ?
God knows...
 
Level 12
Joined
Aug 12, 2008
Messages
349
Ops. Sorry. It's the caster's intelligence. The trigger above is that I extracted from a trigger. That's why it's a bit weird. I'll update it with the real triggers.

For the ((Length of (String(V_damage))) - 1))), that's what Meticulous taught me. It's a way to reduce the number of decimal points as I want to show only max up to 2 decimal points while showing real number will be 3 decimal points.

Updated: Triggers updated
 
Level 12
Joined
Aug 12, 2008
Messages
349
I want the floating text to shows the damage amount from the voodoo which having decimal points I think will make it to look much more like damage dealt. That's what I think ><

Besides, lots of my spells did show the damage dealt that uses the damage detection system which the damage dealt does have the 2 decimal points behind :p So, I want it to be systematic :p
 
Level 12
Joined
Aug 12, 2008
Messages
349
Formatted string? Is it the "substring" thingy? By the way, showing the decimal points isn't the problem yet. The problem is that the shown value does not show the values that it should be. I set the V_damage to the Intelligence of the caster which is 18. But, from the screenshot as you can see, the values is only +8.00
 
Status
Not open for further replies.
Top