• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Floating Text randomly doesn't display

Status
Not open for further replies.
Level 28
Joined
Mar 25, 2008
Messages
2,954
So, the following snippet is supposed to randomly pick a point on the map and create units accompanied by a floating text.
Creating units works fine but the FText doesn't work for all of them (sometimes 3, sometimes 4) although it's the exact same "code".
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 2) Equal to 1
      • Then - Actions
        • For each (Integer A) from 1 to 2, do (Actions)
          • Loop - Actions
            • Set aura_rnd_pkt = (Random point in region bla <gen>)
            • Unit - Create 1 +MS Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
            • Floating Text - Create floating text that reads |cFF8080C0+Movement... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
            • Set aura_textms[(Integer A)] = (Last created floating text)
            • Floating Text - Show aura_textms[(Integer A)] for (All players)
            • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
      • Else - Actions
        • Set aura_rnd_pkt = (Random point in region bla <gen>)
        • Unit - Create 1 +MS Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
        • Floating Text - Create floating text that reads |cFF8080C0+Movement... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Set aura_textms[0] = (Last created floating text)
        • Floating Text - Show aura_textms[0] for (All players)
        • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 2) Equal to 1
      • Then - Actions
        • For each (Integer A) from 1 to 2, do (Actions)
          • Loop - Actions
            • Set aura_rnd_pkt = (Random point in region bla <gen>)
            • Unit - Create 1 -AS Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
            • Floating Text - Create floating text that reads |cFF8080C0-Attack S... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
            • Set aura_textas[(Integer A)] = (Last created floating text)
            • Floating Text - Show aura_textas[(Integer A)] for (All players)
            • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
      • Else - Actions
        • Set aura_rnd_pkt = (Random point in region bla <gen>)
        • Unit - Create 1 -AS Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
        • Floating Text - Create floating text that reads |cFF8080C0-Attack S... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Set aura_textas[0] = (Last created floating text)
        • Floating Text - Show aura_textas[0] for (All players)
        • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 2) Equal to 1
      • Then - Actions
        • For each (Integer A) from 1 to 2, do (Actions)
          • Loop - Actions
            • Set aura_rnd_pkt = (Random point in region bla <gen>)
            • Unit - Create 1 -ATK Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
            • Floating Text - Create floating text that reads |cFF8080C0-Attack D... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
            • Set aura_textatk[(Integer A)] = (Last created floating text)
            • Floating Text - Show aura_textatk[(Integer A)] for (All players)
            • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
      • Else - Actions
        • Set aura_rnd_pkt = (Random point in region bla <gen>)
        • Unit - Create 1 -ATK Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
        • Floating Text - Create floating text that reads |cFF8080C0-Attack D... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Set aura_textatk[0] = (Last created floating text)
        • Floating Text - Show aura_textatk[0] for (All players)
        • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 2) Equal to 1
      • Then - Actions
        • For each (Integer A) from 1 to 2, do (Actions)
          • Loop - Actions
            • Set aura_rnd_pkt = (Random point in region bla <gen>)
            • Unit - Create 1 +HP Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
            • Floating Text - Create floating text that reads |cFF8080C0+HP Regen... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
            • Set aura_texthp[(Integer A)] = (Last created floating text)
            • Floating Text - Show aura_texthp[(Integer A)] for (All players)
            • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
      • Else - Actions
        • Set aura_rnd_pkt = (Random point in region bla <gen>)
        • Unit - Create 1 +HP Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
        • Floating Text - Create floating text that reads |cFF8080C0+HP Regen... at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Set aura_texthp[0] = (Last created floating text)
        • Floating Text - Show aura_texthp[0] for (All players)
        • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 2) Equal to 1
      • Then - Actions
        • For each (Integer A) from 1 to 2, do (Actions)
          • Loop - Actions
            • Set aura_rnd_pkt = (Random point in region bla <gen>)
            • Unit - Create 1 +AR Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
            • Floating Text - Create floating text that reads |cFF8080C0+Armor|r at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
            • Set aura_textarmor[(Integer A)] = (Last created floating text)
            • Floating Text - Show aura_textarmor[(Integer A)] for (All players)
            • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
      • Else - Actions
        • Set aura_rnd_pkt = (Random point in region bla <gen>)
        • Unit - Create 1 +AR Aura for Player 12 (Brown) at aura_rnd_pkt facing Default building facing degrees
        • Floating Text - Create floating text that reads |cFF8080C0+Armor|r at aura_rnd_pkt with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Set aura_textarmor[0] = (Last created floating text)
        • Floating Text - Show aura_textarmor[0] for (All players)
        • Custom script: call RemoveLocation(udg_aura_rnd_pkt)
My skills are very very rusty and I may be just blind but I'm thankful for anyone able to point out how it works.
 
I had a similar issue with floating text. It seems like it doesn't draw it for the player if their screen is not nearby. I don't know the exact problem since I went with a different solution afterwards. I didn't solve the problem either, but at least this may give some insight.

I may look into it later tonight if no solution is found yet.
 
One way is to recreate the floating text.



I've made text "follow" a unit in a spell I made but never encountered particular issues with it. I just make sure the floating text is destroyed before it reposition again at certain interval.

My trigger example redraws the floating text at short intervals.
  • Text Movement
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FloatTextGroup and do (Actions)
        • Loop - Actions
          • Custom script: set udg_Temp_Integer = GetCustomIntValue (GetEnumUnit())
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer Greater than 0
            • Then - Actions
              • For each (Integer A) from 1 to IndexCount, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UnitTextIndex[(Integer A)] Equal to (Picked unit)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked unit) has buff Protective Shield ) Equal to False
                        • Then - Actions
                          • Custom script: call SetCustomIntValue(GetEnumUnit(), 0)
                          • Floating Text - Destroy FloatText[(Integer A)]
                          • Set UnitTextIndex[(Integer A)] = No unit
                          • Unit Group - Remove (Picked unit) from FloatTextGroup
                        • Else - Actions
                          • Floating Text - Destroy FloatText[(Integer A)]
                          • Set Temp_Real = (Real(Temp_Integer))
                          • Floating Text - Create floating text that reads (+ + ((String((Integer(Temp_Real)))) + HP)) above UnitTextIndex[(Integer A)] with Z offset 40.00, etc...
                          • Floating Text - Change FloatText[(Integer A)]: Disable permanence
                          • Floating Text - Change the lifespan of FloatText[(Integer A)] to 0.20 seconds
                          • Set FloatText[(Integer A)] = (Last created floating text)
                    • Else - Actions
            • Else - Actions
              • Unit Group - Remove (Picked unit) from FloatTextGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in FloatTextGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
132929-albums8269-picture99651.jpg

But I don't know rest of your triggers. Hope this helps a bit. But my example isn't point related but unit related.
 
Status
Not open for further replies.
Back
Top