Floating text fail

Cookiemaster

New Member
Reaction score
36
EDIT2: Problem solved. But it doesn't make sense. ;-;


EDIT: Example: http://img516.imageshack.us/img516/8713/tdasfdsain9.jpg


I made a damage/attack detection system the same way everyone does it, but when there's a lot of combat going on, the text that displays the damage sometimes... just stays there.

Trigger:
  • DTSDetection
    • Events
    • Conditions
      • (Damage taken) Greater than or equal to 1.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff DTSBuff ) Equal to True
        • Then - Actions
          • Set TEMP_REAL[0] = (Damage taken)
          • Set TEMP_INTEGER[0] = 0
          • Set TEMP_INTEGER[1] = 0
          • Unit - Remove DTSBuff buff from (Triggering unit)
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + TEMP_REAL[0])
          • -------- ///// ------ Combat Arts ------ ///// --------
          • -------- Set Level --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of BDSInfo (Heroic) for (Triggering unit)) Equal to 1
            • Then - Actions
              • Set TEMP_INTEGER[0] = 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of BDSInfo (Advanced) for (Triggering unit)) Equal to 1
                • Then - Actions
                  • Set TEMP_INTEGER[0] = 2
                • Else - Actions
                  • Set TEMP_INTEGER[0] = 1
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of BDSInfo (Heroic) for (Damage source)) Equal to 1
            • Then - Actions
              • Set TEMP_INTEGER[1] = 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of BDSInfo (Advanced) for (Damage source)) Equal to 1
                • Then - Actions
                  • Set TEMP_INTEGER[1] = 2
                • Else - Actions
                  • Set TEMP_INTEGER[1] = 1
          • -------- Evasion --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than or equal to (10 + (5 x TEMP_INTEGER[0]))
            • Then - Actions
              • Set TEMP_REAL[0] = 0.00
              • Set TEMP_BOOLEAN[0] = True
            • Else - Actions
              • Set TEMP_BOOLEAN[0] = False
          • -------- Critical --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than or equal to (10 + (5 x TEMP_INTEGER[1]))
            • Then - Actions
              • Set TEMP_REAL[0] = (TEMP_REAL[0] x (1.00 + (Real(TEMP_INTEGER[1]))))
              • Set TEMP_BOOLEAN[1] = True
            • Else - Actions
              • Set TEMP_BOOLEAN[1] = False
          • -------- Dealing the Damage --------
          • Unit - Cause (Damage source) to damage (Triggering unit), dealing TEMP_REAL[0] damage of attack type Chaos and damage type Universal
          • -------- Show Numbers --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TEMP_BOOLEAN[0] Equal to True
            • Then - Actions
              • Floating Text - Create floating text that reads Miss! above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (80.00 + (Random real number between 0.00 and 70.00)) degrees
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TEMP_BOOLEAN[1] Equal to True
                • Then - Actions
                  • Floating Text - Create floating text that reads ((String((Integer(TEMP_REAL[0])))) + !) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (10.00 + ((TEMP_REAL[0] / (Life of (Triggering unit))) x 70.00)) degrees
                • Else - Actions
                  • Floating Text - Create floating text that reads (String((Integer(TEMP_REAL[0])))) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (350.00 - ((TEMP_REAL[0] / (Life of (Triggering unit))) x 160.00)) degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • -------- Batter --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TEMP_BOOLEAN[0] Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TEMP_INTEGER[1] Equal to 1
                • Then - Actions
                  • Unit - Increase level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                  • Wait 1.00 game-time seconds
                  • Unit - Decrease level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TEMP_INTEGER[1] Equal to 2
                    • Then - Actions
                      • Unit - Increase level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Unit - Increase level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Wait 1.00 game-time seconds
                      • Unit - Decrease level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Unit - Decrease level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                    • Else - Actions
                      • Unit - Increase level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Unit - Increase level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Unit - Increase level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Wait 1.00 game-time seconds
                      • Unit - Decrease level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Unit - Decrease level of DTSArmorDecrease (0,~-40) for (Triggering unit)
                      • Unit - Decrease level of DTSArmorDecrease (0,~-40) for (Triggering unit)
            • Else - Actions
          • -------- ///// ------ Combat Arts ------ ///// --------
        • Else - Actions



I noticed that it only happens on critical hits. (Which is only if TEMP_BOOLEAN[0] Equal to True and if TEMP_BOOLEAN[1] Equal to True.)

Any idea why the text stays there?


This is currently the only trigger that uses floating text so far, so it's pretty weird.


*And yes, I know there's some things still wrong with the trigger, I'm working on that. I'm just wondering why the text doesn't get cleaned up correctly.
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
"I noticed that it only happens on critical hits. (Which is only if TEMP_BOOLEAN[0] Equal to True and if TEMP_BOOLEAN[1] Equal to True.)"

The problem is probably that you're creating two floating texts and only giving the lifespan, fading age and disabling of permenance to the last one.

Solution: Copy+paste the triggers setting the fading age, lifespan and permenance and stick them after each 'create floating text' section. It'll make your trigger take a little longer to read but it will fix your problem.
 

Cookiemaster

New Member
Reaction score
36
"I noticed that it only happens on critical hits. (Which is only if TEMP_BOOLEAN[0] Equal to True and if TEMP_BOOLEAN[1] Equal to True.)"

The problem is probably that you're creating two floating texts and only giving the lifespan, fading age and disabling of permenance to the last one.

Solution: Copy+paste the triggers setting the fading age, lifespan and permenance and stick them after each 'create floating text' section. It'll make your trigger take a little longer to read but it will fix your problem.


It doesn't.

And I already tried that, and setting age of floating text to 0.00.


Exactly why this is so weird. :<


EDIT: Setting the floating text to a variable after creation doesn't seem to work either.
 

Exide

I am amazingly focused right now!
Reaction score
448
I believe (Last created floating text) isn't MUI.
The best thing you could do is to convert it to JASS and use local variables.
 

Cookiemaster

New Member
Reaction score
36
I believe (Last created floating text) isn't MUI.
The best thing you could do is to convert it to JASS and use local variables.

It isn't.

But I'm not using waits between the actions, so it should work properly, shouldn't it?


*And that doesn't make much sense why it only happens to critical hits.
 

Cookiemaster

New Member
Reaction score
36
Aight, here you go.
I haven't done much besides this system and terraining anyway.

Type "HIT ME." ingame to spawn units for player 1~4 so you can test it.
 

Attachments

  • Girbles005.w3x
    452.5 KB · Views: 86

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,497
> Copy+paste the triggers setting the fading age, lifespan and permenance and stick them after each 'create floating text' section

Good idea.
Unless there would be some logical proof that at least one of those booleans must be true, always.


> when there's a lot of combat going on

How much exactly is "a lot"?
There's a limit of 99 floating texts at once. Any more and... weird things may happen.
 

Cookiemaster

New Member
Reaction score
36
> Copy+paste the triggers setting the fading age, lifespan and permenance and stick them after each 'create floating text' section

Good idea.
Unless there would be some logical proof that at least one of those booleans must be true, always.


> when there's a lot of combat going on

How much exactly is "a lot"?
There's a limit of 99 floating texts at once. Any more and... weird things may happen.


I already tried that. ;-;
And the booleans indicate like this, and should work properly:
TEMP_BOOLEAN[0] True + TEMP_BOOLEAN[1] True = Miss
TEMP_BOOLEAN[0] True + TEMP_BOOLEAN[1] False = Miss
TEMP_BOOLEAN[0] False + TEMP_BOOLEAN[1] True = Critical Damage
TEMP_BOOLEAN[0] False + TEMP_BOOLEAN[1] False = Normal Damage

"A lot"... Saying the "HIT ME." command 5 times, spawning 5*12=60 units for each of the 4 players (=240), then sending them all in mass combat?

And that doesn't really make much sense when it only happens when it's a critical hit.


EDIT: Well SHIT.
Tested it on a 12v12 battle. (Each player had 6 footmen, 5 archers, 2 knights and 1 mountain king.)
And it still happened: http://img22.imageshack.us/img22/4192/dgasgdsace5.jpg
I also reduced the time after which floating text is cleaned up (after 0.6 second fade start, after 1.0 second is removed.), so it shouldn't be able to get even near the limit.





Edit2:
I believe I found the problem.
And it doesn't even make any fucking sense.
And it works properly in battles of 500 units. What the shit is this?

Apparently, instead of setting critical and evasion at the start and storing it in booleans, it works properly when it's in the if/then/else part of the floating text.

Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Random integer number between 1 and 100) Less than or equal to (10 + (5 x TEMP_INTEGER[0]))
    • Then - Actions
      • Set TEMP_REAL[0] = 0.00
      • Floating Text - Create floating text that reads Miss! above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (80.00 + (Random real number between 0.00 and 70.00)) degrees
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to (10 + (5 x TEMP_INTEGER[1]))
        • Then - Actions
          • Set TEMP_REAL[0] = (TEMP_REAL[0] x (1.00 + (Real(TEMP_INTEGER[1]))))
          • Floating Text - Create floating text that reads (String((Integer(TEMP_REAL[0])))) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (350.00 - ((TEMP_REAL[0] / (Life of (Triggering unit))) x 160.00)) degrees
        • Else - Actions
          • Floating Text - Create floating text that reads ((String((Integer(TEMP_REAL[0])))) + !) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (10.00 + ((TEMP_REAL[0] / (Life of (Triggering unit))) x 70.00)) degrees


Could someone seriously fucking explain this?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top