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

Floating Text randomly not generating

Level 7
Joined
Feb 8, 2015
Messages
123
Infuratingly I have a loop that will work to create some of the designated floating texts, while ignoring the others. I have some 12 regions in the map, each supposed to have a (permanent) floating text attached to it.

  • Float Text
    • Events
      • Time - Elapsed game time is 5.50 seconds
    • Conditions
    • Actions
      • Set VariableSet Quest_FloatTextp[1] = (Center of QuestReg CentaurOrigin <gen>)
      • Set VariableSet Quest_FloatTextp[2] = (Center of QuestReg CentaurTarget <gen>)
      • Set VariableSet Quest_FloatTextp[3] = (Center of QuestReg GhostOrigin <gen>)
      • Set VariableSet Quest_FloatTextp[4] = (Center of QuestReg GhostTarget <gen>)
      • Set VariableSet Quest_FloatTextp[5] = (Center of QuestReg LedgerOrigin <gen>)
      • Set VariableSet Quest_FloatTextp[6] = (Center of QuestReg LedgerTarget <gen>)
      • Set VariableSet Quest_FloatTextp[7] = (Center of QuestReg PumpkinOrigin <gen>)
      • Set VariableSet Quest_FloatTextp[8] = (Center of QuestReg PumpkinTarget <gen>)
      • Set VariableSet Quest_FloatTextp[9] = (Center of QuestReg SludgeOrigin <gen>)
      • Set VariableSet Quest_FloatTextp[10] = (Center of QuestReg SludgeTarget <gen>)
      • Set VariableSet Quest_FloatTextp[11] = (Center of QuestReg BrimstoneOrigin <gen>)
      • Set VariableSet Quest_FloatTextp[12] = (Center of QuestReg BrimstoneTarget <gen>)
      • Set VariableSet Quest_FloatTextstr[1] = Centaur Camp
      • Set VariableSet Quest_FloatTextstr[2] = Ratman Hollow
      • Set VariableSet Quest_FloatTextstr[3] = Weeping Ruins
      • Set VariableSet Quest_FloatTextstr[4] = Accursed Fort
      • Set VariableSet Quest_FloatTextstr[5] = The Farm
      • Set VariableSet Quest_FloatTextstr[6] = Raider Camp
      • Set VariableSet Quest_FloatTextstr[7] = Newgrowth
      • Set VariableSet Quest_FloatTextstr[8] = Petulant Pumpkin Patch
      • Set VariableSet Quest_FloatTextstr[9] = Warlock's Nook
      • Set VariableSet Quest_FloatTextstr[10] = Irradiated Swamp
      • Set VariableSet Quest_FloatTextstr[11] = Brimstone Furnace
      • Set VariableSet Quest_FloatTextstr[12] = Cindertop
      • For each (Integer Quest_FloatTexti) from 1 to 14, do (Actions)
        • Loop - Actions
          • Floating Text - Create floating text that reads Quest_FloatTextstr[Quest_FloatTexti] at Quest_FloatTextp[Quest_FloatTexti] with Z offset 0.00, using font size 10.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
          • Set VariableSet Quest_FloatText = (Last created floating text)
          • Floating Text - Change Quest_FloatText: Enable permanence
          • Floating Text - Show Quest_FloatText for (All players)
      • For each (Integer Quest_FloatTexti) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation(udg_Quest_FloatTextp[udg_Quest_FloatTexti])
Yet, for whatever reason, only two of these texts are created. Namely [8] and [10]. I tried removing and recreating (not copying) the regions, and restting the appropiate point variable. With this I was able to conjure up an additional floating text, e.g. number [7], but at the cost of disabling another one at random, e.g. [6] would then stop showing.

There are no other floating texts created on the map at this point, so I hardly think I'm encountering any sort of hard cap. Is there some other limiting behaviour in how Floating texts can be generated?
 
Worst case scenario you can try creating the texts without using a For Each Integer, it'll be tedious but should work 100%

Could it be that Quest_FloatTexti is used in some other trigger that could interfere with your For Each Integer?

(Edit: I notice it's 1 to 14, but your array goes up to 12, is that normal? I don't think it'd cause everything to mess up but who knows)
 
Hmm, how about removing the call RemoveLocation function just for testing purposes? Perhaps the points are removed too fast
No dice, I run into the same problem.


I have, however, made some progress. For testing, I added an extra event to let me force the above trigger with a chat message.
Every time I run it, I do get more floating texts created! If I run it enough, it seems I can get all 12 texts shown - but only by running the trigger repeatedly.
In one case, simply shifting around the region a little bit (moving it a few centimeters on the map) fixed the text showing.:vw_wtf:
It seems I'm running into some sort of wierd, hidden restrictions on when and how floating text can be displayed. I've even gotten to the point of text working or not working without changing the trigger... :vw_unimpressed:
 
1) This is not "Region", in gui there are only "Rects" and they are called "Region"
2) Why do you use "Quest_FloatTexti" for the loop if you can use loop integer A or B?
3) What do you need the variable "Quest_FloatText " for? Use "Last created floating text" or any temp text tag variable.
4) What do you use "Change Quest_FloatText: Enable permanence" and "Show Quest_FloatText for (All players)" for? The created tag text is initially visible to everyone and has no lifetime.
5) Why do you need a second cycle if you can delete the location at the end of the first loop?
In any case, if there is a problem, it is not here. Copy the map and delete all triggers in it except this one, everything should work.
 
I recreated your triggers in a fresh map and I faced no issues:
1757261886084.png
1757261898124.png


  • Create floating texts
    • Events
      • Time - Elapsed game time is 5.50 seconds
    • Conditions
    • Actions
      • Set VariableSet locations[1] = (Center of Region 000 <gen>)
      • Set VariableSet locations[2] = (Center of Region 001 <gen>)
      • Set VariableSet locations[3] = (Center of Region 002 <gen>)
      • Set VariableSet locations[4] = (Center of Region 003 <gen>)
      • Set VariableSet locations[5] = (Center of Region 004 <gen>)
      • Set VariableSet locations[6] = (Center of Region 005 <gen>)
      • Set VariableSet locations[7] = (Center of Region 006 <gen>)
      • Set VariableSet locations[8] = (Center of Region 007 <gen>)
      • Set VariableSet locations[9] = (Center of Region 008 <gen>)
      • Set VariableSet locations[10] = (Center of Region 009 <gen>)
      • Set VariableSet locations[11] = (Center of Region 010 <gen>)
      • Set VariableSet locations[12] = (Center of Region 011 <gen>)
      • Set VariableSet texts[1] = Loc 01
      • Set VariableSet texts[2] = Loc 02
      • Set VariableSet texts[3] = Loc 03
      • Set VariableSet texts[4] = Loc 04
      • Set VariableSet texts[5] = Loc 05
      • Set VariableSet texts[6] = Loc 06
      • Set VariableSet texts[7] = Loc 07
      • Set VariableSet texts[8] = Loc 08
      • Set VariableSet texts[9] = Loc 09
      • Set VariableSet texts[10] = Loc 10
      • Set VariableSet texts[11] = Loc 11
      • Set VariableSet texts[12] = Loc 12
      • For each (Integer iterator) from 1 to 12, do (Actions)
        • Loop - Actions
          • Floating Text - Create floating text that reads texts[iterator] at locations[iterator] with Z offset 0.00, using font size 10.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
          • Set VariableSet floatingtext = (Last created floating text)
          • Floating Text - Change floatingtext: Enable permanence
          • Floating Text - Show floatingtext for (All players)
      • For each (Integer iterator) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation( udg_locations[udg_iterator] )

Is your trigger really running? Don't you have, for example, some testing trigger which would actually run, while the one you've shown is disabled? Or something like that?
Otherwise if you can, post your map. From the trigger alone there do not seem to be any issues.
 
1) This is not "Region", in gui there are only "Rects" and they are called "Region"
2) Why do you use "Quest_FloatTexti" for the loop if you can use loop integer A or B?
3) What do you need the variable "Quest_FloatText " for? Use "Last created floating text" or any temp text tag variable.
4) What do you use "Change Quest_FloatText: Enable permanence" and "Show Quest_FloatText for (All players)" for? The created tag text is initially visible to everyone and has no lifetime.
5) Why do you need a second cycle if you can delete the location at the end of the first loop?
In any case, if there is a problem, it is not here. Copy the map and delete all triggers in it except this one, everything should work.
2) to be honest, because I didn't know how to reference Int A or B in the custom script index, so I went with "udg_Quest_FloatTexti":
Not that I haven't tried using a region array and a generic Tempp, but that wasn't any better.
3-4) I used the variable because I thought I needed both those actions, and figured declaring it as a variable once, and refering to that, would be faster/safer than using
  • Last Created...
twice
5) Basically on Chaosium's advice. Being afraid I was deleting something to fast.
Sadly what you see is already several steps of "this shouldn't make a difference... but I have to try something."
Is your trigger really running? Don't you have, for example, some testing trigger which would actually run, while the one you've shown is disabled? Or something like that?
Otherwise if you can, post your map. From the trigger alone there do not seem to be any issues.
I'm positive the trigger is running - as I mentioned earlier some of the floating text markers do appear every time. It's just that most of them don't.

Any way - here I've attached a copy of the map. Scrupped of all other triggers, and even reset some object data - just for good measure.
Still only consistently shows messages [3], [6], and [10] for whatever reason.
Again, by spamming "test" and running the same trigger multiple times, I can get more of the floating texts showing :goblin_wtf:
 

Attachments

I didn't really find what caused the issue, but I did find a way which at least for me reliably showed all floating texts: by setting floating text's text again.
In other words, in your trigger I added one more action beneath the action which creates floating text:
  • Floating Text - Create floating text that reads Quest_FloatTextstr[Quest_FloatTexti] at Quest_FloatTextp[Quest_FloatTexti] with Z offset 0.00, using font size 10.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
  • Floating Text - Change text of (Last created floating text) to Quest_FloatTextstr[Quest_FloatTexti] using font size 10.00
I don't know why this fixes the issue, as the trigger action for creating floating text at location is basically just a wrapper function that creates floating text, sets its text and then sets its position (in that order).
When I tried to create floating text with a bit of a delay at the center of map (where I also had camera), it seemed to work as well. So I can only assume that during its initial creation a floating text may not show it if it outside of camera bounds? It sounds like a bug, but I dunno.

What I've checked:
  • Modified Z-offset: no impact
  • Variables had valid values - printed passed values as messages
  • Checked that the create floating text action works: that had no issues - returned object had valid handleID
  • Tried hiding/showing floating text: no impact
  • Tried using delays between creation of each floating text: no impact
  • Tried to create floating text where camera was positioned, waited 0.1 sec, then moved floating text to correct position: worked OK
  • Some not-visible floating texts were closer to my camera position than other visible ones (but still all were out of camera bounds). It seems distance to camera did not play role in which floating text would remain visible and which not.
  • Changed text to same value as it previously had: Displayed floating texts that were not yet visible, irrespective of camera position
 
There's a 100 active floating text limit as far as I understand, so maybe you're running into that.
 
So, since I am a professional tester, I was able to reproduce the bug, but I will not pass judgment, I will leave it to the programmers, especially since it is late.
The bug is somehow related to the position of the player's camera, If a text tag is created too far from the player's camera, it will become invisible to the player (or everyone), all coordinates x/y/z are important.
I can offer to watch the video and demo maps, one for 1.26 and one for reforged.
That is, the distance to the player's camera at the time of creation matters, but if you first create all the text tags in the player's camera and then change their position after a while, the player will see them all.
However, a too short timer (0.01) does not work, but 0.10 does.
Apparently, the player must first "see" the text tag and then it can be moved. In the map for 1.26 in the trigger "Untitled Trigger 001" there is a method with a timer that works.
So at least you can use this method.
Never seen such bugs, I suspect that the problem is that you create them one after another, because in my damage display systems everything always works perfectly. In general, I fuck wc3.

 

Attachments

There's a 100 active floating text limit as far as I understand, so maybe you're running into that.
No, this was also a case in the test map, where (based on handleId) those were first 10 floating texts in the entire game and some just did not show.
 
I didn't really find what caused the issue, but I did find a way which at least for me reliably showed all floating texts: by setting floating text's text again.
In other words, in your trigger I added one more action beneath the action which creates floating text:
  • Floating Text - Create floating text that reads Quest_FloatTextstr[Quest_FloatTexti] at Quest_FloatTextp[Quest_FloatTexti] with Z offset 0.00, using font size 10.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
  • Floating Text - Change text of (Last created floating text) to Quest_FloatTextstr[Quest_FloatTexti] using font size 10.00
I don't know why this fixes the issue, as the trigger action for creating floating text at location is basically just a wrapper function that creates floating text, sets its text and then sets its position (in that order).
When I tried to create floating text with a bit of a delay at the center of map (where I also had camera), it seemed to work as well. So I can only assume that during its initial creation a floating text may not show it if it outside of camera bounds? It sounds like a bug, but I dunno.

What I've checked:
  • Modified Z-offset: no impact
  • Variables had valid values - printed passed values as messages
  • Checked that the create floating text action works: that had no issues - returned object had valid handleID
  • Tried hiding/showing floating text: no impact
  • Tried using delays between creation of each floating text: no impact
  • Tried to create floating text where camera was positioned, waited 0.1 sec, then moved floating text to correct position: worked OK
  • Some not-visible floating texts were closer to my camera position than other visible ones (but still all were out of camera bounds). It seems distance to camera did not play role in which floating text would remain visible and which not.
  • Changed text to same value as it previously had: Displayed floating texts that were not yet visible, irrespective of camera position
This, finally, worked! Thanks a dozen for all the help.

At least I feel validated by how nonsensical this bug - and the solution - was. :ugly::xxd:
Solved!
 
Back
Top